sandbox

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountStatus

type AccountStatus struct {
	Account account.Account
	Updated bool
}

type MockSandbox

type MockSandbox struct {
	TestParams           param.Params
	TestStore            *store.MockStore
	TestCommittee        committee.Committee
	TestCommitteeSigners []crypto.Signer
	AcceptTestSortition  bool
}

MockSandbox is a testing mock for sandbox.

func MockingSandbox

func MockingSandbox() *MockSandbox

func (*MockSandbox) Account

func (m *MockSandbox) Account(addr crypto.Address) *account.Account

func (*MockSandbox) Committee

func (m *MockSandbox) Committee() committee.Reader

func (*MockSandbox) CurrentHeight

func (m *MockSandbox) CurrentHeight() uint32

func (*MockSandbox) FindBlockHashByStamp

func (m *MockSandbox) FindBlockHashByStamp(stamp hash.Stamp) (hash.Hash, bool)

func (*MockSandbox) FindBlockHeightByStamp

func (m *MockSandbox) FindBlockHeightByStamp(stamp hash.Stamp) (uint32, bool)

func (*MockSandbox) IterateAccounts

func (m *MockSandbox) IterateAccounts(consumer func(crypto.Address, *AccountStatus))

func (*MockSandbox) IterateValidators

func (m *MockSandbox) IterateValidators(consumer func(*ValidatorStatus))

func (*MockSandbox) MakeNewAccount

func (m *MockSandbox) MakeNewAccount(_ crypto.Address) *account.Account

func (*MockSandbox) MakeNewValidator

func (m *MockSandbox) MakeNewValidator(pub *bls.PublicKey) *validator.Validator

func (*MockSandbox) Params

func (m *MockSandbox) Params() param.Params

func (*MockSandbox) UpdateAccount

func (m *MockSandbox) UpdateAccount(addr crypto.Address, acc *account.Account)

func (*MockSandbox) UpdateValidator

func (m *MockSandbox) UpdateValidator(val *validator.Validator)

func (*MockSandbox) Validator

func (m *MockSandbox) Validator(addr crypto.Address) *validator.Validator

func (*MockSandbox) VerifyProof

type Sandbox

type Sandbox interface {
	Account(crypto.Address) *account.Account
	MakeNewAccount(crypto.Address) *account.Account
	UpdateAccount(crypto.Address, *account.Account)

	Validator(crypto.Address) *validator.Validator
	MakeNewValidator(*bls.PublicKey) *validator.Validator
	UpdateValidator(*validator.Validator)

	VerifyProof(hash.Stamp, sortition.Proof, *validator.Validator) bool
	Committee() committee.Reader
	FindBlockHashByStamp(stamp hash.Stamp) (hash.Hash, bool)
	FindBlockHeightByStamp(stamp hash.Stamp) (uint32, bool)

	Params() param.Params
	CurrentHeight() uint32

	IterateAccounts(consumer func(crypto.Address, *AccountStatus))
	IterateValidators(consumer func(*ValidatorStatus))
}

func NewSandbox

func NewSandbox(store store.Reader, params param.Params, committee committee.Reader) Sandbox

type ValidatorStatus

type ValidatorStatus struct {
	Validator validator.Validator
	Updated   bool
}

Jump to

Keyboard shortcuts

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