utilities

package
v0.10.6 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSenderNotMiner      = 2
	DefaultRecipientNotMiner   = 3
	FirstRecipientNotMiner     = 4
	DefaultAccountForLoanFunds = 9
	MaxAmount                  = math.MaxInt64
	MinIssueFeeWaves           = 100000000
	MinSetAssetScriptFeeWaves  = 100000000
	MinTxFeeWaves              = 100000
	MinTxFeeWavesSmartAsset    = 500000
	TestChainID                = 'L'
	CommonSymbolSet            = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789~!|#$%^&*()_+=\\\";:/?><|][{}"
	LettersAndDigits           = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
	DefaultInitialTimeout      = 5 * time.Millisecond
	DefaultWaitTimeout         = 15 * time.Second
)

Variables

This section is empty.

Functions

func Abs added in v0.10.3

func Abs(x int64) int64

Abs returns the absolute value of x.

func AddNewAccount added in v0.10.3

func AddNewAccount(suite *f.BaseSuite, chainID proto.Scheme) (int, config.AccountInfo)

AddNewAccount function creates and adds new AccountInfo to suite accounts list. Returns index of new account in the list and AccountInfo.

func AddressByAliasCheck added in v0.10.3

func AddressByAliasCheck(t *testing.T, expected, actualGo, actualScala []byte, args ...interface{})

func AssetDescriptionCheck added in v0.10.6

func AssetDescriptionCheck(t *testing.T, expected, actualGo, actualScala string, args ...interface{})

func AssetDiffBalanceCheck added in v0.10.5

func AssetDiffBalanceCheck(t *testing.T, expected, actualGo, actualScala int64, args ...interface{})

func AssetNameCheck added in v0.10.6

func AssetNameCheck(t *testing.T, expected, actualGo, actualScala string, args ...interface{})

func AssetScriptCheck added in v0.10.5

func AssetScriptCheck(t *testing.T, expected, actualGo, actualScala []byte, args ...interface{})

func AssetWithVersion added in v0.10.6

func AssetWithVersion(assetID crypto.Digest, v int) string

func ErrorMessageCheck

func ErrorMessageCheck(t *testing.T, expectedErrGo, expectedErrScala string, actualErrGo,
	actualErrScala error, args ...interface{})

func ExtractTxID added in v0.10.3

func ExtractTxID(t *testing.T, tx proto.Transaction, scheme proto.Scheme) crypto.Digest

func GetAccount

func GetAccount(suite *f.BaseSuite, i int) config.AccountInfo

func GetActualDiffBalanceInAssets added in v0.10.3

func GetActualDiffBalanceInAssets(suite *f.BaseSuite, address proto.WavesAddress, assetId crypto.Digest, initBalanceGo, initBalanceScala int64) (int64, int64)

func GetActualDiffBalanceInWaves added in v0.10.3

func GetActualDiffBalanceInWaves(suite *f.BaseSuite, address proto.WavesAddress, initBalanceGo, initBalanceScala int64) (int64, int64)

func GetAddressByAliasGo added in v0.10.3

func GetAddressByAliasGo(suite *f.BaseSuite, alias string) []byte

func GetAddressByAliasScala added in v0.10.3

func GetAddressByAliasScala(suite *f.BaseSuite, alias string) []byte

func GetAddressFromRecipient added in v0.10.4

func GetAddressFromRecipient(suite *f.BaseSuite, recipient proto.Recipient) proto.WavesAddress

func GetAddressWithNewSchema added in v0.10.4

func GetAddressWithNewSchema(suite *f.BaseSuite, chainId proto.Scheme, address proto.WavesAddress) proto.WavesAddress

func GetAddressesByAlias added in v0.10.3

func GetAddressesByAlias(suite *f.BaseSuite, alias string) ([]byte, []byte)

func GetAssetBalance

func GetAssetBalance(suite *f.BaseSuite, address proto.WavesAddress, assetId crypto.Digest) (int64, int64)

func GetAssetBalanceGo

func GetAssetBalanceGo(suite *f.BaseSuite, address proto.WavesAddress, assetId crypto.Digest) int64

func GetAssetBalanceScala

func GetAssetBalanceScala(suite *f.BaseSuite, address proto.WavesAddress, assetId crypto.Digest) int64

func GetAssetInfo added in v0.10.5

func GetAssetInfo(suite *f.BaseSuite, assetId crypto.Digest) *client.AssetsDetail

func GetAssetInfoGrpc added in v0.10.5

func GetAssetInfoGrpc(suite *f.BaseSuite, assetId crypto.Digest) (*g.AssetInfoResponse, *g.AssetInfoResponse)

func GetAssetInfoGrpcGo added in v0.10.5

func GetAssetInfoGrpcGo(suite *f.BaseSuite, assetId crypto.Digest) *g.AssetInfoResponse

func GetAssetInfoGrpcScala added in v0.10.5

func GetAssetInfoGrpcScala(suite *f.BaseSuite, assetId crypto.Digest) *g.AssetInfoResponse

func GetAvailableBalanceInWaves

func GetAvailableBalanceInWaves(suite *f.BaseSuite, address proto.WavesAddress) (int64, int64)

func GetAvailableBalanceInWavesGo

func GetAvailableBalanceInWavesGo(suite *f.BaseSuite, address proto.WavesAddress) int64

func GetAvailableBalanceInWavesScala

func GetAvailableBalanceInWavesScala(suite *f.BaseSuite, address proto.WavesAddress) int64

func GetCurrentTimestampInMs

func GetCurrentTimestampInMs() uint64

func GetHeight added in v0.10.6

func GetHeight(suite *f.BaseSuite) uint64

func GetHeightGo added in v0.10.6

func GetHeightGo(suite *f.BaseSuite) uint64

func GetHeightScala added in v0.10.6

func GetHeightScala(suite *f.BaseSuite) uint64

func GetScriptBytes added in v0.10.5

func GetScriptBytes(suite *f.BaseSuite, scriptStr string) []byte

func GetTestcaseNameWithVersion added in v0.10.4

func GetTestcaseNameWithVersion(name string, v byte) string

func GetTransactionJsonOrErrMsg added in v0.10.3

func GetTransactionJsonOrErrMsg(tx proto.Transaction) string

func GetTxIdsInBlockchain

func GetTxIdsInBlockchain(suite *f.BaseSuite, ids map[string]*crypto.Digest) map[string]string

func MarshalTxAndGetTxMsg added in v0.10.3

func MarshalTxAndGetTxMsg(t *testing.T, scheme proto.Scheme, tx proto.Transaction) proto.Message

func MustGetAccountByAddress added in v0.10.5

func MustGetAccountByAddress(suite *f.BaseSuite, address proto.WavesAddress) config.AccountInfo

func RandDigest added in v0.10.3

func RandDigest(t *testing.T, n int, symbolSet string) crypto.Digest

func RandStringBytes

func RandStringBytes(n int, symbolSet string) string

func ReadScript added in v0.10.5

func ReadScript(scriptDir, fileName string) ([]byte, error)

func SetFromToAccounts added in v0.10.4

func SetFromToAccounts(accountNumbers ...int) (int, int, error)

func StatusCodesCheck

func StatusCodesCheck(t *testing.T, goCode, scalaCode int, b ConsideredTransaction, args ...interface{})

func TxInfoCheck added in v0.10.4

func TxInfoCheck(t *testing.T, errGo, errScala error, args ...interface{})

func WaitForHeight added in v0.10.6

func WaitForHeight(suite *f.BaseSuite, height uint64) uint64

func WavesDiffBalanceCheck

func WavesDiffBalanceCheck(t *testing.T, expected, actualGo, actualScala int64, args ...interface{})

Types

type AccountDiffBalances added in v0.10.4

type AccountDiffBalances struct {
	DiffBalanceWaves BalanceInWaves
	DiffBalanceAsset BalanceInAsset
}

type AccountDiffBalancesSponsorshipSender added in v0.10.5

type AccountDiffBalancesSponsorshipSender struct {
	DiffBalanceWaves    BalanceInWaves
	DiffBalanceAsset    BalanceInAsset
	DiffBalanceFeeAsset BalanceInAsset
}

type AccountsDiffBalancesTxWithSponsorship added in v0.10.5

type AccountsDiffBalancesTxWithSponsorship struct {
	DiffBalancesSender    AccountDiffBalancesSponsorshipSender
	DiffBalancesRecipient AccountDiffBalances
	DiffBalancesSponsor   AccountDiffBalances
}

func NewDiffBalancesTxWithSponsorship added in v0.10.5

func NewDiffBalancesTxWithSponsorship(diffBalanceWavesGoSender, diffBalanceWavesScalaSender, diffBalanceAssetGoSender,
	diffBalanceAssetScalaSender, diffBalanceFeeAssetGoSender, diffBalanceFeeAssetScalaSender, diffBalanceWavesGoRecipient,
	diffBalanceWavesScalaRecipient, diffBalanceAssetGoRecipient, diffBalanceAssetScalaRecipient, diffBalanceWavesGoSponsor,
	diffBalanceWavesScalaSponsor, diffBalanceAssetGoSponsor, diffBalanceAssetScalaSponsor int64) AccountsDiffBalancesTxWithSponsorship

type AvailableVersions added in v0.10.5

type AvailableVersions struct {
	Binary   []byte
	Protobuf []byte
	Sum      []byte
}

func GetAvailableVersions added in v0.10.5

func GetAvailableVersions(t *testing.T, txType proto.TransactionType, minVersion, maxVersion byte) AvailableVersions

func NewAvailableVersions added in v0.10.5

func NewAvailableVersions(binary []byte, protobuf []byte) AvailableVersions

type BalanceInAsset added in v0.10.3

type BalanceInAsset struct {
	BalanceInAssetGo    int64
	BalanceInAssetScala int64
}

func NewBalanceInAsset added in v0.10.3

func NewBalanceInAsset(balanceGo, balanceScala int64) BalanceInAsset

type BalanceInWaves added in v0.10.3

type BalanceInWaves struct {
	BalanceInWavesGo    int64
	BalanceInWavesScala int64
}

func NewBalanceInWaves added in v0.10.3

func NewBalanceInWaves(balanceGo, balanceScala int64) BalanceInWaves

type BroadcastingError added in v0.10.3

type BroadcastingError struct {
	ErrorBrdCstGo    error
	ErrorBrdCstScala error
}

type ConsideredTransaction added in v0.10.3

type ConsideredTransaction struct {
	TxID      crypto.Digest
	WtErr     WaitingError
	Resp      Response
	BrdCstErr BroadcastingError
}

func BroadcastAndWaitTransaction

func BroadcastAndWaitTransaction(suite *f.BaseSuite, tx proto.Transaction, scheme proto.Scheme, waitForTx bool) ConsideredTransaction

func NewConsideredTransaction added in v0.10.3

func NewConsideredTransaction(txId crypto.Digest, respGo, respScala *client.Response,
	errWtGo, errWtScala, errBrdCstGo, errBrdCstScala error) ConsideredTransaction

func SendAndWaitTransaction

func SendAndWaitTransaction(suite *f.BaseSuite, tx proto.Transaction, scheme proto.Scheme, waitForTx bool) ConsideredTransaction

type Response added in v0.10.3

type Response struct {
	ResponseGo    *client.Response
	ResponseScala *client.Response
}

type WaitingError added in v0.10.3

type WaitingError struct {
	ErrWtGo    error
	ErrWtScala error
}

Jump to

Keyboard shortcuts

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