test

package
v3.0.0-alpha.0...-52a94c4 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: GPL-3.0 Imports: 15 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateSlice

func UpdateSlice[T any](a T, target []T)

Types

type Account

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

func (*Account) Address

func (a *Account) Address() base.Address

func (*Account) Keys

func (a *Account) Keys() types.AccountKeys

func (*Account) Priv

func (a *Account) Priv() base.Privatekey

func (*Account) SetAddress

func (a *Account) SetAddress(adr base.Address)

func (*Account) SetKeys

func (a *Account) SetKeys(keys types.AccountKeys)

func (*Account) SetPriv

func (a *Account) SetPriv(priv base.Privatekey)

type BaseTestOperationProcessorNoItem

type BaseTestOperationProcessorNoItem[To any] struct {
	*TestProcessor
	Op To
}

func NewBaseTestOperationProcessorNoItem

func NewBaseTestOperationProcessorNoItem[To any](tp *TestProcessor) BaseTestOperationProcessorNoItem[To]

func (*BaseTestOperationProcessorNoItem[To]) IsValid

func (t *BaseTestOperationProcessorNoItem[To]) IsValid()

func (*BaseTestOperationProcessorNoItem[To]) LoadOperation

func (t *BaseTestOperationProcessorNoItem[To]) LoadOperation(fileName string) *BaseTestOperationProcessorNoItem[To]

func (*BaseTestOperationProcessorNoItem[To]) Print

func (*BaseTestOperationProcessorNoItem[To]) RunPreProcess

func (t *BaseTestOperationProcessorNoItem[To]) RunPreProcess()

func (*BaseTestOperationProcessorNoItem[To]) RunProcess

func (t *BaseTestOperationProcessorNoItem[To]) RunProcess()

func (*BaseTestOperationProcessorNoItem[To]) SetAccount

func (t *BaseTestOperationProcessorNoItem[To]) SetAccount(
	priv string, amount int64, cid types.CurrencyID, target []Account, inState bool) *BaseTestOperationProcessorNoItem[To]

func (*BaseTestOperationProcessorNoItem[To]) SetAmount

func (*BaseTestOperationProcessorNoItem[To]) SetContractAccount

func (t *BaseTestOperationProcessorNoItem[To]) SetContractAccount(
	owner base.Address, priv string, amount int64, cid types.CurrencyID, target []Account, inState bool,
) *BaseTestOperationProcessorNoItem[To]

func (*BaseTestOperationProcessorNoItem[To]) SetCurrency

func (t *BaseTestOperationProcessorNoItem[To]) SetCurrency(
	cid string, am int64, addr base.Address, target []types.CurrencyID, instate bool) *BaseTestOperationProcessorNoItem[To]

type BaseTestOperationProcessorWithItem

type BaseTestOperationProcessorWithItem[To any, Tim any] struct {
	*TestProcessor
	Op To
	// contains filtered or unexported fields
}

func NewBaseTestOperationProcessorWithItem

func NewBaseTestOperationProcessorWithItem[To any, Tim any](tp *TestProcessor) BaseTestOperationProcessorWithItem[To, Tim]

func (*BaseTestOperationProcessorWithItem[To, Tim]) IsValid

func (t *BaseTestOperationProcessorWithItem[To, Tim]) IsValid()

func (*BaseTestOperationProcessorWithItem[To, Tim]) Items

func (t *BaseTestOperationProcessorWithItem[To, Tim]) Items() []Tim

func (*BaseTestOperationProcessorWithItem[To, Tim]) LoadOperation

func (t *BaseTestOperationProcessorWithItem[To, Tim]) LoadOperation(fileName string) *BaseTestOperationProcessorWithItem[To, Tim]

func (*BaseTestOperationProcessorWithItem[To, Tim]) Print

func (*BaseTestOperationProcessorWithItem[To, Tim]) RunPreProcess

func (t *BaseTestOperationProcessorWithItem[To, Tim]) RunPreProcess()

func (*BaseTestOperationProcessorWithItem[To, Tim]) RunProcess

func (t *BaseTestOperationProcessorWithItem[To, Tim]) RunProcess()

func (*BaseTestOperationProcessorWithItem[To, Tim]) SetAccount

func (t *BaseTestOperationProcessorWithItem[To, Tim]) SetAccount(
	priv string, amount int64, cid types.CurrencyID, target []Account, inState bool) *BaseTestOperationProcessorWithItem[To, Tim]

func (*BaseTestOperationProcessorWithItem[To, Tim]) SetAmount

func (t *BaseTestOperationProcessorWithItem[To, Tim]) SetAmount(am int64, cid types.CurrencyID, target []types.Amount) *BaseTestOperationProcessorWithItem[To, Tim]

func (*BaseTestOperationProcessorWithItem[To, Tim]) SetContractAccount

func (t *BaseTestOperationProcessorWithItem[To, Tim]) SetContractAccount(
	owner base.Address, priv string, amount int64, cid types.CurrencyID, target []Account, inState bool,
) *BaseTestOperationProcessorWithItem[To, Tim]

func (*BaseTestOperationProcessorWithItem[To, Tim]) SetCurrency

func (t *BaseTestOperationProcessorWithItem[To, Tim]) SetCurrency(
	cid string, am int64, addr base.Address, target []types.CurrencyID, instate bool) *BaseTestOperationProcessorWithItem[To, Tim]

type MockStateGetter

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

func NewMockStateGetter

func NewMockStateGetter() *MockStateGetter

func (*MockStateGetter) Get

func (m *MockStateGetter) Get(key string) (base.State, bool, error)

func (*MockStateGetter) Set

func (m *MockStateGetter) Set(key string, st base.State)

type TestOperationProcessorWithItem

type TestOperationProcessorWithItem[Tim any] interface {
	Items() []Tim
	SetCurrency(string, int64, base.Address, []types.CurrencyID, bool) *TestOperationProcessorWithItem[Tim]
	SetAmount(int64, types.CurrencyID, []types.Amount) *TestOperationProcessorWithItem[Tim]
	SetContractAccount(base.Address, string, int64, types.CurrencyID, []Account, bool) *TestOperationProcessorWithItem[Tim]
	SetAccount(string, int64, types.CurrencyID, []Account, bool) *TestOperationProcessorWithItem[Tim]
	Print(string) *TestOperationProcessorWithItem[Tim]
	RunPreProcess()
	RunProcess()
	IsValid()
}

type TestProcessor

type TestProcessor struct {
	NetworkID       base.NetworkID
	GenesisPriv     base.Privatekey
	GenesisAddr     base.Address
	GenesisCurrency types.CurrencyID
	NodeAddr        base.Address
	NodePriv        base.Privatekey
	Opr             base.OperationProcessor
	GetStateFunc    func(string) (base.State, bool, error)
	MockGetter      *MockStateGetter
	Encoders        *encoder.Encoders
	// contains filtered or unexported fields
}

func (*TestProcessor) Decode

func (t *TestProcessor) Decode(fileName string)

func (*TestProcessor) Error

func (t *TestProcessor) Error() error

func (*TestProcessor) LoadOperation

func (t *TestProcessor) LoadOperation(fileName string) base.Operation

func (*TestProcessor) NewPrivateKey

func (t *TestProcessor) NewPrivateKey(seed string) string

func (*TestProcessor) NewTestAccount

func (*TestProcessor) NewTestAccountState

func (t *TestProcessor) NewTestAccountState(priv string, inState bool) (base.Address, types.AccountKeys, base.Privatekey)

NewTestAccountState returns address, keys, private key, account state

func (*TestProcessor) NewTestBalanceState

func (t *TestProcessor) NewTestBalanceState(addr base.Address, cid types.CurrencyID, am int64, inState bool)

func (*TestProcessor) NewTestContractAccountState

func (t *TestProcessor) NewTestContractAccountState(owner base.Address, priv string, inState bool) (base.Address, base.Privatekey)

func (*TestProcessor) NewTestCurrencyState

func (t *TestProcessor) NewTestCurrencyState(cid string, addr base.Address, inState bool) types.CurrencyID

NewTestCurrencyState returns currency id, currency state

func (*TestProcessor) NewTestSuffrageState

func (t *TestProcessor) NewTestSuffrageState(priv, node string, inState bool) (base.Address, base.Privatekey)

func (*TestProcessor) Print

func (t *TestProcessor) Print(fileName string, i interface{})

func (*TestProcessor) SetAccount

func (t *TestProcessor) SetAccount(priv string, amount int64, cid types.CurrencyID, target []Account, inState bool)

func (*TestProcessor) SetAmount

func (t *TestProcessor) SetAmount(am int64, cid types.CurrencyID, target []types.Amount)

func (*TestProcessor) SetContractAccount

func (t *TestProcessor) SetContractAccount(owner base.Address, priv string, amount int64, cid types.CurrencyID, target []Account, inState bool)

func (*TestProcessor) SetCurrency

func (t *TestProcessor) SetCurrency(cid string, am int64, receiverPriv string, target *types.CurrencyID, instate bool)

func (*TestProcessor) SetCurrency2

func (t *TestProcessor) SetCurrency2(
	cid string, am int64, addr base.Address, target []types.CurrencyID, instate bool)

func (*TestProcessor) SetState

func (t *TestProcessor) SetState(state base.State, inState bool)

func (*TestProcessor) Setup

func (t *TestProcessor) Setup(getter *MockStateGetter)

Jump to

Keyboard shortcuts

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