test

package
v3.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BoxClearProgram string = `#pragma version 8
int 1
`

BoxClearProgram is a vanilla TEAL clear state program

Variables

View Source
var (
	// AccountA is a premade account for use in tests.
	AccountA = DecodeAddressOrPanic("GJR76Q6OXNZ2CYIVCFCDTJRBAAR6TYEJJENEII3G2U3JH546SPBQA62IFY")
	// AccountB is a premade account for use in tests.
	AccountB = DecodeAddressOrPanic("N5T74SANUWLHI6ZWYFQBEB6J2VXBTYUYZNWQB2V26DCF4ARKC7GDUW3IRU")
	// AccountC is a premade account for use in tests.
	AccountC = DecodeAddressOrPanic("OKUWMFFEKF4B4D7FRQYBVV3C2SNS54ZO4WZ2MJ3576UYKFDHM5P3AFMRWE")
	// AccountD is a premade account for use in tests.
	AccountD = DecodeAddressOrPanic("6TB2ZQA2GEEDH6XTIOH5A7FUSGINXDPW5ONN6XBOBBGGUXVHRQTITAIIVI")
	// AccountE is a premade account for use in tests.
	AccountE = DecodeAddressOrPanic("QYE3RIRIIUS4VRZ4WYR7E5R6WBHTQXUY7F62C7U77SSRAXUSFTSRQPXPPU")
	// FeeAddr is the fee addess to use when creating the state object.
	FeeAddr = DecodeAddressOrPanic("ZROKLZW4GVOK5WQIF2GUR6LHFVEZBMV56BIQEQD4OTIZL2BPSYYUKFBSHM")
	// RewardAddr is the fee addess to use when creating the state object.
	RewardAddr = DecodeAddressOrPanic("4C3S3A5II6AYMEADSW7EVL7JAKVU2ASJMMJAGVUROIJHYMS6B24NCXVEWM")

	// GenesisHash is a genesis hash used in tests.
	GenesisHash = MakeGenesis().Hash()
	// Signature is a signature for transactions used in tests.
	Signature = sdk.Signature{88}

	// Proto is a fake protocol version.
	Proto = protocol.ConsensusFuture

	// PaysetFlat is the payset HashID defined in go-algorand/protocol/hash.go
	PaysetFlat = "PF"
)
View Source
var BoxApprovalProgram string

BoxApprovalProgram is a TEAL program which allows for testing box functionality

View Source
var Info = info

Info is the the only logging level for this thing.

Functions

func AppAddress

func AppAddress(app sdk.AppIndex) sdk.Address

AppAddress generates Address for the given appID

func ArbitraryString

func ArbitraryString() []byte

ArbitraryString should be used to generate a pseudo-random string to put in the Note field of a Txn Header. This is necessary to ensure the hash of any two txns used in tests are never the same.

func DecodeAddressOrPanic

func DecodeAddressOrPanic(addr string) sdk.Address

DecodeAddressOrPanic is a helper to ensure addresses are initialized.

func ExitValue

func ExitValue() int

ExitValue returns the captured exit value.

func MakeAppCallWithInnerTxn

func MakeAppCallWithInnerTxn(appSender, paymentSender, paymentReceiver, assetSender, assetReceiver sdk.Address) sdk.SignedTxnWithAD

MakeAppCallWithInnerTxn is a MakeAppCallWithInnerTxn returning sdk.SignedTxnWithAD

func MakeAppDestroyTxn

func MakeAppDestroyTxn(appid uint64, sender sdk.Address) sdk.SignedTxnWithAD

MakeAppDestroyTxn makes a transaction that destroys an app.

func MakeAppOptInTxn

func MakeAppOptInTxn(appid uint64, sender sdk.Address) sdk.SignedTxnWithAD

MakeAppOptInTxn makes a transaction that opts in an app.

func MakeAssetConfigTxn

func MakeAssetConfigTxn(configid, total, decimals uint64, defaultFrozen bool, unitName, assetName, url string, addr sdk.Address) sdk.SignedTxnWithAD

MakeAssetConfigTxn is a helper to ensure test asset config are initialized.

func MakeAssetDestroyTxn

func MakeAssetDestroyTxn(assetID uint64, sender sdk.Address) sdk.SignedTxnWithAD

MakeAssetDestroyTxn makes a transaction that destroys an asset.

func MakeAssetOptInTxn

func MakeAssetOptInTxn(assetid uint64, address sdk.Address) sdk.SignedTxnWithAD

MakeAssetOptInTxn makes a transaction that opts in an asset.

func MakeAssetTransferTxn

func MakeAssetTransferTxn(assetid, amt uint64, sender, receiver, close sdk.Address) sdk.SignedTxnWithAD

MakeAssetTransferTxn creates an asset transfer transaction.

func MakeBlockForTxns

func MakeBlockForTxns(prevHeader sdk.BlockHeader, inputs ...*sdk.SignedTxnWithAD) (sdk.Block, error)

MakeBlockForTxns takes some transactions and constructs a block compatible with the indexer import function.

func MakeCreateAppTxn

func MakeCreateAppTxn(sender sdk.Address) sdk.SignedTxnWithAD

MakeCreateAppTxn makes a transaction that creates a simple application.

func MakeGenesis

func MakeGenesis() sdk.Genesis

MakeGenesis creates a sample sdk.Genesis info.

func MakeGenesisBlock

func MakeGenesisBlock() sdk.Block

MakeGenesisBlock makes a genesis block.

func MakePaymentTxn

func MakePaymentTxn(fee, amt, closeAmt, sendRewards, receiveRewards,
	closeRewards uint64, sender, receiver, close, rekeyTo sdk.Address) sdk.SignedTxnWithAD

MakePaymentTxn creates an algo transfer transaction.

func MakeSimpleAppCallTxn

func MakeSimpleAppCallTxn(appid uint64, sender sdk.Address) sdk.SignedTxnWithAD

MakeSimpleAppCallTxn is a MakeSimpleAppCallTxn return sdk.SignedTxnWithAD.

func PrintAccountQuery

func PrintAccountQuery(db idb.IndexerDb, q idb.AccountQueryOptions)

PrintAccountQuery prints information about an account query.

func PrintAssetQuery

func PrintAssetQuery(db idb.IndexerDb, q idb.AssetsQuery)

PrintAssetQuery prints information about an asset query.

func PrintTxnQuery

func PrintTxnQuery(db idb.IndexerDb, q idb.TransactionFilter)

PrintTxnQuery prints information about a transaction query.

func ReadValidatedBlockFromFile

func ReadValidatedBlockFromFile(filename string) (types.ValidatedBlock, error)

ReadValidatedBlockFromFile reads a validated block from file

func SetQuiet

func SetQuiet(q bool)

SetQuiet quiet mode of this logging thing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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