Documentation ¶
Index ¶
- type FakeChain
- func (chain *FakeChain) AddBlock(block *block.Block) error
- func (chain *FakeChain) AddHeaders(...*block.Header) error
- func (chain *FakeChain) BlockHeight() uint32
- func (chain *FakeChain) CalculateClaimable(util.Uint160, uint32) (*big.Int, error)
- func (chain *FakeChain) CurrentBlockHash() util.Uint256
- func (chain *FakeChain) FeePerByte() int64
- func (chain *FakeChain) ForEachNEP11Transfer(util.Uint160, uint64, func(*state.NEP11Transfer) (bool, error)) error
- func (chain *FakeChain) ForEachNEP17Transfer(util.Uint160, uint64, func(*state.NEP17Transfer) (bool, error)) error
- func (chain *FakeChain) GetAppExecResults(hash util.Uint256, trig trigger.Type) ([]state.AppExecResult, error)
- func (chain *FakeChain) GetBaseExecFee() int64
- func (chain *FakeChain) GetBlock(hash util.Uint256) (*block.Block, error)
- func (chain *FakeChain) GetCommittee() (keys.PublicKeys, error)
- func (chain *FakeChain) GetConfig() config.ProtocolConfiguration
- func (chain *FakeChain) GetContractScriptHash(id int32) (util.Uint160, error)
- func (chain *FakeChain) GetContractState(hash util.Uint160) *state.Contract
- func (chain *FakeChain) GetEnrollments() ([]state.Validator, error)
- func (chain *FakeChain) GetGoverningTokenBalance(acc util.Uint160) (*big.Int, uint32)
- func (chain *FakeChain) GetHeader(hash util.Uint256) (*block.Header, error)
- func (chain *FakeChain) GetHeaderHash(n int) util.Uint256
- func (chain *FakeChain) GetMaxVerificationGAS() int64
- func (chain *FakeChain) GetMemPool() *mempool.Pool
- func (chain *FakeChain) GetNEP11Contracts() []util.Uint160
- func (chain *FakeChain) GetNEP17Contracts() []util.Uint160
- func (chain *FakeChain) GetNativeContractScriptHash(name string) (util.Uint160, error)
- func (*FakeChain) GetNatives() []state.NativeContract
- func (chain *FakeChain) GetNextBlockValidators() ([]*keys.PublicKey, error)
- func (chain *FakeChain) GetNotaryBalance(acc util.Uint160) *big.Int
- func (chain *FakeChain) GetNotaryContractScriptHash() util.Uint160
- func (chain *FakeChain) GetNotaryDepositExpiration(acc util.Uint160) uint32
- func (chain *FakeChain) GetNotaryServiceFeePerKey() int64
- func (chain *FakeChain) GetStorageItem(id int32, key []byte) state.StorageItem
- func (chain *FakeChain) GetStoragePrice() int64
- func (chain *FakeChain) GetTestVM(t trigger.Type, tx *transaction.Transaction, b *block.Block) (*interop.Context, error)
- func (chain *FakeChain) GetTokenLastUpdated(acc util.Uint160) (map[int32]uint32, error)
- func (chain *FakeChain) GetTransaction(h util.Uint256) (*transaction.Transaction, uint32, error)
- func (chain *FakeChain) GetUtilityTokenBalance(uint160 util.Uint160) *big.Int
- func (chain *FakeChain) GetValidators() ([]*keys.PublicKey, error)
- func (chain *FakeChain) HasBlock(h util.Uint256) bool
- func (chain *FakeChain) HasTransaction(h util.Uint256) bool
- func (chain *FakeChain) HeaderHeight() uint32
- func (chain *FakeChain) InitVerificationContext(ic *interop.Context, hash util.Uint160, witness *transaction.Witness) error
- func (*FakeChain) IsExtensibleAllowed(uint160 util.Uint160) bool
- func (chain *FakeChain) P2PSigExtensionsEnabled() bool
- func (chain *FakeChain) PoolTx(tx *transaction.Transaction, _ ...*mempool.Pool) error
- func (chain *FakeChain) PoolTxWithData(t *transaction.Transaction, data interface{}, mp *mempool.Pool, ...) error
- func (chain *FakeChain) PutBlock(b *block.Block)
- func (chain *FakeChain) PutHeader(b *block.Block)
- func (chain *FakeChain) PutTx(tx *transaction.Transaction)
- func (chain *FakeChain) RegisterPostBlock(...)
- func (chain *FakeChain) SubscribeForBlocks(ch chan *block.Block)
- func (chain *FakeChain) SubscribeForExecutions(ch chan *state.AppExecResult)
- func (chain *FakeChain) SubscribeForNotifications(ch chan *state.ContainedNotificationEvent)
- func (chain *FakeChain) SubscribeForTransactions(ch chan *transaction.Transaction)
- func (chain *FakeChain) UnsubscribeFromBlocks(ch chan *block.Block)
- func (chain *FakeChain) UnsubscribeFromExecutions(ch chan *state.AppExecResult)
- func (chain *FakeChain) UnsubscribeFromNotifications(ch chan *state.ContainedNotificationEvent)
- func (chain *FakeChain) UnsubscribeFromTransactions(ch chan *transaction.Transaction)
- func (chain *FakeChain) VerifyTx(*transaction.Transaction) error
- func (chain *FakeChain) VerifyWitness(util.Uint160, hash.Hashable, *transaction.Witness, int64) (int64, error)
- type FakeStateSync
- func (s *FakeStateSync) AddBlock(block *block.Block) error
- func (s *FakeStateSync) AddHeaders(...*block.Header) error
- func (s *FakeStateSync) AddMPTNodes(nodes [][]byte) error
- func (s *FakeStateSync) BlockHeight() uint32
- func (s *FakeStateSync) GetUnknownMPTNodesBatch(limit int) []util.Uint256
- func (s *FakeStateSync) Init(currChainHeight uint32) error
- func (s *FakeStateSync) IsActive() bool
- func (s *FakeStateSync) IsInitialized() bool
- func (s *FakeStateSync) NeedHeaders() bool
- func (s *FakeStateSync) NeedMPTNodes() bool
- func (s *FakeStateSync) Traverse(root util.Uint256, process func(node mpt.Node, nodeBytes []byte) bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeChain ¶
type FakeChain struct { config.ProtocolConfiguration *mempool.Pool Blockheight uint32 PoolTxF func(*transaction.Transaction) error VerifyWitnessF func() (int64, error) MaxVerificationGAS int64 NotaryContractScriptHash util.Uint160 NotaryDepositExpiration uint32 PostBlock []func(func(*transaction.Transaction, *mempool.Pool, bool) bool, *mempool.Pool, *block.Block) UtilityTokenBalance *big.Int // contains filtered or unexported fields }
FakeChain implements the Blockchainer interface, but does not provide real functionality.
func NewFakeChainWithCustomCfg ¶ added in v0.97.3
func NewFakeChainWithCustomCfg(protocolCfg func(c *config.ProtocolConfiguration)) *FakeChain
NewFakeChainWithCustomCfg returns a new FakeChain structure with the specified protocol configuration.
func (*FakeChain) AddHeaders ¶
AddHeaders implements the Blockchainer interface.
func (*FakeChain) BlockHeight ¶
BlockHeight implements the Feer interface.
func (*FakeChain) CalculateClaimable ¶
CalculateClaimable implements the Blockchainer interface.
func (*FakeChain) CurrentBlockHash ¶
CurrentBlockHash implements the Blockchainer interface.
func (*FakeChain) FeePerByte ¶
FeePerByte implements Feer interface.
func (*FakeChain) ForEachNEP11Transfer ¶ added in v0.98.0
func (chain *FakeChain) ForEachNEP11Transfer(util.Uint160, uint64, func(*state.NEP11Transfer) (bool, error)) error
ForEachNEP17Transfer implements the Blockchainer interface.
func (*FakeChain) ForEachNEP17Transfer ¶
func (chain *FakeChain) ForEachNEP17Transfer(util.Uint160, uint64, func(*state.NEP17Transfer) (bool, error)) error
ForEachNEP17Transfer implements the Blockchainer interface.
func (*FakeChain) GetAppExecResults ¶
func (chain *FakeChain) GetAppExecResults(hash util.Uint256, trig trigger.Type) ([]state.AppExecResult, error)
GetAppExecResults implements the Blockchainer interface.
func (*FakeChain) GetBaseExecFee ¶
GetBaseExecFee implements the Policer interface.
func (*FakeChain) GetCommittee ¶
func (chain *FakeChain) GetCommittee() (keys.PublicKeys, error)
GetCommittee implements the Blockchainer interface.
func (*FakeChain) GetConfig ¶
func (chain *FakeChain) GetConfig() config.ProtocolConfiguration
GetConfig implements the Blockchainer interface.
func (*FakeChain) GetContractScriptHash ¶
GetContractScriptHash implements the Blockchainer interface.
func (*FakeChain) GetContractState ¶
GetContractState implements the Blockchainer interface.
func (*FakeChain) GetEnrollments ¶
GetEnrollments implements the Blockchainer interface.
func (*FakeChain) GetGoverningTokenBalance ¶
GetGoverningTokenBalance implements the Blockchainer interface.
func (*FakeChain) GetHeaderHash ¶
GetHeaderHash implements the Blockchainer interface.
func (*FakeChain) GetMaxVerificationGAS ¶
GetMaxVerificationGAS implements the Policer interface.
func (*FakeChain) GetMemPool ¶
GetMemPool implements the Blockchainer interface.
func (*FakeChain) GetNEP11Contracts ¶ added in v0.98.0
GetNEP17Contracts implements the Blockchainer interface.
func (*FakeChain) GetNEP17Contracts ¶ added in v0.97.1
GetNEP17Contracts implements the Blockchainer interface.
func (*FakeChain) GetNativeContractScriptHash ¶
GetNativeContractScriptHash implements the Blockchainer interface.
func (*FakeChain) GetNatives ¶
func (*FakeChain) GetNatives() []state.NativeContract
GetNatives implements the blockchainer.Blockchainer interface.
func (*FakeChain) GetNextBlockValidators ¶
GetNextBlockValidators implements the Blockchainer interface.
func (*FakeChain) GetNotaryBalance ¶
GetNotaryBalance implements the Blockchainer interface.
func (*FakeChain) GetNotaryContractScriptHash ¶
GetNotaryContractScriptHash implements the Blockchainer interface.
func (*FakeChain) GetNotaryDepositExpiration ¶
GetNotaryDepositExpiration implements the Blockchainer interface.
func (*FakeChain) GetNotaryServiceFeePerKey ¶ added in v0.98.2
GetNotaryServiceFeePerKey implements the Blockchainer interface.
func (*FakeChain) GetStorageItem ¶
func (chain *FakeChain) GetStorageItem(id int32, key []byte) state.StorageItem
GetStorageItem implements the Blockchainer interface.
func (*FakeChain) GetStoragePrice ¶
GetStoragePrice implements the Policer interface.
func (*FakeChain) GetTestVM ¶
func (chain *FakeChain) GetTestVM(t trigger.Type, tx *transaction.Transaction, b *block.Block) (*interop.Context, error)
GetTestVM implements the Blockchainer interface.
func (*FakeChain) GetTokenLastUpdated ¶ added in v0.98.0
GetNEP17LastUpdated implements the Blockchainer interface.
func (*FakeChain) GetTransaction ¶
func (chain *FakeChain) GetTransaction(h util.Uint256) (*transaction.Transaction, uint32, error)
GetTransaction implements the Blockchainer interface.
func (*FakeChain) GetUtilityTokenBalance ¶
GetUtilityTokenBalance implements Feer interface.
func (*FakeChain) GetValidators ¶
GetValidators implements the Blockchainer interface.
func (*FakeChain) HasTransaction ¶
HasTransaction implements the Blockchainer interface.
func (*FakeChain) HeaderHeight ¶
HeaderHeight implements the Blockchainer interface.
func (*FakeChain) InitVerificationContext ¶ added in v0.98.1
func (chain *FakeChain) InitVerificationContext(ic *interop.Context, hash util.Uint160, witness *transaction.Witness) error
InitVerificationContext initializes context for witness check.
func (*FakeChain) IsExtensibleAllowed ¶
IsExtensibleAllowed implements the Blockchainer interface.
func (*FakeChain) P2PSigExtensionsEnabled ¶
P2PSigExtensionsEnabled implements Feer interface.
func (*FakeChain) PoolTx ¶
func (chain *FakeChain) PoolTx(tx *transaction.Transaction, _ ...*mempool.Pool) error
PoolTx implements the Blockchainer interface.
func (*FakeChain) PoolTxWithData ¶
func (chain *FakeChain) PoolTxWithData(t *transaction.Transaction, data interface{}, mp *mempool.Pool, feer mempool.Feer, verificationFunction func(t *transaction.Transaction, data interface{}) error) error
PoolTxWithData implements the Blockchainer interface.
func (*FakeChain) PutTx ¶
func (chain *FakeChain) PutTx(tx *transaction.Transaction)
PutTx implements the Blockchainer interface.
func (*FakeChain) RegisterPostBlock ¶
func (chain *FakeChain) RegisterPostBlock(f func(func(*transaction.Transaction, *mempool.Pool, bool) bool, *mempool.Pool, *block.Block))
RegisterPostBlock implements the Blockchainer interface.
func (*FakeChain) SubscribeForBlocks ¶
SubscribeForBlocks implements the Blockchainer interface.
func (*FakeChain) SubscribeForExecutions ¶
func (chain *FakeChain) SubscribeForExecutions(ch chan *state.AppExecResult)
SubscribeForExecutions implements the Blockchainer interface.
func (*FakeChain) SubscribeForNotifications ¶
func (chain *FakeChain) SubscribeForNotifications(ch chan *state.ContainedNotificationEvent)
SubscribeForNotifications implements the Blockchainer interface.
func (*FakeChain) SubscribeForTransactions ¶
func (chain *FakeChain) SubscribeForTransactions(ch chan *transaction.Transaction)
SubscribeForTransactions implements the Blockchainer interface.
func (*FakeChain) UnsubscribeFromBlocks ¶
UnsubscribeFromBlocks implements the Blockchainer interface.
func (*FakeChain) UnsubscribeFromExecutions ¶
func (chain *FakeChain) UnsubscribeFromExecutions(ch chan *state.AppExecResult)
UnsubscribeFromExecutions implements the Blockchainer interface.
func (*FakeChain) UnsubscribeFromNotifications ¶
func (chain *FakeChain) UnsubscribeFromNotifications(ch chan *state.ContainedNotificationEvent)
UnsubscribeFromNotifications implements the Blockchainer interface.
func (*FakeChain) UnsubscribeFromTransactions ¶
func (chain *FakeChain) UnsubscribeFromTransactions(ch chan *transaction.Transaction)
UnsubscribeFromTransactions implements the Blockchainer interface.
func (*FakeChain) VerifyTx ¶
func (chain *FakeChain) VerifyTx(*transaction.Transaction) error
VerifyTx implements the Blockchainer interface.
type FakeStateSync ¶ added in v0.97.3
type FakeStateSync struct { IsActiveFlag uatomic.Bool IsInitializedFlag uatomic.Bool RequestHeaders uatomic.Bool InitFunc func(h uint32) error TraverseFunc func(root util.Uint256, process func(node mpt.Node, nodeBytes []byte) bool) error AddMPTNodesFunc func(nodes [][]byte) error }
FakeStateSync implements the StateSync interface.
func (*FakeStateSync) AddBlock ¶ added in v0.97.3
func (s *FakeStateSync) AddBlock(block *block.Block) error
AddBlock implements the StateSync interface.
func (*FakeStateSync) AddHeaders ¶ added in v0.97.3
func (s *FakeStateSync) AddHeaders(...*block.Header) error
AddHeaders implements the StateSync interface.
func (*FakeStateSync) AddMPTNodes ¶ added in v0.97.3
func (s *FakeStateSync) AddMPTNodes(nodes [][]byte) error
AddMPTNodes implements the StateSync interface.
func (*FakeStateSync) BlockHeight ¶ added in v0.97.3
func (s *FakeStateSync) BlockHeight() uint32
BlockHeight implements the StateSync interface.
func (*FakeStateSync) GetUnknownMPTNodesBatch ¶ added in v0.97.3
func (s *FakeStateSync) GetUnknownMPTNodesBatch(limit int) []util.Uint256
GetUnknownMPTNodesBatch implements the StateSync interface.
func (*FakeStateSync) Init ¶ added in v0.97.3
func (s *FakeStateSync) Init(currChainHeight uint32) error
Init implements the StateSync interface.
func (*FakeStateSync) IsActive ¶ added in v0.97.3
func (s *FakeStateSync) IsActive() bool
IsActive implements the StateSync interface.
func (*FakeStateSync) IsInitialized ¶ added in v0.97.3
func (s *FakeStateSync) IsInitialized() bool
IsInitialized implements the StateSync interface.
func (*FakeStateSync) NeedHeaders ¶ added in v0.97.3
func (s *FakeStateSync) NeedHeaders() bool
NeedHeaders implements the StateSync interface.
func (*FakeStateSync) NeedMPTNodes ¶ added in v0.97.3
func (s *FakeStateSync) NeedMPTNodes() bool
NeedMPTNodes implements the StateSync interface.