Documentation
¶
Index ¶
Constants ¶
const TmLsig = `` /* 9365-byte string literal not displayed */
TmLsig is a tinyman lsig contract used in tests/benchmarks
Variables ¶
This section is empty.
Functions ¶
func CreateTinyManSignedTxGroup ¶
func CreateTinyManSignedTxGroup(tb testing.TB, txns []Txn) ([]transactions.SignedTxn, []*crypto.SignatureSecrets)
CreateTinyManSignedTxGroup repro this tx group by tinyman https://algoexplorer.io/tx/group/d1bUcqFbNZDMIdcreM9Vw2jzOIZIa2UzDgTTlr2Sl4o%3D which is an algo to USDC swap. The source code below is extracted from algoexplorer, which adds some unusual stuff as comments
func GenerateProgramOfSize ¶
GenerateProgramOfSize return a TEAL bytecode of `size` bytes which always succeeds. `size` must be at least 9 bytes
func Group ¶
func Group(txns ...*Txn) []transactions.SignedTxn
Group turns a list of Txns into a slice of SignedTxns with GroupIDs set properly to make them a transaction group. The input Txns are modified with the calculated GroupID.
Types ¶
type Txn ¶
type Txn struct { Type protocol.TxType Sender basics.Address Fee interface{} // basics.MicroAlgos, uint64, int, or nil FirstValid basics.Round LastValid basics.Round Note []byte GenesisID string GenesisHash crypto.Digest Group crypto.Digest Lease [32]byte RekeyTo basics.Address VotePK crypto.OneTimeSignatureVerifier SelectionPK crypto.VRFVerifier VoteFirst basics.Round VoteLast basics.Round VoteKeyDilution uint64 Nonparticipation bool StateProofPK merklesignature.Commitment Receiver basics.Address Amount uint64 CloseRemainderTo basics.Address ConfigAsset basics.AssetIndex AssetParams basics.AssetParams XferAsset basics.AssetIndex AssetAmount uint64 AssetSender basics.Address AssetReceiver basics.Address AssetCloseTo basics.Address FreezeAccount basics.Address FreezeAsset basics.AssetIndex AssetFrozen bool ApplicationID basics.AppIndex OnCompletion transactions.OnCompletion ApplicationArgs [][]byte Accounts []basics.Address ForeignApps []basics.AppIndex ForeignAssets []basics.AssetIndex Boxes []transactions.BoxRef LocalStateSchema basics.StateSchema GlobalStateSchema basics.StateSchema ApprovalProgram interface{} // string, nil, or []bytes if already compiled ClearStateProgram interface{} // string, nil or []bytes if already compiled ExtraProgramPages uint32 StateProofType protocol.StateProofType StateProof stateproof.StateProof StateProofMsg stateproofmsg.Message HbAddress basics.Address HbProof crypto.HeartbeatProof HbSeed committee.Seed HbVoteID crypto.OneTimeSignatureVerifier HbKeyDilution uint64 }
Txn exists to simplify writing tests where transaction.Transaction might be unwieldy. Txn simplifies testing in these ways: * Provides a flat structure to simplify object construction. * Defines convenience methods to help setup test state.
func CreateTinyManTxGroup ¶
CreateTinyManTxGroup repro this tx group by tinyman https://algoexplorer.io/tx/group/d1bUcqFbNZDMIdcreM9Vw2jzOIZIa2UzDgTTlr2Sl4o%3D
func (*Txn) FillDefaults ¶
func (tx *Txn) FillDefaults(params config.ConsensusParams)
FillDefaults populates some obvious defaults from config params, unless they have already been set.
func (Txn) SignedTxn ¶
func (tx Txn) SignedTxn() transactions.SignedTxn
SignedTxn produces a unsigned, transactions.SignedTransaction from the fields in this Txn. This seemingly pointless operation exists, again, for convenience when driving tests.
func (Txn) SignedTxnWithAD ¶
func (tx Txn) SignedTxnWithAD() transactions.SignedTxnWithAD
SignedTxnWithAD produces unsigned, transactions.SignedTxnWithAD from the fields in this Txn. This seemingly pointless operation exists, again, for convenience when driving tests.
func (Txn) Txn ¶
func (tx Txn) Txn() transactions.Transaction
Txn produces a transactions.Transaction from the fields in this Txn