Documentation ¶
Index ¶
- Constants
- Variables
- func ApplicationCallTxnFieldsMaxSize() (s int)
- func ApplyDataMaxSize() (s int)
- func AssetConfigTxnFieldsMaxSize() (s int)
- func AssetFreezeTxnFieldsMaxSize() (s int)
- func AssetTransferTxnFieldsMaxSize() (s int)
- func BoxRefMaxSize() (s int)
- func CheckContractVersions(approval []byte, clear []byte, previous basics.AppParams, ...) error
- func EvalDeltaMaxSize() (s int)
- func HeaderMaxSize() (s int)
- func HeartbeatTxnFieldsMaxSize() (s int)
- func KeyregTxnFieldsMaxSize() (s int)
- func LogicSigMaxSize() (s int)
- func OnCompletionMaxSize() (s int)
- func PaymentTxnFieldsMaxSize() (s int)
- func PaysetMaxSize() (s int)
- func ProgramVersion(bytecode []byte) (version uint64, length int, err error)
- func SignedTxnInBlockMaxSize() (s int)
- func SignedTxnMaxSize() (s int)
- func SignedTxnWithADMaxSize() (s int)
- func StateProofTxnFieldsMaxSize() (s int)
- func TransactionMaxSize() (s int)
- func TxGroupMaxSize() (s int)
- func TxidMaxSize() int
- type ApplicationCallTxnFields
- func (ac *ApplicationCallTxnFields) AddressByIndex(accountIdx uint64, sender basics.Address) (basics.Address, error)
- func (_ *ApplicationCallTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *ApplicationCallTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (ac *ApplicationCallTxnFields) Empty() bool
- func (ac *ApplicationCallTxnFields) IndexByAddress(target basics.Address, sender basics.Address) (uint64, error)
- func (z *ApplicationCallTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *ApplicationCallTxnFields) MsgIsZero() bool
- func (z *ApplicationCallTxnFields) Msgsize() (s int)
- func (z *ApplicationCallTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *ApplicationCallTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type ApplyData
- func (_ *ApplyData) CanMarshalMsg(z interface{}) bool
- func (_ *ApplyData) CanUnmarshalMsg(z interface{}) bool
- func (ad ApplyData) Equal(o ApplyData) bool
- func (z *ApplyData) MarshalMsg(b []byte) (o []byte)
- func (z *ApplyData) MsgIsZero() bool
- func (z *ApplyData) Msgsize() (s int)
- func (z *ApplyData) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *ApplyData) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type AssetConfigTxnFields
- func (_ *AssetConfigTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *AssetConfigTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetConfigTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *AssetConfigTxnFields) MsgIsZero() bool
- func (z *AssetConfigTxnFields) Msgsize() (s int)
- func (z *AssetConfigTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *AssetConfigTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type AssetFreezeTxnFields
- func (_ *AssetFreezeTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *AssetFreezeTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetFreezeTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *AssetFreezeTxnFields) MsgIsZero() bool
- func (z *AssetFreezeTxnFields) Msgsize() (s int)
- func (z *AssetFreezeTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *AssetFreezeTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type AssetTransferTxnFields
- func (_ *AssetTransferTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *AssetTransferTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *AssetTransferTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *AssetTransferTxnFields) MsgIsZero() bool
- func (z *AssetTransferTxnFields) Msgsize() (s int)
- func (z *AssetTransferTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *AssetTransferTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type BoxRef
- func (_ *BoxRef) CanMarshalMsg(z interface{}) bool
- func (_ *BoxRef) CanUnmarshalMsg(z interface{}) bool
- func (z *BoxRef) MarshalMsg(b []byte) (o []byte)
- func (z *BoxRef) MsgIsZero() bool
- func (z *BoxRef) Msgsize() (s int)
- func (z *BoxRef) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *BoxRef) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type EvalDelta
- func (_ *EvalDelta) CanMarshalMsg(z interface{}) bool
- func (_ *EvalDelta) CanUnmarshalMsg(z interface{}) bool
- func (ed EvalDelta) Equal(o EvalDelta) bool
- func (z *EvalDelta) MarshalMsg(b []byte) (o []byte)
- func (z *EvalDelta) MsgIsZero() bool
- func (z *EvalDelta) Msgsize() (s int)
- func (z *EvalDelta) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *EvalDelta) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type ExplicitTxnContext
- type Header
- func (tx Header) Alive(tc TxnContext) error
- func (tx Header) Aux() []byte
- func (_ *Header) CanMarshalMsg(z interface{}) bool
- func (_ *Header) CanUnmarshalMsg(z interface{}) bool
- func (tx Header) First() basics.Round
- func (tx Header) Last() basics.Round
- func (z *Header) MarshalMsg(b []byte) (o []byte)
- func (z *Header) MsgIsZero() bool
- func (z *Header) Msgsize() (s int)
- func (tx Header) Src() basics.Address
- func (tx Header) TxFee() basics.MicroAlgos
- func (z *Header) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Header) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type HeartbeatTxnFields
- func (_ *HeartbeatTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *HeartbeatTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *HeartbeatTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *HeartbeatTxnFields) MsgIsZero() bool
- func (z *HeartbeatTxnFields) Msgsize() (s int)
- func (z *HeartbeatTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *HeartbeatTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type KeyregTxnFields
- func (_ *KeyregTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *KeyregTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *KeyregTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *KeyregTxnFields) MsgIsZero() bool
- func (z *KeyregTxnFields) Msgsize() (s int)
- func (z *KeyregTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *KeyregTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type LogicSig
- func (lsig *LogicSig) Blank() bool
- func (_ *LogicSig) CanMarshalMsg(z interface{}) bool
- func (_ *LogicSig) CanUnmarshalMsg(z interface{}) bool
- func (lsig *LogicSig) Equal(b *LogicSig) bool
- func (lsig *LogicSig) Len() int
- func (z *LogicSig) MarshalMsg(b []byte) (o []byte)
- func (z *LogicSig) MsgIsZero() bool
- func (z *LogicSig) Msgsize() (s int)
- func (z *LogicSig) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *LogicSig) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type MinFeeError
- type OnCompletion
- func (_ OnCompletion) CanMarshalMsg(z interface{}) bool
- func (_ *OnCompletion) CanUnmarshalMsg(z interface{}) bool
- func (z OnCompletion) MarshalMsg(b []byte) (o []byte)
- func (z OnCompletion) MsgIsZero() bool
- func (z OnCompletion) Msgsize() (s int)
- func (i OnCompletion) String() string
- func (z *OnCompletion) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *OnCompletion) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type PaymentTxnFields
- func (_ *PaymentTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *PaymentTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *PaymentTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *PaymentTxnFields) MsgIsZero() bool
- func (z *PaymentTxnFields) Msgsize() (s int)
- func (z *PaymentTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *PaymentTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type Payset
- func (_ Payset) CanMarshalMsg(z interface{}) bool
- func (_ *Payset) CanUnmarshalMsg(z interface{}) bool
- func (payset Payset) CommitFlat() crypto.Digest
- func (payset Payset) CommitGenesis() crypto.Digest
- func (z Payset) MarshalMsg(b []byte) (o []byte)
- func (z Payset) MsgIsZero() bool
- func (z Payset) Msgsize() (s int)
- func (payset Payset) ToBeHashed() (protocol.HashID, []byte)
- func (z *Payset) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Payset) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type SignedTxn
- func (s SignedTxn) Authorizer() basics.Address
- func (_ *SignedTxn) CanMarshalMsg(z interface{}) bool
- func (_ *SignedTxn) CanUnmarshalMsg(z interface{}) bool
- func (s SignedTxn) GetEncodedLength() int
- func (s SignedTxn) ID() Txid
- func (z *SignedTxn) MarshalMsg(b []byte) (o []byte)
- func (stxn *SignedTxn) MessUpSigForTesting()
- func (z *SignedTxn) MsgIsZero() bool
- func (z *SignedTxn) Msgsize() (s int)
- func (z *SignedTxn) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *SignedTxn) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type SignedTxnInBlock
- func (_ *SignedTxnInBlock) CanMarshalMsg(z interface{}) bool
- func (_ *SignedTxnInBlock) CanUnmarshalMsg(z interface{}) bool
- func (s SignedTxnInBlock) GetEncodedLength() int
- func (s *SignedTxnInBlock) Hash() crypto.Digest
- func (s *SignedTxnInBlock) HashSHA256() crypto.Digest
- func (s SignedTxnInBlock) ID()
- func (z *SignedTxnInBlock) MarshalMsg(b []byte) (o []byte)
- func (z *SignedTxnInBlock) MsgIsZero() bool
- func (z *SignedTxnInBlock) Msgsize() (s int)
- func (s *SignedTxnInBlock) ToBeHashed() (protocol.HashID, []byte)
- func (z *SignedTxnInBlock) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *SignedTxnInBlock) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type SignedTxnWithAD
- func (_ *SignedTxnWithAD) CanMarshalMsg(z interface{}) bool
- func (_ *SignedTxnWithAD) CanUnmarshalMsg(z interface{}) bool
- func (z *SignedTxnWithAD) MarshalMsg(b []byte) (o []byte)
- func (z *SignedTxnWithAD) MsgIsZero() bool
- func (z *SignedTxnWithAD) Msgsize() (s int)
- func (z *SignedTxnWithAD) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *SignedTxnWithAD) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type SortString
- type SortUint64
- type SpecialAddresses
- type StateProofTxnFields
- func (_ *StateProofTxnFields) CanMarshalMsg(z interface{}) bool
- func (_ *StateProofTxnFields) CanUnmarshalMsg(z interface{}) bool
- func (z *StateProofTxnFields) MarshalMsg(b []byte) (o []byte)
- func (z *StateProofTxnFields) MsgIsZero() bool
- func (z *StateProofTxnFields) Msgsize() (s int)
- func (z *StateProofTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *StateProofTxnFields) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type Transaction
- func (_ *Transaction) CanMarshalMsg(z interface{}) bool
- func (_ *Transaction) CanUnmarshalMsg(z interface{}) bool
- func (tx Transaction) EstimateEncodedSize() int
- func (tx Transaction) GetReceiverAddress() basics.Address
- func (tx Transaction) ID() Txid
- func (tx Transaction) IDSha256() crypto.Digest
- func (tx Transaction) InnerID(parent Txid, index int) Txid
- func (z *Transaction) MarshalMsg(b []byte) (o []byte)
- func (tx Transaction) MatchAddress(addr basics.Address, spec SpecialAddresses) bool
- func (z *Transaction) MsgIsZero() bool
- func (z *Transaction) Msgsize() (s int)
- func (tx Transaction) Sign(secrets *crypto.SignatureSecrets) SignedTxn
- func (tx Transaction) ToBeHashed() (protocol.HashID, []byte)
- func (tx Transaction) TxAmount() basics.MicroAlgos
- func (z *Transaction) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *Transaction) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- func (tx Transaction) WellFormed(spec SpecialAddresses, proto config.ConsensusParams) error
- type TxGroup
- func (_ *TxGroup) CanMarshalMsg(z interface{}) bool
- func (_ *TxGroup) CanUnmarshalMsg(z interface{}) bool
- func (z *TxGroup) MarshalMsg(b []byte) (o []byte)
- func (z *TxGroup) MsgIsZero() bool
- func (z *TxGroup) Msgsize() (s int)
- func (tg TxGroup) ToBeHashed() (protocol.HashID, []byte)
- func (z *TxGroup) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (z *TxGroup) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) (o []byte, err error)
- type Txid
- func (_ *Txid) CanMarshalMsg(z interface{}) bool
- func (_ *Txid) CanUnmarshalMsg(z interface{}) bool
- func (txid *Txid) FromString(text string) error
- func (z *Txid) MarshalMsg(b []byte) []byte
- func (z *Txid) MsgIsZero() bool
- func (z *Txid) Msgsize() int
- func (txid Txid) String() string
- func (z *Txid) UnmarshalMsg(bts []byte) ([]byte, error)
- func (z *Txid) UnmarshalMsgWithState(bts []byte, st msgp.UnmarshalState) ([]byte, error)
- type TxnContext
- type TxnDeadError
Constants ¶
const EvalMaxArgs = 255
EvalMaxArgs is the maximum number of arguments to an LSig
const MaxLogicSigArgSize = 4096
MaxLogicSigArgSize is the maximum size of an argument to an LSig We use 4096 to match the maximum size of a TEAL value (as defined in `const maxStringSize` in package logic)
Variables ¶
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 HeartbeatTxnFieldsMaxSize ¶
func HeartbeatTxnFieldsMaxSize() (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 ¶
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) CanUnmarshalMsg ¶
func (ApplyData) Equal ¶
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 ¶
MarshalMsg implements msgp.Marshaler
func (*ApplyData) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*ApplyData) UnmarshalMsgWithState ¶
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) CanUnmarshalMsg ¶
func (*BoxRef) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*BoxRef) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*BoxRef) UnmarshalMsgWithState ¶
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"` // 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) CanUnmarshalMsg ¶
func (EvalDelta) Equal ¶
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 ¶
MarshalMsg implements msgp.Marshaler
func (*EvalDelta) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*EvalDelta) UnmarshalMsgWithState ¶
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 ¶
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) CanMarshalMsg ¶
func (*Header) CanUnmarshalMsg ¶
func (*Header) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Header) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Header) Src ¶
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) UnmarshalMsgWithState ¶
UnmarshalMsg implements msgp.Unmarshaler
type HeartbeatTxnFields ¶
type HeartbeatTxnFields struct { // HbAddress is the account this txn is proving onlineness for. HbAddress basics.Address `codec:"a"` // HbProof is a signature using HeartbeatAddress's partkey, thereby showing it is online. HbProof crypto.HeartbeatProof `codec:"prf"` // HbSeed must be the block seed for the this transaction's firstValid // block. It is the message that must be signed with HbAddress's part key. HbSeed committee.Seed `codec:"sd"` // HbVoteID must match the HbAddress account's current VoteID. HbVoteID crypto.OneTimeSignatureVerifier `codec:"vid"` // HbKeyDilution must match HbAddress account's current KeyDilution. HbKeyDilution uint64 `codec:"kd"` // contains filtered or unexported fields }
HeartbeatTxnFields captures the fields used for an account to prove it is online (really, it proves that an entity with the account's part keys is able to submit transactions, so it should be able to propose/vote.)
func (*HeartbeatTxnFields) CanMarshalMsg ¶
func (_ *HeartbeatTxnFields) CanMarshalMsg(z interface{}) bool
func (*HeartbeatTxnFields) CanUnmarshalMsg ¶
func (_ *HeartbeatTxnFields) CanUnmarshalMsg(z interface{}) bool
func (*HeartbeatTxnFields) MarshalMsg ¶
func (z *HeartbeatTxnFields) MarshalMsg(b []byte) (o []byte)
MarshalMsg implements msgp.Marshaler
func (*HeartbeatTxnFields) MsgIsZero ¶
func (z *HeartbeatTxnFields) MsgIsZero() bool
MsgIsZero returns whether this is a zero value
func (*HeartbeatTxnFields) Msgsize ¶
func (z *HeartbeatTxnFields) Msgsize() (s int)
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*HeartbeatTxnFields) UnmarshalMsg ¶
func (z *HeartbeatTxnFields) UnmarshalMsg(bts []byte) (o []byte, err error)
func (*HeartbeatTxnFields) UnmarshalMsgWithState ¶
func (z *HeartbeatTxnFields) 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=MaxLogicSigArgSize,maxtotalbytes=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) CanMarshalMsg ¶
func (*LogicSig) CanUnmarshalMsg ¶
func (*LogicSig) Equal ¶
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 ¶
Len returns the length of Logic plus the length of the Args This is limited by config.ConsensusParams.LogicSigMaxSize
func (*LogicSig) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*LogicSig) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*LogicSig) UnmarshalMsgWithState ¶
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) 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) CanUnmarshalMsg ¶
func (Payset) CommitFlat ¶
CommitFlat returns a commitment to the Payset, as a flat array.
func (Payset) CommitGenesis ¶
CommitGenesis is like Commit, but with special handling for zero-length but non-nil paysets.
func (Payset) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (Payset) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (Payset) ToBeHashed ¶
ToBeHashed implements the crypto.Hashable interface
func (*Payset) UnmarshalMsgWithState ¶
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 ¶
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) CanUnmarshalMsg ¶
func (SignedTxn) GetEncodedLength ¶
GetEncodedLength returns the length in bytes of the encoded transaction
func (*SignedTxn) MarshalMsg ¶
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) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*SignedTxn) UnmarshalMsgWithState ¶
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 ¶
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 ¶
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) 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 // By making HeartbeatTxnFields a pointer we save a ton of space of the // Transaction object. Unlike other txn types, the fields will be // embedded under a named field in the transaction encoding. *HeartbeatTxnFields `codec:"hb"` // 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) 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) CanUnmarshalMsg ¶
func (*TxGroup) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*TxGroup) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (TxGroup) ToBeHashed ¶
ToBeHashed implements the crypto.Hashable interface.
func (*TxGroup) UnmarshalMsgWithState ¶
UnmarshalMsg implements msgp.Unmarshaler
type Txid ¶
Txid is a hash used to uniquely identify individual transactions
func (*Txid) CanMarshalMsg ¶
func (*Txid) CanUnmarshalMsg ¶
func (*Txid) FromString ¶
FromString initializes the Txid from a string
func (*Txid) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Txid) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Txid) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
func (*Txid) UnmarshalMsgWithState ¶
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