payload

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PayloadTypeSend      = Type(1)
	PayloadTypeBond      = Type(2)
	PayloadTypeSortition = Type(3)
	PayloadTypeUnbond    = Type(4)
	PayloadTypeWithdraw  = Type(5)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BondPayload

type BondPayload struct {
	Sender    crypto.Address
	Receiver  crypto.Address
	PublicKey *bls.PublicKey
	Stake     int64
}

func (*BondPayload) Decode

func (p *BondPayload) Decode(r io.Reader) error

func (*BondPayload) Encode

func (p *BondPayload) Encode(w io.Writer) error

func (*BondPayload) Fingerprint

func (p *BondPayload) Fingerprint() string

func (*BondPayload) SanityCheck

func (p *BondPayload) SanityCheck() error

func (*BondPayload) SerializeSize

func (p *BondPayload) SerializeSize() int

func (*BondPayload) Signer

func (p *BondPayload) Signer() crypto.Address

func (*BondPayload) Type

func (p *BondPayload) Type() Type

func (*BondPayload) Value

func (p *BondPayload) Value() int64

type Payload

type Payload interface {
	Signer() crypto.Address
	Value() int64
	Type() Type
	SerializeSize() int
	Encode(io.Writer) error
	Decode(io.Reader) error
	SanityCheck() error
	Fingerprint() string
}

type SendPayload

type SendPayload struct {
	Sender   crypto.Address
	Receiver crypto.Address
	Amount   int64
}

func (*SendPayload) Decode

func (p *SendPayload) Decode(r io.Reader) error

func (*SendPayload) Encode

func (p *SendPayload) Encode(w io.Writer) error

func (*SendPayload) Fingerprint

func (p *SendPayload) Fingerprint() string

func (*SendPayload) SanityCheck

func (p *SendPayload) SanityCheck() error

func (*SendPayload) SerializeSize

func (p *SendPayload) SerializeSize() int

func (*SendPayload) Signer

func (p *SendPayload) Signer() crypto.Address

func (*SendPayload) Type

func (p *SendPayload) Type() Type

func (*SendPayload) Value

func (p *SendPayload) Value() int64

type SortitionPayload

type SortitionPayload struct {
	Address crypto.Address
	Proof   sortition.Proof
}

func (*SortitionPayload) Decode

func (p *SortitionPayload) Decode(r io.Reader) error

func (*SortitionPayload) Encode

func (p *SortitionPayload) Encode(w io.Writer) error

func (*SortitionPayload) Fingerprint

func (p *SortitionPayload) Fingerprint() string

func (*SortitionPayload) SanityCheck

func (p *SortitionPayload) SanityCheck() error

func (*SortitionPayload) SerializeSize

func (p *SortitionPayload) SerializeSize() int

func (*SortitionPayload) Signer

func (p *SortitionPayload) Signer() crypto.Address

func (*SortitionPayload) Type

func (p *SortitionPayload) Type() Type

func (*SortitionPayload) Value

func (p *SortitionPayload) Value() int64

type Type

type Type uint8

func (Type) String

func (t Type) String() string

type UnbondPayload

type UnbondPayload struct {
	Validator crypto.Address
}

func (*UnbondPayload) Decode

func (p *UnbondPayload) Decode(r io.Reader) error

func (*UnbondPayload) Encode

func (p *UnbondPayload) Encode(w io.Writer) error

func (*UnbondPayload) Fingerprint

func (p *UnbondPayload) Fingerprint() string

func (*UnbondPayload) SanityCheck

func (p *UnbondPayload) SanityCheck() error

func (*UnbondPayload) SerializeSize

func (p *UnbondPayload) SerializeSize() int

func (*UnbondPayload) Signer

func (p *UnbondPayload) Signer() crypto.Address

func (*UnbondPayload) Type

func (p *UnbondPayload) Type() Type

func (*UnbondPayload) Value

func (p *UnbondPayload) Value() int64

type WithdrawPayload

type WithdrawPayload struct {
	From   crypto.Address // withdraw from validator address
	To     crypto.Address // deposit to account address
	Amount int64          // amount to deposit
}

func (*WithdrawPayload) Decode

func (p *WithdrawPayload) Decode(r io.Reader) error

func (*WithdrawPayload) Encode

func (p *WithdrawPayload) Encode(w io.Writer) error

func (*WithdrawPayload) Fingerprint

func (p *WithdrawPayload) Fingerprint() string

func (*WithdrawPayload) SanityCheck

func (p *WithdrawPayload) SanityCheck() error

func (*WithdrawPayload) SerializeSize

func (p *WithdrawPayload) SerializeSize() int

func (*WithdrawPayload) Signer

func (p *WithdrawPayload) Signer() crypto.Address

func (*WithdrawPayload) Type

func (p *WithdrawPayload) Type() Type

func (*WithdrawPayload) Value

func (p *WithdrawPayload) Value() int64

Jump to

Keyboard shortcuts

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