testutils

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractDispatchError

func ExtractDispatchError(
	meta types.Metadata,
	events []*parser.Event,
) error

ExtractDispatchError inspects parser.Events and returns a Go error describing exactly why System.ExtrinsicFailed fired. If no failure event is found, returns nil.

func SignAndSubmit

func SignAndSubmit(t *testing.T, cl *client.Client, ext *extrinsic.Extrinsic, signer signature.KeyringPair, nonce uint32) types.Hash

Types

type Key

type Key struct {
	Keypair signature.KeyringPair
	Address types.MultiAddress
	AccID   *types.AccountID
	AccInfo *storage.AccountInfo
}

type TestEnv

type TestEnv struct {
	Container              testcontainers.Container
	Client                 *client.Client
	Alice                  User
	Bob                    User
	Charlie                User
	InitialBalanceUint64   uint64
	InitialBalanceU64      types.U64
	InitialBalanceUCompact types.UCompact
	ZeroUint64             uint64
	ZeroU64                types.U64
	ZeroUCompact           types.UCompact
}

func Setup

func Setup() (*TestEnv, error)

func (*TestEnv) Teardown

func (env *TestEnv) Teardown()

type User

type User struct {
	Username string
	Coldkey  Key
	Hotkey   Key
}

Jump to

Keyboard shortcuts

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