faucet

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 3, 2023 License: Apache-2.0, BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ObjectName defines the name of the faucet object (payload).
	ObjectName = "faucet"
)

Variables

View Source
var (
	RequestType = payload.NewType(payloadType, ObjectName)
)

RequestType represents the identifier for the faucet Payload type.

Functions

func IsFaucetReq

func IsFaucetReq(blk *mesh_old.Block) bool

IsFaucetReq checks if the block is faucet payload.

Types

type Payload

type Payload struct {
	model.Immutable[Payload, *Payload, requestModel] `serix:"0"`
}

Payload represents a faucet request which contains an address for the faucet to send funds to.

func FromBytes

func FromBytes(data []byte) (payloadDecoded *Payload, consumedBytes int, err error)

FromBytes parses the marshaled version of a Payload into a Go object. It either returns a new Payload or fills an optionally provided Payload with the parsed information.

func NewRequest

func NewRequest(addr devnetvm.Address, accessManaPledgeID, consensusManaPledgeID identity.ID, nonce uint64) *Payload

NewRequest is the constructor of a Payload and creates a new Payload object from the given details.

func (*Payload) AccessManaPledgeID

func (p *Payload) AccessManaPledgeID() identity.ID

AccessManaPledgeID returns the access mana pledge ID of the faucet request.

func (*Payload) Address

func (p *Payload) Address() devnetvm.Address

Address returns the address of the faucet Payload.

func (*Payload) ConsensusManaPledgeID

func (p *Payload) ConsensusManaPledgeID() identity.ID

ConsensusManaPledgeID returns the consensus mana pledge ID of the faucet request.

func (*Payload) SetAccessManaPledgeID

func (p *Payload) SetAccessManaPledgeID(id identity.ID)

SetAccessManaPledgeID sets the access mana pledge ID of the faucet request.

func (*Payload) SetConsensusManaPledgeID

func (p *Payload) SetConsensusManaPledgeID(id identity.ID)

SetConsensusManaPledgeID sets the consensus mana pledge ID of the faucet request.

func (*Payload) Type

func (p *Payload) Type() payload.Type

Type returns the type of the faucet Payload.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL