test

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PerunContractPath        = "../testdata/perun_soroban_contract.wasm"
	StellarAssetContractPath = "../testdata/perun_soroban_token.wasm"

	DefaultTestTimeout = 200
)

Variables

This section is empty.

Functions

func BuildGetTokenBalanceArgs

func BuildGetTokenBalanceArgs(balanceOf xdr.ScAddress) (xdr.ScVec, error)

func BuildInitTokenArgs

func BuildInitTokenArgs(adminAddr xdr.ScAddress, decimals uint32, tokenName string, tokenSymbol string) (xdr.ScVec, error)

func BuildTransferTokenArgs

func BuildTransferTokenArgs(from xdr.ScAddress, to xdr.ScAddress, amount xdr.Int128Parts) (xdr.ScVec, error)

func CreateFundStellarAccounts

func CreateFundStellarAccounts(pairs []*keypair.Full, initialBalance string) error

func Deploy

func Deploy(t *testing.T, kp *keypair.Full, contractPath string) (xdr.ScAddress, xdr.Hash)

func FundAll

func FundAll(ctx context.Context, funders []*channel.Funder, reqs []*pchannel.FundingReq) error

func GetTokenName

func GetTokenName(kp *keypair.Full, contractAddress xdr.ScAddress) error

func InitTokenContract

func InitTokenContract(kp *keypair.Full, contractIDAddress xdr.ScAddress) error

func MakeRandPerunAcc

func MakeRandPerunAcc() (*wallet.Account, *keypair.Full)

func MakeRandPerunAccs

func MakeRandPerunAccs(count int) ([]*wallet.Account, []*keypair.Full)

func MintToken

func MintToken(kp *keypair.Full, contractAddr xdr.ScAddress, amount uint64, recipientAddr xdr.ScAddress) error

func NewParamsWithAddressStateWithAsset

func NewParamsWithAddressStateWithAsset(t *testing.T, partsAddr []pwallet.Address, asset pchannel.Asset) (*pchannel.Params, *pchannel.State)

func NewRandomStellarAsset

func NewRandomStellarAsset() *types.StellarAsset

func NewStellarClients

func NewStellarClients(kps []*keypair.Full) []*env.StellarClient

Types

type Randomizer

type Randomizer struct{}

func (*Randomizer) NewRandomAsset

func (*Randomizer) NewRandomAsset(*rand.Rand) channel.Asset

type Setup

type Setup struct {
	Rng *mathrand.Rand
	// contains filtered or unexported fields
}

func NewTestSetup

func NewTestSetup(t *testing.T) *Setup

func (*Setup) GetAccounts

func (s *Setup) GetAccounts() []*wallet.Account

func (*Setup) GetAdjudicators

func (s *Setup) GetAdjudicators() []*channel.Adjudicator

func (*Setup) GetFunders

func (s *Setup) GetFunders() []*channel.Funder

func (*Setup) GetStellarClients

func (s *Setup) GetStellarClients() []*env.StellarClient

func (*Setup) GetTokenAsset

func (s *Setup) GetTokenAsset() pchannel.Asset

func (*Setup) NewCtx

func (s *Setup) NewCtx() context.Context

type TokenParams

type TokenParams struct {
	// contains filtered or unexported fields
}

func NewTokenParams

func NewTokenParams() *TokenParams

func (*TokenParams) GetDecimals

func (t *TokenParams) GetDecimals() uint32

func (*TokenParams) GetName

func (t *TokenParams) GetName() string

func (*TokenParams) GetSymbol

func (t *TokenParams) GetSymbol() string

Jump to

Keyboard shortcuts

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