tx

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: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID = hash.Hash

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

func FromBytes

func FromBytes(bs []byte) (*Tx, error)

FromBytes constructs a new transaction from byte array.

func GenerateTestBondTx

func GenerateTestBondTx() (*Tx, crypto.Signer)

GenerateTestSendTx generates a bond transaction for testing.

func GenerateTestSendTx

func GenerateTestSendTx() (*Tx, crypto.Signer)

GenerateTestSendTx generates a send transaction for testing.

func GenerateTestSortitionTx

func GenerateTestSortitionTx() (*Tx, crypto.Signer)

GenerateTestSendTx generates a sortition transaction for testing.

func GenerateTestUnbondTx

func GenerateTestUnbondTx() (*Tx, crypto.Signer)

GenerateTestSendTx generates an unbond transaction for testing.

func GenerateTestWithdrawTx

func GenerateTestWithdrawTx() (*Tx, crypto.Signer)

GenerateTestSendTx generates a withdraw transaction for testing.

func NewBondTx

func NewBondTx(stamp hash.Stamp, seq int32,
	sender, receiver crypto.Address,
	pubKey *bls.PublicKey,
	stake, fee int64, memo string) *Tx

func NewLockTimeTx

func NewLockTimeTx(lockTime uint32, seq int32, pld payload.Payload, fee int64,
	memo string) *Tx

func NewSendTx

func NewSendTx(stamp hash.Stamp, seq int32,
	sender, receiver crypto.Address,
	amount, fee int64, memo string) *Tx

func NewSortitionTx

func NewSortitionTx(stamp hash.Stamp, seq int32,
	addr crypto.Address,
	proof sortition.Proof) *Tx

func NewSubsidyTx

func NewSubsidyTx(stamp hash.Stamp, seq int32,
	receiver crypto.Address, amount int64, memo string) *Tx

func NewTx

func NewTx(stamp hash.Stamp, seq int32, pld payload.Payload, fee int64,
	memo string) *Tx

func NewUnbondTx

func NewUnbondTx(stamp hash.Stamp, seq int32,
	val crypto.Address,
	memo string) *Tx

func NewWithdrawTx

func NewWithdrawTx(stamp hash.Stamp, seq int32,
	val crypto.Address,
	acc crypto.Address,
	amount, fee int64,
	memo string) *Tx

func (*Tx) Bytes

func (tx *Tx) Bytes() ([]byte, error)

Bytes returns the serialized bytes for the Transaction.

func (*Tx) Decode

func (tx *Tx) Decode(r io.Reader) error

func (*Tx) DecodeWithNoSignatory

func (tx *Tx) DecodeWithNoSignatory(r io.Reader) error

func (*Tx) Encode

func (tx *Tx) Encode(w io.Writer) error

func (*Tx) EncodeWithNoSignatory

func (tx *Tx) EncodeWithNoSignatory(w io.Writer) error

func (*Tx) Fee

func (tx *Tx) Fee() int64

func (*Tx) Fingerprint

func (tx *Tx) Fingerprint() string

func (*Tx) ID

func (tx *Tx) ID() ID

func (*Tx) IsBondTx

func (tx *Tx) IsBondTx() bool

func (*Tx) IsFreeTx

func (tx *Tx) IsFreeTx() bool

IsFreeTx will checks if transaction fee is 0.

func (*Tx) IsLockTime

func (tx *Tx) IsLockTime() bool

func (*Tx) IsSendTx

func (tx *Tx) IsSendTx() bool

func (*Tx) IsSortitionTx

func (tx *Tx) IsSortitionTx() bool

func (*Tx) IsStamped

func (tx *Tx) IsStamped() bool

func (*Tx) IsSubsidyTx

func (tx *Tx) IsSubsidyTx() bool

func (*Tx) IsUnbondTx

func (tx *Tx) IsUnbondTx() bool

func (*Tx) IsWithdrawTx

func (tx *Tx) IsWithdrawTx() bool

func (*Tx) LockTime

func (tx *Tx) LockTime() uint32

func (*Tx) MarshalCBOR

func (tx *Tx) MarshalCBOR() ([]byte, error)

func (*Tx) Memo

func (tx *Tx) Memo() string

func (*Tx) Payload

func (tx *Tx) Payload() payload.Payload

func (*Tx) PublicKey

func (tx *Tx) PublicKey() crypto.PublicKey

func (*Tx) SanityCheck

func (tx *Tx) SanityCheck() error

func (*Tx) Sequence

func (tx *Tx) Sequence() int32

func (*Tx) SerializeSize

func (tx *Tx) SerializeSize() int

SerializeSize returns the number of bytes it would take to serialize the transaction.

func (*Tx) SetPublicKey

func (tx *Tx) SetPublicKey(pub crypto.PublicKey)

func (*Tx) SetSignature

func (tx *Tx) SetSignature(sig crypto.Signature)

func (*Tx) SignBytes

func (tx *Tx) SignBytes() []byte

func (*Tx) Signature

func (tx *Tx) Signature() crypto.Signature

func (*Tx) Stamp

func (tx *Tx) Stamp() hash.Stamp

func (*Tx) UnmarshalCBOR

func (tx *Tx) UnmarshalCBOR(bs []byte) error

func (*Tx) Version

func (tx *Tx) Version() uint8

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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