transactions

package
v0.0.0-...-ff2c966 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: AGPL-3.0 Imports: 18 Imported by: 3

Documentation

Index

Constants

View Source
const EvalMaxArgs = 255

EvalMaxArgs is the maximum number of arguments to an LSig

Variables

View Source
var StateProofSender basics.Address

StateProofSender is the computed address for sending out state proofs.

Functions

func ApplicationCallTxnFieldsMaxSize

func ApplicationCallTxnFieldsMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func ApplyDataMaxSize

func ApplyDataMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func AssetConfigTxnFieldsMaxSize

func AssetConfigTxnFieldsMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func AssetFreezeTxnFieldsMaxSize

func AssetFreezeTxnFieldsMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func AssetTransferTxnFieldsMaxSize

func AssetTransferTxnFieldsMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func BoxRefMaxSize

func BoxRefMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func CheckContractVersions

func CheckContractVersions(approval []byte, clear []byte, previous basics.AppParams, proto *config.ConsensusParams) error

CheckContractVersions ensures that for syncProgramsVersion and higher, two programs are version matched, and that they are not a downgrade. If either program version is >= proto.MinInnerApplVersion, downgrade of that program is not allowed.

func EvalDeltaMaxSize

func EvalDeltaMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func HeaderMaxSize

func HeaderMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func KeyregTxnFieldsMaxSize

func KeyregTxnFieldsMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func LogicSigMaxSize

func LogicSigMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func OnCompletionMaxSize

func OnCompletionMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func PaymentTxnFieldsMaxSize

func PaymentTxnFieldsMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func PaysetMaxSize

func PaysetMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func ProgramVersion

func ProgramVersion(bytecode []byte) (version uint64, length int, err error)

ProgramVersion extracts the version of an AVM program from its bytecode

func SignedTxnInBlockMaxSize

func SignedTxnInBlockMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func SignedTxnMaxSize

func SignedTxnMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func SignedTxnWithADMaxSize

func SignedTxnWithADMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func StateProofTxnFieldsMaxSize

func StateProofTxnFieldsMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func TransactionMaxSize

func TransactionMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func TxGroupMaxSize

func TxGroupMaxSize() (s int)

MaxSize returns a maximum valid message size for this message type

func TxidMaxSize

func TxidMaxSize() int

MaxSize returns a maximum valid message size for this message type

Types

type ApplicationCallTxnFields

type ApplicationCallTxnFields struct {

	// ApplicationID is 0 when creating an application, and nonzero when
	// calling an existing application.
	ApplicationID basics.AppIndex `codec:"apid"`

	// OnCompletion specifies an optional side-effect that this transaction
	// will have on the balance record of the sender or the application's
	// creator. See the documentation for the OnCompletion type for more
	// information on each possible value.
	OnCompletion OnCompletion `codec:"apan"`

	// ApplicationArgs are arguments accessible to the executing
	// ApprovalProgram or ClearStateProgram.
	ApplicationArgs [][]byte `codec:"apaa,allocbound=encodedMaxApplicationArgs,maxtotalbytes=config.MaxAppTotalArgLen"`

	// Accounts are accounts whose balance records are accessible
	// by the executing ApprovalProgram or ClearStateProgram. To
	// access LocalState or an ASA balance for an account besides
	// the sender, that account's address must be listed here (and
	// since v4, the ForeignApp or ForeignAsset must also include
	// the app or asset id).
	Accounts []basics.Address `codec:"apat,allocbound=encodedMaxAccounts"`

	// ForeignApps are application IDs for applications besides
	// this one whose GlobalState (or Local, since v4) may be read
	// by the executing ApprovalProgram or ClearStateProgram.
	ForeignApps []basics.AppIndex `codec:"apfa,allocbound=encodedMaxForeignApps"`

	// Boxes are the boxes that can be accessed by this transaction (and others
	// in the same group). The Index in the BoxRef is the slot of ForeignApps
	// that the name is associated with (shifted by 1, so 0 indicates "current
	// app")
	Boxes []BoxRef `codec:"apbx,allocbound=encodedMaxBoxes"`

	// ForeignAssets are asset IDs for assets whose AssetParams
	// (and since v4, Holdings) may be read by the executing
	// ApprovalProgram or ClearStateProgram.
	ForeignAssets []basics.AssetIndex `codec:"apas,allocbound=encodedMaxForeignAssets"`

	// LocalStateSchema specifies the maximum number of each type that may
	// appear in the local key/value store of users who opt in to this
	// application. This field is only used during application creation
	// (when the ApplicationID field is 0),
	LocalStateSchema basics.StateSchema `codec:"apls"`

	// GlobalStateSchema specifies the maximum number of each type that may
	// appear in the global key/value store associated with this
	// application. This field is only used during application creation
	// (when the ApplicationID field is 0).
	GlobalStateSchema basics.StateSchema `codec:"apgs"`

	// ApprovalProgram is the stateful TEAL bytecode that executes on all
	// ApplicationCall transactions associated with this application,
	// except for those where OnCompletion is equal to ClearStateOC. If
	// this program fails, the transaction is rejected. This program may
	// read and write local and global state for this application.
	ApprovalProgram []byte `codec:"apap,allocbound=config.MaxAvailableAppProgramLen"`

	// ClearStateProgram is the stateful TEAL bytecode that executes on
	// ApplicationCall transactions associated with this application when
	// OnCompletion is equal to ClearStateOC. This program will not cause
	// the transaction to be rejected, even if it fails. This program may
	// read and write local and global state for this application.
	ClearStateProgram []byte `codec:"apsu,allocbound=config.MaxAvailableAppProgramLen"`

	// ExtraProgramPages specifies the additional app program len requested in pages.
	// A page is MaxAppProgramLen bytes. This field enables execution of app programs
	// larger than the default config, MaxAppProgramLen.
	ExtraProgramPages uint32 `codec:"apep,omitempty"`
	// contains filtered or unexported fields
}

ApplicationCallTxnFields captures the transaction fields used for all interactions with applications

func (*ApplicationCallTxnFields) AddressByIndex

func (ac *ApplicationCallTxnFields) AddressByIndex(accountIdx uint64, sender basics.Address) (basics.Address, error)

AddressByIndex converts an integer index into an address associated with the transaction. Index 0 corresponds to the transaction sender, and an index > 0 corresponds to an offset into txn.Accounts. Returns an error if the index is not valid.

func (*ApplicationCallTxnFields) CanMarshalMsg

func (_ *ApplicationCallTxnFields) CanMarshalMsg(z interface{}) bool

func (*ApplicationCallTxnFields) CanUnmarshalMsg

func (_ *ApplicationCallTxnFields) CanUnmarshalMsg(z interface{}) bool

func (*ApplicationCallTxnFields) Empty

func (ac *ApplicationCallTxnFields) Empty() bool

Empty indicates whether or not all the fields in the ApplicationCallTxnFields are zeroed out

func (*ApplicationCallTxnFields) IndexByAddress

func (ac *ApplicationCallTxnFields) IndexByAddress(target basics.Address, sender basics.Address) (uint64, error)

IndexByAddress converts an address into an integer offset into [txn.Sender, txn.Accounts[0], ...], returning the index at the first match. It returns an error if there is no such match.

func (*ApplicationCallTxnFields) MarshalMsg

func (z *ApplicationCallTxnFields) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*ApplicationCallTxnFields) MsgIsZero

func (z *ApplicationCallTxnFields) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*ApplicationCallTxnFields) Msgsize

func (z *ApplicationCallTxnFields) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ApplicationCallTxnFields) UnmarshalMsg

func (z *ApplicationCallTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*ApplicationCallTxnFields) UnmarshalMsgWithState

func (z *ApplicationCallTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ApplyData

type ApplyData struct {

	// Closing amount for transaction.
	ClosingAmount basics.MicroAlgos `codec:"ca"`

	// Closing amount for asset transaction.
	AssetClosingAmount uint64 `codec:"aca"`

	// Rewards applied to the Sender, Receiver, and CloseRemainderTo accounts.
	SenderRewards   basics.MicroAlgos `codec:"rs"`
	ReceiverRewards basics.MicroAlgos `codec:"rr"`
	CloseRewards    basics.MicroAlgos `codec:"rc"`
	EvalDelta       EvalDelta         `codec:"dt"`

	// If asa or app is being created, the id used. Else 0.
	// Names chosen to match naming the corresponding txn.
	// These are populated only when MaxInnerTransactions > 0 (TEAL 5)
	ConfigAsset   basics.AssetIndex `codec:"caid"`
	ApplicationID basics.AppIndex   `codec:"apid"`
	// contains filtered or unexported fields
}

ApplyData contains information about the transaction's execution.

func (*ApplyData) CanMarshalMsg

func (_ *ApplyData) CanMarshalMsg(z interface{}) bool

func (*ApplyData) CanUnmarshalMsg

func (_ *ApplyData) CanUnmarshalMsg(z interface{}) bool

func (ApplyData) Equal

func (ad ApplyData) Equal(o ApplyData) bool

Equal returns true if two ApplyDatas are equal, ignoring nilness equality on EvalDelta's internal deltas (see EvalDelta.Equal for more information)

func (*ApplyData) MarshalMsg

func (z *ApplyData) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*ApplyData) MsgIsZero

func (z *ApplyData) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*ApplyData) Msgsize

func (z *ApplyData) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ApplyData) UnmarshalMsg

func (z *ApplyData) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*ApplyData) UnmarshalMsgWithState

func (z *ApplyData) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type AssetConfigTxnFields

type AssetConfigTxnFields struct {

	// ConfigAsset is the asset being configured or destroyed.
	// A zero value means allocation
	ConfigAsset basics.AssetIndex `codec:"caid"`

	// AssetParams are the parameters for the asset being
	// created or re-configured.  A zero value means destruction.
	AssetParams basics.AssetParams `codec:"apar"`
	// contains filtered or unexported fields
}

AssetConfigTxnFields captures the fields used for asset allocation, re-configuration, and destruction.

func (*AssetConfigTxnFields) CanMarshalMsg

func (_ *AssetConfigTxnFields) CanMarshalMsg(z interface{}) bool

func (*AssetConfigTxnFields) CanUnmarshalMsg

func (_ *AssetConfigTxnFields) CanUnmarshalMsg(z interface{}) bool

func (*AssetConfigTxnFields) MarshalMsg

func (z *AssetConfigTxnFields) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*AssetConfigTxnFields) MsgIsZero

func (z *AssetConfigTxnFields) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*AssetConfigTxnFields) Msgsize

func (z *AssetConfigTxnFields) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*AssetConfigTxnFields) UnmarshalMsg

func (z *AssetConfigTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*AssetConfigTxnFields) UnmarshalMsgWithState

func (z *AssetConfigTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type AssetFreezeTxnFields

type AssetFreezeTxnFields struct {

	// FreezeAccount is the address of the account whose asset
	// slot is being frozen or un-frozen.
	FreezeAccount basics.Address `codec:"fadd"`

	// FreezeAsset is the asset ID being frozen or un-frozen.
	FreezeAsset basics.AssetIndex `codec:"faid"`

	// AssetFrozen is the new frozen value.
	AssetFrozen bool `codec:"afrz"`
	// contains filtered or unexported fields
}

AssetFreezeTxnFields captures the fields used for freezing asset slots.

func (*AssetFreezeTxnFields) CanMarshalMsg

func (_ *AssetFreezeTxnFields) CanMarshalMsg(z interface{}) bool

func (*AssetFreezeTxnFields) CanUnmarshalMsg

func (_ *AssetFreezeTxnFields) CanUnmarshalMsg(z interface{}) bool

func (*AssetFreezeTxnFields) MarshalMsg

func (z *AssetFreezeTxnFields) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*AssetFreezeTxnFields) MsgIsZero

func (z *AssetFreezeTxnFields) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*AssetFreezeTxnFields) Msgsize

func (z *AssetFreezeTxnFields) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*AssetFreezeTxnFields) UnmarshalMsg

func (z *AssetFreezeTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*AssetFreezeTxnFields) UnmarshalMsgWithState

func (z *AssetFreezeTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type AssetTransferTxnFields

type AssetTransferTxnFields struct {
	XferAsset basics.AssetIndex `codec:"xaid"`

	// AssetAmount is the amount of asset to transfer.
	// A zero amount transferred to self allocates that asset
	// in the account's Assets map.
	AssetAmount uint64 `codec:"aamt"`

	// AssetSender is the sender of the transfer.  If this is not
	// a zero value, the real transaction sender must be the Clawback
	// address from the AssetParams.  If this is the zero value,
	// the asset is sent from the transaction's Sender.
	AssetSender basics.Address `codec:"asnd"`

	// AssetReceiver is the recipient of the transfer.
	AssetReceiver basics.Address `codec:"arcv"`

	// AssetCloseTo indicates that the asset should be removed
	// from the account's Assets map, and specifies where the remaining
	// asset holdings should be transferred.  It's always valid to transfer
	// remaining asset holdings to the creator account.
	AssetCloseTo basics.Address `codec:"aclose"`
	// contains filtered or unexported fields
}

AssetTransferTxnFields captures the fields used for asset transfers.

func (*AssetTransferTxnFields) CanMarshalMsg

func (_ *AssetTransferTxnFields) CanMarshalMsg(z interface{}) bool

func (*AssetTransferTxnFields) CanUnmarshalMsg

func (_ *AssetTransferTxnFields) CanUnmarshalMsg(z interface{}) bool

func (*AssetTransferTxnFields) MarshalMsg

func (z *AssetTransferTxnFields) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*AssetTransferTxnFields) MsgIsZero

func (z *AssetTransferTxnFields) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*AssetTransferTxnFields) Msgsize

func (z *AssetTransferTxnFields) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*AssetTransferTxnFields) UnmarshalMsg

func (z *AssetTransferTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*AssetTransferTxnFields) UnmarshalMsgWithState

func (z *AssetTransferTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type BoxRef

type BoxRef struct {
	Index uint64 `codec:"i"`
	Name  []byte `codec:"n,allocbound=config.MaxBytesKeyValueLen"`
	// contains filtered or unexported fields
}

BoxRef names a box by the slot

func (*BoxRef) CanMarshalMsg

func (_ *BoxRef) CanMarshalMsg(z interface{}) bool

func (*BoxRef) CanUnmarshalMsg

func (_ *BoxRef) CanUnmarshalMsg(z interface{}) bool

func (*BoxRef) MarshalMsg

func (z *BoxRef) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*BoxRef) MsgIsZero

func (z *BoxRef) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*BoxRef) Msgsize

func (z *BoxRef) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*BoxRef) UnmarshalMsg

func (z *BoxRef) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*BoxRef) UnmarshalMsgWithState

func (z *BoxRef) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type EvalDelta

type EvalDelta struct {
	GlobalDelta basics.StateDelta `codec:"gd"`

	// When decoding EvalDeltas, the integer key represents an offset into
	// [txn.Sender, txn.Accounts[0], txn.Accounts[1], ..., SharedAccts[0], SharedAccts[1], ...]
	LocalDeltas map[uint64]basics.StateDelta `codec:"ld,allocbound=config.MaxEvalDeltaAccounts"`

	// If a program modifies the local of an account that is not the Sender, or
	// in txn.Accounts, it must be recorded here, so that the key in LocalDeltas
	// can refer to it.
	SharedAccts []basics.Address `codec:"sa,allocbound=config.MaxEvalDeltaAccounts"`

	// The total allocbound calculation here accounts for the worse possible case of having config.MaxLogCalls individual log entries
	// with the legnth of all of them summing up to config.MaxEvalDeltaTotalLogSize which is the limit for the sum of individual log lengths
	Logs []string `` /* 131-byte string literal not displayed */

	InnerTxns []SignedTxnWithAD `codec:"itx,allocbound=config.MaxInnerTransactionsPerDelta"`
	// contains filtered or unexported fields
}

EvalDelta stores StateDeltas for an application's global key/value store, as well as StateDeltas for some number of accounts holding local state for that application

func (*EvalDelta) CanMarshalMsg

func (_ *EvalDelta) CanMarshalMsg(z interface{}) bool

func (*EvalDelta) CanUnmarshalMsg

func (_ *EvalDelta) CanUnmarshalMsg(z interface{}) bool

func (EvalDelta) Equal

func (ed EvalDelta) Equal(o EvalDelta) bool

Equal compares two EvalDeltas and returns whether or not they are equivalent. It does not care about nilness equality of LocalDeltas, because the msgpack codec will encode/decode an empty map as nil, and we want an empty generated EvalDelta to equal an empty one we decode off the wire.

func (*EvalDelta) MarshalMsg

func (z *EvalDelta) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*EvalDelta) MsgIsZero

func (z *EvalDelta) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*EvalDelta) Msgsize

func (z *EvalDelta) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EvalDelta) UnmarshalMsg

func (z *EvalDelta) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*EvalDelta) UnmarshalMsgWithState

func (z *EvalDelta) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ExplicitTxnContext

type ExplicitTxnContext struct {
	ExplicitRound basics.Round
	Proto         config.ConsensusParams
	GenID         string
	GenHash       crypto.Digest
}

ExplicitTxnContext is a struct that implements TxnContext with explicit fields for everything.

func (ExplicitTxnContext) ConsensusProtocol

func (tc ExplicitTxnContext) ConsensusProtocol() config.ConsensusParams

ConsensusProtocol implements the TxnContext interface

func (ExplicitTxnContext) GenesisHash

func (tc ExplicitTxnContext) GenesisHash() crypto.Digest

GenesisHash implements the TxnContext interface

func (ExplicitTxnContext) GenesisID

func (tc ExplicitTxnContext) GenesisID() string

GenesisID implements the TxnContext interface

func (ExplicitTxnContext) Round

func (tc ExplicitTxnContext) Round() basics.Round

Round implements the TxnContext interface

type Header struct {
	Sender      basics.Address    `codec:"snd"`
	Fee         basics.MicroAlgos `codec:"fee"`
	FirstValid  basics.Round      `codec:"fv"`
	LastValid   basics.Round      `codec:"lv"`
	Note        []byte            `codec:"note,allocbound=config.MaxTxnNoteBytes"` // Uniqueness or app-level data about txn
	GenesisID   string            `codec:"gen,allocbound=config.MaxGenesisIDLen"`
	GenesisHash crypto.Digest     `codec:"gh"`

	// Group specifies that this transaction is part of a
	// transaction group (and, if so, specifies the hash
	// of a TxGroup).
	Group crypto.Digest `codec:"grp"`

	// Lease enforces mutual exclusion of transactions.  If this field is
	// nonzero, then once the transaction is confirmed, it acquires the
	// lease identified by the (Sender, Lease) pair of the transaction until
	// the LastValid round passes.  While this transaction possesses the
	// lease, no other transaction specifying this lease can be confirmed.
	Lease [32]byte `codec:"lx"`

	// RekeyTo, if nonzero, sets the sender's AuthAddr to the given address
	// If the RekeyTo address is the sender's actual address, the AuthAddr is set to zero
	// This allows "re-keying" a long-lived account -- rotating the signing key, changing
	// membership of a multisig account, etc.
	RekeyTo basics.Address `codec:"rekey"`
	// contains filtered or unexported fields
}

Header captures the fields common to every transaction type.

func (Header) Alive

func (tx Header) Alive(tc TxnContext) error

Alive checks to see if the transaction is still alive (can be applied) at the specified Round.

func (Header) Aux

func (tx Header) Aux() []byte

Aux returns the note associated with this transaction

func (*Header) CanMarshalMsg

func (_ *Header) CanMarshalMsg(z interface{}) bool

func (*Header) CanUnmarshalMsg

func (_ *Header) CanUnmarshalMsg(z interface{}) bool

func (Header) First

func (tx Header) First() basics.Round

First returns the first round this transaction is valid

func (Header) Last

func (tx Header) Last() basics.Round

Last returns the first round this transaction is valid

func (*Header) MarshalMsg

func (z *Header) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*Header) MsgIsZero

func (z *Header) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*Header) Msgsize

func (z *Header) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (Header) Src

func (tx Header) Src() basics.Address

Src returns the address that posted the transaction. This is the account that pays the associated Fee.

func (Header) TxFee

func (tx Header) TxFee() basics.MicroAlgos

TxFee returns the fee associated with this transaction.

func (*Header) UnmarshalMsg

func (z *Header) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*Header) UnmarshalMsgWithState

func (z *Header) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type KeyregTxnFields

type KeyregTxnFields struct {
	VotePK           crypto.OneTimeSignatureVerifier `codec:"votekey"`
	SelectionPK      crypto.VRFVerifier              `codec:"selkey"`
	StateProofPK     merklesignature.Commitment      `codec:"sprfkey"`
	VoteFirst        basics.Round                    `codec:"votefst"`
	VoteLast         basics.Round                    `codec:"votelst"`
	VoteKeyDilution  uint64                          `codec:"votekd"`
	Nonparticipation bool                            `codec:"nonpart"`
	// contains filtered or unexported fields
}

KeyregTxnFields captures the fields used for key registration transactions.

func (*KeyregTxnFields) CanMarshalMsg

func (_ *KeyregTxnFields) CanMarshalMsg(z interface{}) bool

func (*KeyregTxnFields) CanUnmarshalMsg

func (_ *KeyregTxnFields) CanUnmarshalMsg(z interface{}) bool

func (*KeyregTxnFields) MarshalMsg

func (z *KeyregTxnFields) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*KeyregTxnFields) MsgIsZero

func (z *KeyregTxnFields) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*KeyregTxnFields) Msgsize

func (z *KeyregTxnFields) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*KeyregTxnFields) UnmarshalMsg

func (z *KeyregTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*KeyregTxnFields) UnmarshalMsgWithState

func (z *KeyregTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type LogicSig

type LogicSig struct {

	// Logic signed by Sig or Msig, OR hashed to be the Address of an account.
	Logic []byte `codec:"l,allocbound=config.MaxLogicSigMaxSize"`

	Sig  crypto.Signature   `codec:"sig"`
	Msig crypto.MultisigSig `codec:"msig"`

	// Args are not signed, but checked by Logic
	Args [][]byte `codec:"arg,allocbound=EvalMaxArgs,allocbound=config.MaxLogicSigMaxSize"`
	// contains filtered or unexported fields
}

LogicSig contains logic for validating a transaction. LogicSig is signed by an account, allowing delegation of operations. OR LogicSig defines a contract account.

func (*LogicSig) Blank

func (lsig *LogicSig) Blank() bool

Blank returns true if there is no content in this LogicSig

func (*LogicSig) CanMarshalMsg

func (_ *LogicSig) CanMarshalMsg(z interface{}) bool

func (*LogicSig) CanUnmarshalMsg

func (_ *LogicSig) CanUnmarshalMsg(z interface{}) bool

func (*LogicSig) Equal

func (lsig *LogicSig) Equal(b *LogicSig) bool

Equal returns true if both LogicSig are equivalent.

Out of paranoia, Equal distinguishes zero-length byte slices from byte slice-typed nil values as they may have subtly different behaviors within the evaluation of a LogicSig, due to differences in msgpack encoding behavior.

func (*LogicSig) Len

func (lsig *LogicSig) Len() int

Len returns the length of Logic plus the length of the Args This is limited by config.ConsensusParams.LogicSigMaxSize

func (*LogicSig) MarshalMsg

func (z *LogicSig) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*LogicSig) MsgIsZero

func (z *LogicSig) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*LogicSig) Msgsize

func (z *LogicSig) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*LogicSig) UnmarshalMsg

func (z *LogicSig) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*LogicSig) UnmarshalMsgWithState

func (z *LogicSig) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type MinFeeError

type MinFeeError string

MinFeeError defines an error type which could be returned from the method WellFormed

func (*MinFeeError) Error

func (err *MinFeeError) Error() string

type OnCompletion

type OnCompletion uint64

OnCompletion is an enum representing some layer 1 side effect that an ApplicationCall transaction will have if it is included in a block.

const (
	// NoOpOC indicates that an application transaction will simply call its
	// ApprovalProgram
	NoOpOC OnCompletion = 0

	// OptInOC indicates that an application transaction will allocate some
	// LocalState for the application in the sender's account
	OptInOC OnCompletion = 1

	// CloseOutOC indicates that an application transaction will deallocate
	// some LocalState for the application from the user's account
	CloseOutOC OnCompletion = 2

	// ClearStateOC is similar to CloseOutOC, but may never fail. This
	// allows users to reclaim their minimum balance from an application
	// they no longer wish to opt in to. When an ApplicationCall
	// transaction's OnCompletion is ClearStateOC, the ClearStateProgram
	// executes instead of the ApprovalProgram
	ClearStateOC OnCompletion = 3

	// UpdateApplicationOC indicates that an application transaction will
	// update the ApprovalProgram and ClearStateProgram for the application
	UpdateApplicationOC OnCompletion = 4

	// DeleteApplicationOC indicates that an application transaction will
	// delete the AppParams for the application from the creator's balance
	// record
	DeleteApplicationOC OnCompletion = 5
)

func (OnCompletion) CanMarshalMsg

func (_ OnCompletion) CanMarshalMsg(z interface{}) bool

func (*OnCompletion) CanUnmarshalMsg

func (_ *OnCompletion) CanUnmarshalMsg(z interface{}) bool

func (OnCompletion) MarshalMsg

func (z OnCompletion) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (OnCompletion) MsgIsZero

func (z OnCompletion) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (OnCompletion) Msgsize

func (z OnCompletion) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (OnCompletion) String

func (i OnCompletion) String() string

func (*OnCompletion) UnmarshalMsg

func (z *OnCompletion) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*OnCompletion) UnmarshalMsgWithState

func (z *OnCompletion) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type PaymentTxnFields

type PaymentTxnFields struct {
	Receiver basics.Address    `codec:"rcv"`
	Amount   basics.MicroAlgos `codec:"amt"`

	// When CloseRemainderTo is set, it indicates that the
	// transaction is requesting that the account should be
	// closed, and all remaining funds be transferred to this
	// address.
	CloseRemainderTo basics.Address `codec:"close"`
	// contains filtered or unexported fields
}

PaymentTxnFields captures the fields used by payment transactions.

func (*PaymentTxnFields) CanMarshalMsg

func (_ *PaymentTxnFields) CanMarshalMsg(z interface{}) bool

func (*PaymentTxnFields) CanUnmarshalMsg

func (_ *PaymentTxnFields) CanUnmarshalMsg(z interface{}) bool

func (PaymentTxnFields) CheckSpender

func (payment PaymentTxnFields) CheckSpender(header Header, spec SpecialAddresses, proto config.ConsensusParams) error

CheckSpender performs some stateless checks on the Sender of a pay transaction

func (*PaymentTxnFields) MarshalMsg

func (z *PaymentTxnFields) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*PaymentTxnFields) MsgIsZero

func (z *PaymentTxnFields) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*PaymentTxnFields) Msgsize

func (z *PaymentTxnFields) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*PaymentTxnFields) UnmarshalMsg

func (z *PaymentTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*PaymentTxnFields) UnmarshalMsgWithState

func (z *PaymentTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Payset

type Payset []SignedTxnInBlock

A Payset represents a common, unforgeable, consistent, ordered set of SignedTxn objects.

func (Payset) CanMarshalMsg

func (_ Payset) CanMarshalMsg(z interface{}) bool

func (*Payset) CanUnmarshalMsg

func (_ *Payset) CanUnmarshalMsg(z interface{}) bool

func (Payset) CommitFlat

func (payset Payset) CommitFlat() crypto.Digest

CommitFlat returns a commitment to the Payset, as a flat array.

func (Payset) CommitGenesis

func (payset Payset) CommitGenesis() crypto.Digest

CommitGenesis is like Commit, but with special handling for zero-length but non-nil paysets.

func (Payset) MarshalMsg

func (z Payset) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (Payset) MsgIsZero

func (z Payset) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (Payset) Msgsize

func (z Payset) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (Payset) ToBeHashed

func (payset Payset) ToBeHashed() (protocol.HashID, []byte)

ToBeHashed implements the crypto.Hashable interface

func (*Payset) UnmarshalMsg

func (z *Payset) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*Payset) UnmarshalMsgWithState

func (z *Payset) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SignedTxn

type SignedTxn struct {
	Sig      crypto.Signature   `codec:"sig"`
	Msig     crypto.MultisigSig `codec:"msig"`
	Lsig     LogicSig           `codec:"lsig"`
	Txn      Transaction        `codec:"txn"`
	AuthAddr basics.Address     `codec:"sgnr"`
	// contains filtered or unexported fields
}

SignedTxn wraps a transaction and a signature. It exposes a Verify() method that verifies the signature and checks that the underlying transaction is well-formed. TODO: update this documentation now that there's multisig

func AssembleSignedTxn

func AssembleSignedTxn(txn Transaction, sig crypto.Signature, msig crypto.MultisigSig) (SignedTxn, error)

AssembleSignedTxn assembles a multisig-signed transaction from a transaction an optional sig, and an optional multisig. No signature checking is done -- for example, this might only be a partial multisig TODO: is this method used anywhere, or is it safe to remove?

func (SignedTxn) Authorizer

func (s SignedTxn) Authorizer() basics.Address

Authorizer returns the address against which the signature/msig/lsig should be checked, or so the SignedTxn claims. This is just s.AuthAddr or, if s.AuthAddr is zero, s.Txn.Sender. It's provided as a convenience method.

func (*SignedTxn) CanMarshalMsg

func (_ *SignedTxn) CanMarshalMsg(z interface{}) bool

func (*SignedTxn) CanUnmarshalMsg

func (_ *SignedTxn) CanUnmarshalMsg(z interface{}) bool

func (SignedTxn) GetEncodedLength

func (s SignedTxn) GetEncodedLength() int

GetEncodedLength returns the length in bytes of the encoded transaction

func (SignedTxn) ID

func (s SignedTxn) ID() Txid

ID returns the Txid (i.e., hash) of the underlying transaction.

func (*SignedTxn) MarshalMsg

func (z *SignedTxn) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*SignedTxn) MessUpSigForTesting

func (stxn *SignedTxn) MessUpSigForTesting()

MessUpSigForTesting will mess up the signature so that Verify() will fail on the signed transaction. Intended to be used in tests outside the transactions package (e.g., block validation tests) where we want to check whether we're verifying signatures.

func (*SignedTxn) MsgIsZero

func (z *SignedTxn) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*SignedTxn) Msgsize

func (z *SignedTxn) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SignedTxn) UnmarshalMsg

func (z *SignedTxn) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*SignedTxn) UnmarshalMsgWithState

func (z *SignedTxn) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SignedTxnInBlock

type SignedTxnInBlock struct {
	SignedTxnWithAD

	HasGenesisID   bool `codec:"hgi"`
	HasGenesisHash bool `codec:"hgh"`
	// contains filtered or unexported fields
}

SignedTxnInBlock is how a signed transaction is encoded in a block.

func (*SignedTxnInBlock) CanMarshalMsg

func (_ *SignedTxnInBlock) CanMarshalMsg(z interface{}) bool

func (*SignedTxnInBlock) CanUnmarshalMsg

func (_ *SignedTxnInBlock) CanUnmarshalMsg(z interface{}) bool

func (SignedTxnInBlock) GetEncodedLength

func (s SignedTxnInBlock) GetEncodedLength() int

GetEncodedLength returns the length in bytes of the encoded transaction

func (*SignedTxnInBlock) Hash

func (s *SignedTxnInBlock) Hash() crypto.Digest

Hash implements an optimized version of crypto.HashObj(s).

func (*SignedTxnInBlock) HashSHA256

func (s *SignedTxnInBlock) HashSHA256() crypto.Digest

HashSHA256 implements an optimized version of crypto.HashObj(s) using SHA256 instead of the default SHA512_256.

func (SignedTxnInBlock) ID

func (s SignedTxnInBlock) ID()

ID on SignedTxnInBlock should never be called, because the ID depends on the block from which this transaction will be decoded. By having a different return value from SignedTxn.ID(), we will catch errors at compile-time.

func (*SignedTxnInBlock) MarshalMsg

func (z *SignedTxnInBlock) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*SignedTxnInBlock) MsgIsZero

func (z *SignedTxnInBlock) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*SignedTxnInBlock) Msgsize

func (z *SignedTxnInBlock) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SignedTxnInBlock) ToBeHashed

func (s *SignedTxnInBlock) ToBeHashed() (protocol.HashID, []byte)

ToBeHashed implements the crypto.Hashable interface.

func (*SignedTxnInBlock) UnmarshalMsg

func (z *SignedTxnInBlock) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*SignedTxnInBlock) UnmarshalMsgWithState

func (z *SignedTxnInBlock) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SignedTxnWithAD

type SignedTxnWithAD struct {
	SignedTxn
	ApplyData
	// contains filtered or unexported fields
}

SignedTxnWithAD is a (decoded) SignedTxn with associated ApplyData

func WrapSignedTxnsWithAD

func WrapSignedTxnsWithAD(txgroup []SignedTxn) []SignedTxnWithAD

WrapSignedTxnsWithAD takes an array SignedTxn and returns the same as SignedTxnWithAD Each txn's ApplyData is the default empty state.

func (*SignedTxnWithAD) CanMarshalMsg

func (_ *SignedTxnWithAD) CanMarshalMsg(z interface{}) bool

func (*SignedTxnWithAD) CanUnmarshalMsg

func (_ *SignedTxnWithAD) CanUnmarshalMsg(z interface{}) bool

func (*SignedTxnWithAD) MarshalMsg

func (z *SignedTxnWithAD) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*SignedTxnWithAD) MsgIsZero

func (z *SignedTxnWithAD) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*SignedTxnWithAD) Msgsize

func (z *SignedTxnWithAD) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*SignedTxnWithAD) UnmarshalMsg

func (z *SignedTxnWithAD) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*SignedTxnWithAD) UnmarshalMsgWithState

func (z *SignedTxnWithAD) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type SortString

type SortString []string

SortString implements sorting by string keys for canonical encoding of maps in msgpack format.

func (SortString) Len

func (a SortString) Len() int

func (SortString) Less

func (a SortString) Less(i, j int) bool

func (SortString) Swap

func (a SortString) Swap(i, j int)

type SortUint64

type SortUint64 []uint64

SortUint64 implements sorting by uint64 keys for canonical encoding of maps in msgpack format.

func (SortUint64) Len

func (a SortUint64) Len() int

func (SortUint64) Less

func (a SortUint64) Less(i, j int) bool

func (SortUint64) Swap

func (a SortUint64) Swap(i, j int)

type SpecialAddresses

type SpecialAddresses struct {
	FeeSink     basics.Address
	RewardsPool basics.Address
}

SpecialAddresses holds addresses with nonstandard properties.

type StateProofTxnFields

type StateProofTxnFields struct {
	StateProofType protocol.StateProofType `codec:"sptype"`
	StateProof     stateproof.StateProof   `codec:"sp"`
	Message        stateproofmsg.Message   `codec:"spmsg"`
	// contains filtered or unexported fields
}

StateProofTxnFields captures the fields used for stateproof transactions.

func (*StateProofTxnFields) CanMarshalMsg

func (_ *StateProofTxnFields) CanMarshalMsg(z interface{}) bool

func (*StateProofTxnFields) CanUnmarshalMsg

func (_ *StateProofTxnFields) CanUnmarshalMsg(z interface{}) bool

func (StateProofTxnFields) Empty

func (sp StateProofTxnFields) Empty() bool

Empty returns whether the StateProofTxnFields are all zero, in the sense of being omitted in a msgpack encoding.

func (*StateProofTxnFields) MarshalMsg

func (z *StateProofTxnFields) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*StateProofTxnFields) MsgIsZero

func (z *StateProofTxnFields) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*StateProofTxnFields) Msgsize

func (z *StateProofTxnFields) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*StateProofTxnFields) UnmarshalMsg

func (z *StateProofTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*StateProofTxnFields) UnmarshalMsgWithState

func (z *StateProofTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Transaction

type Transaction struct {

	// Type of transaction
	Type protocol.TxType `codec:"type"`

	// Common fields for all types of transactions
	Header

	// Fields for different types of transactions
	KeyregTxnFields
	PaymentTxnFields
	AssetConfigTxnFields
	AssetTransferTxnFields
	AssetFreezeTxnFields
	ApplicationCallTxnFields
	StateProofTxnFields
	// contains filtered or unexported fields
}

Transaction describes a transaction that can appear in a block.

func (*Transaction) CanMarshalMsg

func (_ *Transaction) CanMarshalMsg(z interface{}) bool

func (*Transaction) CanUnmarshalMsg

func (_ *Transaction) CanUnmarshalMsg(z interface{}) bool

func (Transaction) EstimateEncodedSize

func (tx Transaction) EstimateEncodedSize() int

EstimateEncodedSize returns the estimated encoded size of the transaction including the signature. This function is to be used for calculating the fee Note that it may be an underestimate if the transaction is signed in an unusual way (e.g., with an authaddr or via multisig or logicsig)

func (Transaction) GetReceiverAddress

func (tx Transaction) GetReceiverAddress() basics.Address

GetReceiverAddress returns the address of the receiver. If the transaction has no receiver, it returns the empty address.

func (Transaction) ID

func (tx Transaction) ID() Txid

ID returns the Txid (i.e., hash) of the transaction.

func (Transaction) IDSha256

func (tx Transaction) IDSha256() crypto.Digest

IDSha256 returns the digest (i.e., hash) of the transaction. This is different from the canonical ID computed with Sum512_256 hashing function.

func (Transaction) InnerID

func (tx Transaction) InnerID(parent Txid, index int) Txid

InnerID returns something akin to Txid, but folds in the parent Txid and the index of the inner call.

func (*Transaction) MarshalMsg

func (z *Transaction) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (Transaction) MatchAddress

func (tx Transaction) MatchAddress(addr basics.Address, spec SpecialAddresses) bool

MatchAddress checks if the transaction touches a given address.

func (*Transaction) MsgIsZero

func (z *Transaction) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*Transaction) Msgsize

func (z *Transaction) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (Transaction) RelevantAddrs

func (tx Transaction) RelevantAddrs(spec SpecialAddresses) []basics.Address

RelevantAddrs returns the addresses whose balance records this transaction will need to access. The header's default is to return just the sender and the fee sink.

func (Transaction) Sign

func (tx Transaction) Sign(secrets *crypto.SignatureSecrets) SignedTxn

Sign signs a transaction using a given Account's secrets.

func (Transaction) ToBeHashed

func (tx Transaction) ToBeHashed() (protocol.HashID, []byte)

ToBeHashed implements the crypto.Hashable interface.

func (Transaction) TxAmount

func (tx Transaction) TxAmount() basics.MicroAlgos

TxAmount returns the amount paid to the recipient in this payment

func (*Transaction) UnmarshalMsg

func (z *Transaction) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*Transaction) UnmarshalMsgWithState

func (z *Transaction) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (Transaction) WellFormed

func (tx Transaction) WellFormed(spec SpecialAddresses, proto config.ConsensusParams) error

WellFormed checks that the transaction looks reasonable on its own (but not necessarily valid against the actual ledger). It does not check signatures.

type TxGroup

type TxGroup struct {

	// TxGroupHashes specifies a list of hashes of transactions that must appear
	// together, sequentially, in a block in order for the group to be
	// valid.  Each hash in the list is a hash of a transaction with
	// the `Group` field omitted.
	// These are all `Txid` which is equivalent to `crypto.Digest`
	TxGroupHashes []crypto.Digest `codec:"txlist,allocbound=config.MaxTxGroupSize"`
	// contains filtered or unexported fields
}

TxGroup describes a group of transactions that must appear together in a specific order in a block.

func (*TxGroup) CanMarshalMsg

func (_ *TxGroup) CanMarshalMsg(z interface{}) bool

func (*TxGroup) CanUnmarshalMsg

func (_ *TxGroup) CanUnmarshalMsg(z interface{}) bool

func (*TxGroup) MarshalMsg

func (z *TxGroup) MarshalMsg(b []byte) (o []byte)

MarshalMsg implements msgp.Marshaler

func (*TxGroup) MsgIsZero

func (z *TxGroup) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*TxGroup) Msgsize

func (z *TxGroup) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (TxGroup) ToBeHashed

func (tg TxGroup) ToBeHashed() (protocol.HashID, []byte)

ToBeHashed implements the crypto.Hashable interface.

func (*TxGroup) UnmarshalMsg

func (z *TxGroup) UnmarshalMsg(bts []byte) (o []byte, err error)

func (*TxGroup) UnmarshalMsgWithState

func (z *TxGroup) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Txid

type Txid crypto.Digest

Txid is a hash used to uniquely identify individual transactions

func (*Txid) CanMarshalMsg

func (_ *Txid) CanMarshalMsg(z interface{}) bool

func (*Txid) CanUnmarshalMsg

func (_ *Txid) CanUnmarshalMsg(z interface{}) bool

func (*Txid) MarshalMsg

func (z *Txid) MarshalMsg(b []byte) []byte

MarshalMsg implements msgp.Marshaler

func (*Txid) MsgIsZero

func (z *Txid) MsgIsZero() bool

MsgIsZero returns whether this is a zero value

func (*Txid) Msgsize

func (z *Txid) Msgsize() int

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (Txid) String

func (txid Txid) String() string

String converts txid to a pretty-printable string

func (*Txid) UnmarshalMsg

func (z *Txid) UnmarshalMsg(bts []byte) ([]byte, error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Txid) UnmarshalMsgWithState

func (z *Txid) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) ([]byte, error)

func (*Txid) UnmarshalText

func (txid *Txid) UnmarshalText(text []byte) error

UnmarshalText initializes the Address from an array of bytes.

type TxnContext

type TxnContext interface {
	Round() basics.Round
	ConsensusProtocol() config.ConsensusParams
	GenesisID() string
	GenesisHash() crypto.Digest
}

TxnContext describes the context in which a transaction can appear (pretty much, a block, but we don't have the definition of a block here, since that would be a circular dependency). This is used to decide if a transaction is alive or not.

type TxnDeadError

type TxnDeadError struct {
	Round      basics.Round
	FirstValid basics.Round
	LastValid  basics.Round
	Early      bool
}

TxnDeadError defines an error type which indicates a transaction is outside of the round validity window.

func (*TxnDeadError) Error

func (err *TxnDeadError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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