Documentation ¶
Index ¶
- func ApplicationCall(ac transactions.ApplicationCallTxnFields, header transactions.Header, ...) (err error)
- func AssetConfig(cc transactions.AssetConfigTxnFields, header transactions.Header, ...) error
- func AssetFreeze(cf transactions.AssetFreezeTxnFields, header transactions.Header, ...) error
- func AssetTransfer(ct transactions.AssetTransferTxnFields, header transactions.Header, ...) error
- func Keyreg(keyreg transactions.KeyregTxnFields, header transactions.Header, ...) error
- func Payment(payment transactions.PaymentTxnFields, header transactions.Header, ...) error
- type Balances
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplicationCall ¶
func ApplicationCall(ac transactions.ApplicationCallTxnFields, header transactions.Header, balances Balances, ad *transactions.ApplyData, evalParams *logic.EvalParams, txnCounter uint64) (err error)
ApplicationCall evaluates ApplicationCall transaction
func AssetConfig ¶
func AssetConfig(cc transactions.AssetConfigTxnFields, header transactions.Header, balances Balances, spec transactions.SpecialAddresses, ad *transactions.ApplyData, txnCounter uint64) error
AssetConfig applies an AssetConfig transaction using the Balances interface.
func AssetFreeze ¶
func AssetFreeze(cf transactions.AssetFreezeTxnFields, header transactions.Header, balances Balances, spec transactions.SpecialAddresses, ad *transactions.ApplyData) error
AssetFreeze applies an AssetFreeze transaction using the Balances interface.
func AssetTransfer ¶
func AssetTransfer(ct transactions.AssetTransferTxnFields, header transactions.Header, balances Balances, spec transactions.SpecialAddresses, ad *transactions.ApplyData) error
AssetTransfer applies an AssetTransfer transaction using the Balances interface.
func Keyreg ¶
func Keyreg(keyreg transactions.KeyregTxnFields, header transactions.Header, balances Balances, spec transactions.SpecialAddresses, ad *transactions.ApplyData, round basics.Round) error
Keyreg applies a KeyRegistration transaction using the Balances interface.
func Payment ¶
func Payment(payment transactions.PaymentTxnFields, header transactions.Header, balances Balances, spec transactions.SpecialAddresses, ad *transactions.ApplyData) error
Payment changes the balances according to this transaction. The ApplyData argument should reflect the changes made by apply(). It may already include changes made by the caller (i.e., Transaction.Apply), so apply() must update it rather than overwriting it. For example, Transaction.Apply() may have updated ad.SenderRewards, and this function should only add to ad.SenderRewards (if needed), but not overwrite it.
Types ¶
type Balances ¶
type Balances interface { // Get looks up the account data for an address, ignoring application state // If the account is known to be empty, then err should be nil and the returned balance record should have the given address and empty AccountData // withPendingRewards specifies whether pending rewards should be applied. // A non-nil error means the lookup is impossible (e.g., if the database doesn't have necessary state anymore) Get(addr basics.Address, withPendingRewards bool) (basics.AccountData, error) Put(basics.Address, basics.AccountData) error // PutWithCreatable is like Put, but should be used when creating or deleting an asset or application. PutWithCreatable(addr basics.Address, acct basics.AccountData, newCreatable *basics.CreatableLocator, deletedCreatable *basics.CreatableLocator) error // GetCreator gets the address of the account that created a given creatable GetCreator(cidx basics.CreatableIndex, ctype basics.CreatableType) (basics.Address, bool, error) // Allocate or Deallocate either global or address-local app storage. // // PutWithCreatable(...) and then {Allocate/Deallocate}(..., ..., global=true) // creates/destroys an application. // // Put(...) and then {Allocate/Deallocate}(..., ..., global=false) // opts into/closes out of an application. Allocate(addr basics.Address, aidx basics.AppIndex, global bool, space basics.StateSchema) error Deallocate(addr basics.Address, aidx basics.AppIndex, global bool) error // StatefulEval executes a TEAL program in stateful mode on the balances. // It returns whether the program passed and its error. It alo returns // an EvalDelta that contains the changes made by the program. StatefulEval(params logic.EvalParams, aidx basics.AppIndex, program []byte) (passed bool, evalDelta basics.EvalDelta, err error) // Move MicroAlgos from one account to another, doing all necessary overflow checking (convenience method) // TODO: Does this need to be part of the balances interface, or can it just be implemented here as a function that calls Put and Get? Move(src, dst basics.Address, amount basics.MicroAlgos, srcRewards *basics.MicroAlgos, dstRewards *basics.MicroAlgos) error // Balances correspond to a Round, which mean that they also correspond // to a ConsensusParams. This returns those parameters. ConsensusParams() config.ConsensusParams }
Balances allow to move MicroAlgos from one address to another and to update balance records, or to access and modify individual balance records After a call to Put (or Move), future calls to Get or Move will reflect the updated balance record(s)