Documentation ¶
Index ¶
- type FakeChain
- func (chain *FakeChain) AddBlock(block *block.Block) error
- func (chain *FakeChain) AddHeaders(...*block.Header) error
- func (chain *FakeChain) ApplyPolicyToTxSet([]*transaction.Transaction) []*transaction.Transaction
- func (chain *FakeChain) BlockHeight() uint32
- func (chain *FakeChain) CalculateClaimable(util.Uint160, uint32) (*big.Int, error)
- func (chain *FakeChain) Close()
- func (chain *FakeChain) CurrentBlockHash() util.Uint256
- func (chain *FakeChain) CurrentHeaderHash() util.Uint256
- func (chain *FakeChain) FeePerByte() int64
- func (chain *FakeChain) ForEachNEP17Transfer(util.Uint160, 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) GetNEP17Balances(util.Uint160) *state.NEP17Balances
- 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) GetPolicer() blockchainer.Policer
- func (chain *FakeChain) GetStandByCommittee() keys.PublicKeys
- func (chain *FakeChain) GetStandByValidators() keys.PublicKeys
- func (chain *FakeChain) GetStateModule() blockchainer.StateRoot
- func (chain *FakeChain) GetStorageItem(id int32, key []byte) state.StorageItem
- func (chain *FakeChain) GetStorageItems(id int32) (map[string]state.StorageItem, error)
- func (chain *FakeChain) GetStoragePrice() int64
- func (chain *FakeChain) GetTestVM(t trigger.Type, tx *transaction.Transaction, b *block.Block) *vm.VM
- 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) InitVerificationVM(v *vm.VM, getContract func(util.Uint160) (*state.Contract, error), ...) error
- func (*FakeChain) IsExtensibleAllowed(uint160 util.Uint160) bool
- func (chain *FakeChain) IsTxStillRelevant(t *transaction.Transaction, txpool *mempool.Pool, isPartialTx bool) bool
- func (chain FakeChain) ManagementContractHash() util.Uint160
- 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(f func(blockchainer.Blockchainer, *mempool.Pool, *block.Block))
- func (chain *FakeChain) SetNotary(notary services.Notary)
- func (chain FakeChain) SetOracle(services.Oracle)
- func (chain *FakeChain) SubscribeForBlocks(ch chan<- *block.Block)
- func (chain *FakeChain) SubscribeForExecutions(ch chan<- *state.AppExecResult)
- func (chain *FakeChain) SubscribeForNotifications(ch chan<- *state.NotificationEvent)
- 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.NotificationEvent)
- 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) 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() error MaxVerificationGAS int64 NotaryContractScriptHash util.Uint160 NotaryDepositExpiration uint32 PostBlock []func(blockchainer.Blockchainer, *mempool.Pool, *block.Block) UtilityTokenBalance *big.Int // contains filtered or unexported fields }
FakeChain implements Blockchainer interface, but does not provide real functionality.
func (*FakeChain) AddHeaders ¶
AddHeaders implements Blockchainer interface.
func (*FakeChain) ApplyPolicyToTxSet ¶
func (chain *FakeChain) ApplyPolicyToTxSet([]*transaction.Transaction) []*transaction.Transaction
ApplyPolicyToTxSet implements Blockchainer interface.
func (*FakeChain) BlockHeight ¶
BlockHeight implements Feer interface.
func (*FakeChain) CalculateClaimable ¶
CalculateClaimable implements Blockchainer interface.
func (*FakeChain) CurrentBlockHash ¶
CurrentBlockHash implements Blockchainer interface.
func (*FakeChain) CurrentHeaderHash ¶
CurrentHeaderHash implements Blockchainer interface.
func (*FakeChain) FeePerByte ¶
FeePerByte implements Feer interface.
func (*FakeChain) ForEachNEP17Transfer ¶
func (chain *FakeChain) ForEachNEP17Transfer(util.Uint160, func(*state.NEP17Transfer) (bool, error)) error
ForEachNEP17Transfer implements Blockchainer interface.
func (*FakeChain) GetAppExecResults ¶
func (chain *FakeChain) GetAppExecResults(hash util.Uint256, trig trigger.Type) ([]state.AppExecResult, error)
GetAppExecResults implements Blockchainer interface.
func (*FakeChain) GetBaseExecFee ¶
GetBaseExecFee implements Policer interface.
func (*FakeChain) GetCommittee ¶
func (chain *FakeChain) GetCommittee() (keys.PublicKeys, error)
GetCommittee implements Blockchainer interface.
func (*FakeChain) GetConfig ¶
func (chain *FakeChain) GetConfig() config.ProtocolConfiguration
GetConfig implements Blockchainer interface.
func (*FakeChain) GetContractScriptHash ¶
GetContractScriptHash implements Blockchainer interface.
func (*FakeChain) GetContractState ¶
GetContractState implements Blockchainer interface.
func (*FakeChain) GetEnrollments ¶
GetEnrollments implements Blockchainer interface.
func (*FakeChain) GetGoverningTokenBalance ¶
GetGoverningTokenBalance implements Blockchainer interface.
func (*FakeChain) GetHeaderHash ¶
GetHeaderHash implements Blockchainer interface.
func (*FakeChain) GetMaxVerificationGAS ¶
GetMaxVerificationGAS implements Policer interface.
func (*FakeChain) GetMemPool ¶
GetMemPool implements Blockchainer interface.
func (*FakeChain) GetNEP17Balances ¶
func (chain *FakeChain) GetNEP17Balances(util.Uint160) *state.NEP17Balances
GetNEP17Balances implements Blockchainer interface.
func (*FakeChain) GetNativeContractScriptHash ¶
GetNativeContractScriptHash implements Blockchainer interface.
func (*FakeChain) GetNatives ¶
func (*FakeChain) GetNatives() []state.NativeContract
GetNatives implements blockchainer.Blockchainer interface.
func (*FakeChain) GetNextBlockValidators ¶
GetNextBlockValidators implements Blockchainer interface.
func (*FakeChain) GetNotaryBalance ¶
GetNotaryBalance implements Blockchainer interface.
func (*FakeChain) GetNotaryContractScriptHash ¶
GetNotaryContractScriptHash implements Blockchainer interface.
func (*FakeChain) GetNotaryDepositExpiration ¶
GetNotaryDepositExpiration implements Blockchainer interface.
func (*FakeChain) GetPolicer ¶
func (chain *FakeChain) GetPolicer() blockchainer.Policer
GetPolicer implements Blockchainer interface.
func (*FakeChain) GetStandByCommittee ¶
func (chain *FakeChain) GetStandByCommittee() keys.PublicKeys
GetStandByCommittee implements Blockchainer interface.
func (*FakeChain) GetStandByValidators ¶
func (chain *FakeChain) GetStandByValidators() keys.PublicKeys
GetStandByValidators implements Blockchainer interface.
func (*FakeChain) GetStateModule ¶ added in v0.94.0
func (chain *FakeChain) GetStateModule() blockchainer.StateRoot
GetStateModule implements Blockchainer interface.
func (*FakeChain) GetStorageItem ¶
func (chain *FakeChain) GetStorageItem(id int32, key []byte) state.StorageItem
GetStorageItem implements Blockchainer interface.
func (*FakeChain) GetStorageItems ¶
GetStorageItems implements Blockchainer interface.
func (*FakeChain) GetStoragePrice ¶
GetStoragePrice implements Policer interface.
func (*FakeChain) GetTestVM ¶
func (chain *FakeChain) GetTestVM(t trigger.Type, tx *transaction.Transaction, b *block.Block) *vm.VM
GetTestVM implements Blockchainer interface.
func (*FakeChain) GetTransaction ¶
func (chain *FakeChain) GetTransaction(h util.Uint256) (*transaction.Transaction, uint32, error)
GetTransaction implements Blockchainer interface.
func (*FakeChain) GetUtilityTokenBalance ¶
GetUtilityTokenBalance implements Feer interface.
func (*FakeChain) GetValidators ¶
GetValidators implements Blockchainer interface.
func (*FakeChain) HasTransaction ¶
HasTransaction implements Blockchainer interface.
func (*FakeChain) HeaderHeight ¶
HeaderHeight implements Blockchainer interface.
func (*FakeChain) InitVerificationVM ¶ added in v0.94.0
func (chain *FakeChain) InitVerificationVM(v *vm.VM, getContract func(util.Uint160) (*state.Contract, error), hash util.Uint160, witness *transaction.Witness) error
InitVerificationVM initializes VM for witness check.
func (*FakeChain) IsExtensibleAllowed ¶
IsExtensibleAllowed implements Blockchainer interface.
func (*FakeChain) IsTxStillRelevant ¶
func (chain *FakeChain) IsTxStillRelevant(t *transaction.Transaction, txpool *mempool.Pool, isPartialTx bool) bool
IsTxStillRelevant implements Blockchainer interface.
func (FakeChain) ManagementContractHash ¶
ManagementContractHash implements Blockchainer interface.
func (*FakeChain) P2PSigExtensionsEnabled ¶
P2PSigExtensionsEnabled implements Feer interface.
func (*FakeChain) PoolTx ¶
func (chain *FakeChain) PoolTx(tx *transaction.Transaction, _ ...*mempool.Pool) error
PoolTx implements Blockchainer interface.
func (*FakeChain) PoolTxWithData ¶
func (chain *FakeChain) PoolTxWithData(t *transaction.Transaction, data interface{}, mp *mempool.Pool, feer mempool.Feer, verificationFunction func(bc blockchainer.Blockchainer, t *transaction.Transaction, data interface{}) error) error
PoolTxWithData implements Blockchainer interface.
func (*FakeChain) PutTx ¶
func (chain *FakeChain) PutTx(tx *transaction.Transaction)
PutTx implements Blockchainer interface.
func (*FakeChain) RegisterPostBlock ¶
func (chain *FakeChain) RegisterPostBlock(f func(blockchainer.Blockchainer, *mempool.Pool, *block.Block))
RegisterPostBlock implements Blockchainer interface.
func (*FakeChain) SubscribeForBlocks ¶
SubscribeForBlocks implements Blockchainer interface.
func (*FakeChain) SubscribeForExecutions ¶
func (chain *FakeChain) SubscribeForExecutions(ch chan<- *state.AppExecResult)
SubscribeForExecutions implements Blockchainer interface.
func (*FakeChain) SubscribeForNotifications ¶
func (chain *FakeChain) SubscribeForNotifications(ch chan<- *state.NotificationEvent)
SubscribeForNotifications implements Blockchainer interface.
func (*FakeChain) SubscribeForTransactions ¶
func (chain *FakeChain) SubscribeForTransactions(ch chan<- *transaction.Transaction)
SubscribeForTransactions implements Blockchainer interface.
func (*FakeChain) UnsubscribeFromBlocks ¶
UnsubscribeFromBlocks implements Blockchainer interface.
func (*FakeChain) UnsubscribeFromExecutions ¶
func (chain *FakeChain) UnsubscribeFromExecutions(ch chan<- *state.AppExecResult)
UnsubscribeFromExecutions implements Blockchainer interface.
func (*FakeChain) UnsubscribeFromNotifications ¶
func (chain *FakeChain) UnsubscribeFromNotifications(ch chan<- *state.NotificationEvent)
UnsubscribeFromNotifications implements Blockchainer interface.
func (*FakeChain) UnsubscribeFromTransactions ¶
func (chain *FakeChain) UnsubscribeFromTransactions(ch chan<- *transaction.Transaction)
UnsubscribeFromTransactions implements Blockchainer interface.
func (*FakeChain) VerifyTx ¶
func (chain *FakeChain) VerifyTx(*transaction.Transaction) error
VerifyTx implements Blockchainer interface.