Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const (
// ObjectName defines the name of the faucet object (payload).
ObjectName = "faucet"
)
Variables ¶
View Source
var (
Type = payload.NewType(payloadType, ObjectName, PayloadUnmarshaler)
)
Type represents the identifier for the faucet Request type.
Functions ¶
func IsFaucetReq ¶
IsFaucetReq checks if the message is faucet payload.
Types ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request represents a faucet request which contains an address for the faucet to send funds to.
Example ¶
keyPair := ed25519.GenerateKeyPair() address := ledgerstate.NewED25519Address(keyPair.PublicKey) local := identity.NewLocalIdentity(keyPair.PublicKey, keyPair.PrivateKey) emptyID := identity.ID{} // 1. create faucet payload faucetRequest := NewRequest(address, emptyID, emptyID, 0) // 2. build actual message tx := tangle.NewMessage( []tangle.MessageID{tangle.EmptyMessageID}, []tangle.MessageID{}, time.Now(), local.PublicKey(), 0, faucetRequest, 0, ed25519.EmptySignature, ) fmt.Println(tx.String())
Output:
func NewRequest ¶
func NewRequest(addr ledgerstate.Address, accessManaPledgeID, consensusManaPledgeID identity.ID, nonce uint64) *Request
NewRequest is the constructor of a Request and creates a new Request object from the given details.
func (*Request) AccessManaPledgeID ¶
AccessManaPledgeID returns the access mana pledge ID of the faucet request.
func (*Request) Address ¶
func (p *Request) Address() ledgerstate.Address
Address returns the address of the faucet Request.
func (*Request) ConsensusManaPledgeID ¶
ConsensusManaPledgeID returns the consensus mana pledge ID of the faucet request.
Click to show internal directories.
Click to hide internal directories.