Documentation ¶
Index ¶
- func NewMockedConsensusJournalRegistry() journal.Registry
- func NextState(t *testing.T, chainKey *cryptolib.KeyPair, vs state.VirtualStateAccess, ...) (state.VirtualStateAccess, *iotago.Transaction, *iotago.UTXOInput)
- type MockedACSRunner
- type MockedChainCore
- func (m *MockedChainCore) EnqueueAliasOutput(chainOutput *isc.AliasOutputWithID)
- func (m *MockedChainCore) EnqueueDismissChain(reason string)
- func (m *MockedChainCore) EnqueueMissingRequestIDsMsg(msg *messages.MissingRequestIDsMsgIn)
- func (m *MockedChainCore) EnqueueMissingRequestMsg(msg *messages.MissingRequestMsg)
- func (m *MockedChainCore) EnqueueOffLedgerRequestMsg(msg *messages.OffLedgerRequestMsgIn)
- func (m *MockedChainCore) EnqueueTimerTick(tick int)
- func (m *MockedChainCore) GetAnchorOutput() *isc.AliasOutputWithID
- func (m *MockedChainCore) GetCandidateNodes() []*governance.AccessNodeInfo
- func (m *MockedChainCore) GetChainNodes() []peering.PeerStatusProvider
- func (m *MockedChainCore) GetCommitteeInfo() *chain.CommitteeInfo
- func (m *MockedChainCore) GetStateReader() state.OptimisticStateReader
- func (m *MockedChainCore) GlobalStateSync() coreutil.ChainStateSync
- func (m *MockedChainCore) ID() *isc.ChainID
- func (m *MockedChainCore) Log() *logger.Logger
- func (m *MockedChainCore) OnAliasOutput(fun func(chainOutput *isc.AliasOutputWithID))
- func (m *MockedChainCore) OnDismissChain(fun func(reason string))
- func (m *MockedChainCore) OnGetStateReader(f func() state.OptimisticStateReader)
- func (m *MockedChainCore) OnGlobalStateSync(f func() coreutil.ChainStateSync)
- func (m *MockedChainCore) OnMissingRequest(fun func(msg *messages.MissingRequestMsg))
- func (m *MockedChainCore) OnMissingRequestIDs(fun func(msg *messages.MissingRequestIDsMsgIn))
- func (m *MockedChainCore) OnOffLedgerRequest(fun func(msg *messages.OffLedgerRequestMsgIn))
- func (m *MockedChainCore) OnRequestProcessed(f func(id isc.RequestID))
- func (m *MockedChainCore) OnSendPeerMsg(fun func(netID string, msgReceiver byte, msgType byte, msgData []byte))
- func (m *MockedChainCore) OnStateCandidate(fun func(state state.VirtualStateAccess, outputID *iotago.UTXOInput))
- func (m *MockedChainCore) OnStateTransition(f func(data *chain.ChainTransitionEventData))
- func (m *MockedChainCore) OnTimerTick(fun func(tick int))
- func (m *MockedChainCore) Processors() *processors.Cache
- func (m *MockedChainCore) StateCandidateToStateManager(virtualState state.VirtualStateAccess, outputID *iotago.UTXOInput)
- func (m *MockedChainCore) TriggerChainTransition(data *chain.ChainTransitionEventData)
- func (m *MockedChainCore) VirtualStateAccess() state.VirtualStateAccess
- type MockedLedger
- func (mlT *MockedLedger) GetLatestOutput() *isc.AliasOutputWithID
- func (mlT *MockedLedger) GetOriginOutput() *isc.AliasOutputWithID
- func (mlT *MockedLedger) GetOutputByID(id *iotago.UTXOInput) *iotago.AliasOutput
- func (mlT *MockedLedger) PublishTransaction(tx *iotago.Transaction) error
- func (mlT *MockedLedger) PullLatestOutput(nodeID string)
- func (mlT *MockedLedger) PullStateOutputByID(nodeID string, outputID *iotago.UTXOInput)
- func (mlT *MockedLedger) PullTxInclusionState(nodeID string, txID iotago.TransactionID)
- func (mlT *MockedLedger) Register(nodeID string, ...)
- func (mlT *MockedLedger) SetPublishGovernanceTransactionAllowed(flag bool)
- func (mlT *MockedLedger) SetPublishGovernanceTransactionAllowedFun(fun func(tx *iotago.Transaction) bool)
- func (mlT *MockedLedger) SetPublishStateTransactionAllowed(flag bool)
- func (mlT *MockedLedger) SetPublishStateTransactionAllowedFun(fun func(tx *iotago.Transaction) bool)
- func (mlT *MockedLedger) SetPullLatestOutputAllowed(flag bool)
- func (mlT *MockedLedger) SetPullOutputByIDAllowed(flag bool)
- func (mlT *MockedLedger) SetPullOutputByIDAllowedFun(fun func(outputID *iotago.UTXOInput) bool)
- func (mlT *MockedLedger) SetPullTxInclusionStateAllowed(flag bool)
- func (mlT *MockedLedger) SetPullTxInclusionStateAllowedFun(fun func(txID iotago.TransactionID) bool)
- func (mlT *MockedLedger) SetPushOutputToNodesNeeded(flag bool)
- func (mlT *MockedLedger) SetPushOutputToNodesNeededFun(...)
- func (mlT *MockedLedger) Unregister(nodeID string)
- type MockedLedgers
- func (mlT *MockedLedgers) AttachMilestones(handler func(*nodebridge.Milestone)) *events.Closure
- func (mlT *MockedLedgers) DetachMilestones(attachID *events.Closure)
- func (mlT *MockedLedgers) GetLedger(chainID *isc.ChainID) *MockedLedger
- func (mlT *MockedLedgers) InitLedger(stateAddress iotago.Address) *isc.ChainID
- func (mlT *MockedLedgers) SetPushMilestonesToNodesNeeded(flag bool)
- func (mlT *MockedLedgers) SetPushOutputToNodesNeeded(flag bool)
- type MockedNodeConn
- func (mncT *MockedNodeConn) AttachMilestones(handler func(*nodebridge.Milestone)) *events.Closure
- func (mncT *MockedNodeConn) Close()
- func (mncT *MockedNodeConn) DetachMilestones(attachID *events.Closure)
- func (mncT *MockedNodeConn) GetMetrics() nodeconnmetrics.NodeConnectionMetrics
- func (mncT *MockedNodeConn) ID() string
- func (mncT *MockedNodeConn) PublishTransaction(chainID *isc.ChainID, tx *iotago.Transaction) error
- func (mncT *MockedNodeConn) PullLatestOutput(chainID *isc.ChainID)
- func (mncT *MockedNodeConn) PullStateOutputByID(chainID *isc.ChainID, id *iotago.UTXOInput)
- func (mncT *MockedNodeConn) RegisterChain(chainID *isc.ChainID, ...)
- func (mncT *MockedNodeConn) SetMetrics(metrics nodeconnmetrics.NodeConnectionMetrics)
- func (mncT *MockedNodeConn) SetPublishGovernanceTransactionAllowed(flag bool)
- func (mncT *MockedNodeConn) SetPublishGovernanceTransactionAllowedFun(fun func(chainID *isc.ChainID, tx *iotago.Transaction) bool)
- func (mncT *MockedNodeConn) SetPublishStateTransactionAllowed(flag bool)
- func (mncT *MockedNodeConn) SetPublishStateTransactionAllowedFun(fun func(chainID *isc.ChainID, tx *iotago.Transaction) bool)
- func (mncT *MockedNodeConn) SetPullLatestOutputAllowed(flag bool)
- func (mncT *MockedNodeConn) SetPullOutputByIDAllowed(flag bool)
- func (mncT *MockedNodeConn) SetPullOutputByIDAllowedFun(fun func(chainID *isc.ChainID, outputID *iotago.UTXOInput) bool)
- func (mncT *MockedNodeConn) SetPullTxInclusionStateAllowed(flag bool)
- func (mncT *MockedNodeConn) SetPullTxInclusionStateAllowedFun(fun func(chainID *isc.ChainID, txID iotago.TransactionID) bool)
- func (mncT *MockedNodeConn) UnregisterChain(chainID *isc.ChainID)
- type MockedVMRunner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockedConsensusJournalRegistry ¶ added in v0.3.0
func NextState ¶ added in v0.3.0
func NextState( t *testing.T, chainKey *cryptolib.KeyPair, vs state.VirtualStateAccess, chainOutput *isc.AliasOutputWithID, ts time.Time, ) (state.VirtualStateAccess, *iotago.Transaction, *iotago.UTXOInput)
Types ¶
type MockedACSRunner ¶
type MockedACSRunner struct {
// contains filtered or unexported fields
}
func NewMockedACSRunner ¶
func NewMockedACSRunner(quorum uint16, log *logger.Logger) *MockedACSRunner
func (*MockedACSRunner) Close ¶
func (acs *MockedACSRunner) Close()
func (*MockedACSRunner) RunACSConsensus ¶
type MockedChainCore ¶
func NewMockedChainCore ¶
func (*MockedChainCore) EnqueueAliasOutput ¶ added in v0.3.0
func (m *MockedChainCore) EnqueueAliasOutput(chainOutput *isc.AliasOutputWithID)
func (*MockedChainCore) EnqueueDismissChain ¶ added in v0.2.3
func (m *MockedChainCore) EnqueueDismissChain(reason string)
func (*MockedChainCore) EnqueueMissingRequestIDsMsg ¶ added in v0.2.3
func (m *MockedChainCore) EnqueueMissingRequestIDsMsg(msg *messages.MissingRequestIDsMsgIn)
func (*MockedChainCore) EnqueueMissingRequestMsg ¶ added in v0.2.3
func (m *MockedChainCore) EnqueueMissingRequestMsg(msg *messages.MissingRequestMsg)
func (*MockedChainCore) EnqueueOffLedgerRequestMsg ¶ added in v0.2.3
func (m *MockedChainCore) EnqueueOffLedgerRequestMsg(msg *messages.OffLedgerRequestMsgIn)
func (*MockedChainCore) EnqueueTimerTick ¶ added in v0.2.3
func (m *MockedChainCore) EnqueueTimerTick(tick int)
func (*MockedChainCore) GetAnchorOutput ¶ added in v0.3.0
func (m *MockedChainCore) GetAnchorOutput() *isc.AliasOutputWithID
func (*MockedChainCore) GetCandidateNodes ¶ added in v0.2.4
func (m *MockedChainCore) GetCandidateNodes() []*governance.AccessNodeInfo
func (*MockedChainCore) GetChainNodes ¶ added in v0.2.4
func (m *MockedChainCore) GetChainNodes() []peering.PeerStatusProvider
func (*MockedChainCore) GetCommitteeInfo ¶
func (m *MockedChainCore) GetCommitteeInfo() *chain.CommitteeInfo
func (*MockedChainCore) GetStateReader ¶
func (m *MockedChainCore) GetStateReader() state.OptimisticStateReader
func (*MockedChainCore) GlobalStateSync ¶
func (m *MockedChainCore) GlobalStateSync() coreutil.ChainStateSync
func (*MockedChainCore) ID ¶
func (m *MockedChainCore) ID() *isc.ChainID
func (*MockedChainCore) Log ¶
func (m *MockedChainCore) Log() *logger.Logger
func (*MockedChainCore) OnAliasOutput ¶ added in v0.3.0
func (m *MockedChainCore) OnAliasOutput(fun func(chainOutput *isc.AliasOutputWithID))
func (*MockedChainCore) OnDismissChain ¶ added in v0.2.3
func (m *MockedChainCore) OnDismissChain(fun func(reason string))
func (*MockedChainCore) OnGetStateReader ¶
func (m *MockedChainCore) OnGetStateReader(f func() state.OptimisticStateReader)
func (*MockedChainCore) OnGlobalStateSync ¶
func (m *MockedChainCore) OnGlobalStateSync(f func() coreutil.ChainStateSync)
func (*MockedChainCore) OnMissingRequest ¶ added in v0.2.3
func (m *MockedChainCore) OnMissingRequest(fun func(msg *messages.MissingRequestMsg))
func (*MockedChainCore) OnMissingRequestIDs ¶ added in v0.2.3
func (m *MockedChainCore) OnMissingRequestIDs(fun func(msg *messages.MissingRequestIDsMsgIn))
func (*MockedChainCore) OnOffLedgerRequest ¶ added in v0.2.3
func (m *MockedChainCore) OnOffLedgerRequest(fun func(msg *messages.OffLedgerRequestMsgIn))
func (*MockedChainCore) OnRequestProcessed ¶
func (m *MockedChainCore) OnRequestProcessed(f func(id isc.RequestID))
func (*MockedChainCore) OnSendPeerMsg ¶ added in v0.2.3
func (m *MockedChainCore) OnSendPeerMsg(fun func(netID string, msgReceiver byte, msgType byte, msgData []byte))
func (*MockedChainCore) OnStateCandidate ¶ added in v0.2.3
func (m *MockedChainCore) OnStateCandidate(fun func(state state.VirtualStateAccess, outputID *iotago.UTXOInput))
func (*MockedChainCore) OnStateTransition ¶
func (m *MockedChainCore) OnStateTransition(f func(data *chain.ChainTransitionEventData))
func (*MockedChainCore) OnTimerTick ¶ added in v0.2.3
func (m *MockedChainCore) OnTimerTick(fun func(tick int))
func (*MockedChainCore) Processors ¶
func (m *MockedChainCore) Processors() *processors.Cache
func (*MockedChainCore) StateCandidateToStateManager ¶ added in v0.2.3
func (m *MockedChainCore) StateCandidateToStateManager(virtualState state.VirtualStateAccess, outputID *iotago.UTXOInput)
func (*MockedChainCore) TriggerChainTransition ¶ added in v0.2.3
func (m *MockedChainCore) TriggerChainTransition(data *chain.ChainTransitionEventData)
func (*MockedChainCore) VirtualStateAccess ¶ added in v0.3.0
func (m *MockedChainCore) VirtualStateAccess() state.VirtualStateAccess
type MockedLedger ¶ added in v0.3.0
type MockedLedger struct {
// contains filtered or unexported fields
}
func NewMockedLedger ¶ added in v0.3.0
func (*MockedLedger) GetLatestOutput ¶ added in v0.3.0
func (mlT *MockedLedger) GetLatestOutput() *isc.AliasOutputWithID
func (*MockedLedger) GetOriginOutput ¶ added in v0.3.0
func (mlT *MockedLedger) GetOriginOutput() *isc.AliasOutputWithID
func (*MockedLedger) GetOutputByID ¶ added in v0.3.0
func (mlT *MockedLedger) GetOutputByID(id *iotago.UTXOInput) *iotago.AliasOutput
func (*MockedLedger) PublishTransaction ¶ added in v0.3.2
func (mlT *MockedLedger) PublishTransaction(tx *iotago.Transaction) error
func (*MockedLedger) PullLatestOutput ¶ added in v0.3.0
func (mlT *MockedLedger) PullLatestOutput(nodeID string)
func (*MockedLedger) PullStateOutputByID ¶ added in v0.3.0
func (mlT *MockedLedger) PullStateOutputByID(nodeID string, outputID *iotago.UTXOInput)
func (*MockedLedger) PullTxInclusionState ¶ added in v0.3.0
func (mlT *MockedLedger) PullTxInclusionState(nodeID string, txID iotago.TransactionID)
func (*MockedLedger) SetPublishGovernanceTransactionAllowed ¶ added in v0.3.0
func (mlT *MockedLedger) SetPublishGovernanceTransactionAllowed(flag bool)
func (*MockedLedger) SetPublishGovernanceTransactionAllowedFun ¶ added in v0.3.0
func (mlT *MockedLedger) SetPublishGovernanceTransactionAllowedFun(fun func(tx *iotago.Transaction) bool)
func (*MockedLedger) SetPublishStateTransactionAllowed ¶ added in v0.3.0
func (mlT *MockedLedger) SetPublishStateTransactionAllowed(flag bool)
func (*MockedLedger) SetPublishStateTransactionAllowedFun ¶ added in v0.3.0
func (mlT *MockedLedger) SetPublishStateTransactionAllowedFun(fun func(tx *iotago.Transaction) bool)
func (*MockedLedger) SetPullLatestOutputAllowed ¶ added in v0.3.0
func (mlT *MockedLedger) SetPullLatestOutputAllowed(flag bool)
func (*MockedLedger) SetPullOutputByIDAllowed ¶ added in v0.3.0
func (mlT *MockedLedger) SetPullOutputByIDAllowed(flag bool)
func (*MockedLedger) SetPullOutputByIDAllowedFun ¶ added in v0.3.0
func (mlT *MockedLedger) SetPullOutputByIDAllowedFun(fun func(outputID *iotago.UTXOInput) bool)
func (*MockedLedger) SetPullTxInclusionStateAllowed ¶ added in v0.3.0
func (mlT *MockedLedger) SetPullTxInclusionStateAllowed(flag bool)
func (*MockedLedger) SetPullTxInclusionStateAllowedFun ¶ added in v0.3.0
func (mlT *MockedLedger) SetPullTxInclusionStateAllowedFun(fun func(txID iotago.TransactionID) bool)
func (*MockedLedger) SetPushOutputToNodesNeeded ¶ added in v0.3.0
func (mlT *MockedLedger) SetPushOutputToNodesNeeded(flag bool)
func (*MockedLedger) SetPushOutputToNodesNeededFun ¶ added in v0.3.0
func (mlT *MockedLedger) SetPushOutputToNodesNeededFun(fun func(tx *iotago.Transaction, outputID *iotago.UTXOInput, output iotago.Output) bool)
func (*MockedLedger) Unregister ¶ added in v0.3.0
func (mlT *MockedLedger) Unregister(nodeID string)
type MockedLedgers ¶ added in v0.3.0
type MockedLedgers struct {
// contains filtered or unexported fields
}
func NewMockedLedgers ¶ added in v0.3.0
func NewMockedLedgers(log *logger.Logger) *MockedLedgers
func (*MockedLedgers) AttachMilestones ¶ added in v0.3.0
func (mlT *MockedLedgers) AttachMilestones(handler func(*nodebridge.Milestone)) *events.Closure
func (*MockedLedgers) DetachMilestones ¶ added in v0.3.0
func (mlT *MockedLedgers) DetachMilestones(attachID *events.Closure)
func (*MockedLedgers) GetLedger ¶ added in v0.3.0
func (mlT *MockedLedgers) GetLedger(chainID *isc.ChainID) *MockedLedger
func (*MockedLedgers) InitLedger ¶ added in v0.3.0
func (mlT *MockedLedgers) InitLedger(stateAddress iotago.Address) *isc.ChainID
func (*MockedLedgers) SetPushMilestonesToNodesNeeded ¶ added in v0.3.0
func (mlT *MockedLedgers) SetPushMilestonesToNodesNeeded(flag bool)
func (*MockedLedgers) SetPushOutputToNodesNeeded ¶ added in v0.3.0
func (mlT *MockedLedgers) SetPushOutputToNodesNeeded(flag bool)
type MockedNodeConn ¶
type MockedNodeConn struct {
// contains filtered or unexported fields
}
func NewMockedNodeConnection ¶
func NewMockedNodeConnection(id string, ledgers *MockedLedgers, log *logger.Logger) *MockedNodeConn
func (*MockedNodeConn) AttachMilestones ¶ added in v0.3.0
func (mncT *MockedNodeConn) AttachMilestones(handler func(*nodebridge.Milestone)) *events.Closure
func (*MockedNodeConn) Close ¶ added in v0.2.3
func (mncT *MockedNodeConn) Close()
func (*MockedNodeConn) DetachMilestones ¶ added in v0.3.0
func (mncT *MockedNodeConn) DetachMilestones(attachID *events.Closure)
func (*MockedNodeConn) GetMetrics ¶ added in v0.2.3
func (mncT *MockedNodeConn) GetMetrics() nodeconnmetrics.NodeConnectionMetrics
func (*MockedNodeConn) ID ¶
func (mncT *MockedNodeConn) ID() string
func (*MockedNodeConn) PublishTransaction ¶ added in v0.3.2
func (mncT *MockedNodeConn) PublishTransaction(chainID *isc.ChainID, tx *iotago.Transaction) error
func (*MockedNodeConn) PullLatestOutput ¶ added in v0.3.0
func (mncT *MockedNodeConn) PullLatestOutput(chainID *isc.ChainID)
func (*MockedNodeConn) PullStateOutputByID ¶ added in v0.3.0
func (mncT *MockedNodeConn) PullStateOutputByID(chainID *isc.ChainID, id *iotago.UTXOInput)
func (*MockedNodeConn) RegisterChain ¶ added in v0.3.0
func (mncT *MockedNodeConn) RegisterChain( chainID *isc.ChainID, stateOutputHandler, outputHandler func(iotago.OutputID, iotago.Output), milestoneHandler func(*nodebridge.Milestone), )
func (*MockedNodeConn) SetMetrics ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetMetrics(metrics nodeconnmetrics.NodeConnectionMetrics)
func (*MockedNodeConn) SetPublishGovernanceTransactionAllowed ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPublishGovernanceTransactionAllowed(flag bool)
func (*MockedNodeConn) SetPublishGovernanceTransactionAllowedFun ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPublishGovernanceTransactionAllowedFun(fun func(chainID *isc.ChainID, tx *iotago.Transaction) bool)
func (*MockedNodeConn) SetPublishStateTransactionAllowed ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPublishStateTransactionAllowed(flag bool)
func (*MockedNodeConn) SetPublishStateTransactionAllowedFun ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPublishStateTransactionAllowedFun(fun func(chainID *isc.ChainID, tx *iotago.Transaction) bool)
func (*MockedNodeConn) SetPullLatestOutputAllowed ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPullLatestOutputAllowed(flag bool)
func (*MockedNodeConn) SetPullOutputByIDAllowed ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPullOutputByIDAllowed(flag bool)
func (*MockedNodeConn) SetPullOutputByIDAllowedFun ¶ added in v0.3.0
func (*MockedNodeConn) SetPullTxInclusionStateAllowed ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPullTxInclusionStateAllowed(flag bool)
func (*MockedNodeConn) SetPullTxInclusionStateAllowedFun ¶ added in v0.3.0
func (mncT *MockedNodeConn) SetPullTxInclusionStateAllowedFun(fun func(chainID *isc.ChainID, txID iotago.TransactionID) bool)
func (*MockedNodeConn) UnregisterChain ¶ added in v0.3.0
func (mncT *MockedNodeConn) UnregisterChain(chainID *isc.ChainID)
type MockedVMRunner ¶
type MockedVMRunner struct {
// contains filtered or unexported fields
}
func NewMockedVMRunner ¶
func NewMockedVMRunner(t *testing.T, log *logger.Logger) *MockedVMRunner
Click to show internal directories.
Click to hide internal directories.