Documentation ¶
Overview ¶
Package testutil provides mock implementations of various wasp components. They are used for unit-testing different parts.
Index ¶
- func DummyOffledgerRequest(chainID isc.ChainID) isc.OffLedgerRequest
- func DummyStateMetadata(commitment *state.L1Commitment) *transaction.StateMetadata
- func NewConsensusStateRegistry() cmt_log.ConsensusStateRegistry
- func NewTrustedNetworkManager() peering.TrustedNetworkManager
- func RunHeavy(t *testing.T)
- type ChainRecordRegistryProvider
- type DkgRegistryProvider
- type PeeringNetBehavior
- type PeeringNetDynamic
- func (pndT *PeeringNetDynamic) AddLink(inCh, outCh chan *peeringMsg, dstPubKey *cryptolib.PublicKey)
- func (pndT *PeeringNetDynamic) Close()
- func (pndT *PeeringNetDynamic) RemoveHandler(id string) bool
- func (pndT *PeeringNetDynamic) WithDelayingChannel(id *string, delayFrom, delayTill time.Duration) *PeeringNetDynamic
- func (pndT *PeeringNetDynamic) WithLosingChannel(id *string, deliveryProbability int) *PeeringNetDynamic
- func (pndT *PeeringNetDynamic) WithPeerDisconnected(id *string, peerPubKey *cryptolib.PublicKey) *PeeringNetDynamic
- func (pndT *PeeringNetDynamic) WithRepeatingChannel(id *string, repeatProbability int) *PeeringNetDynamic
- type PeeringNetwork
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DummyOffledgerRequest ¶ added in v0.2.3
func DummyOffledgerRequest(chainID isc.ChainID) isc.OffLedgerRequest
func DummyStateMetadata ¶ added in v1.0.3
func DummyStateMetadata(commitment *state.L1Commitment) *transaction.StateMetadata
func NewConsensusStateRegistry ¶ added in v1.0.3
func NewConsensusStateRegistry() cmt_log.ConsensusStateRegistry
func NewTrustedNetworkManager ¶ added in v0.2.0
func NewTrustedNetworkManager() peering.TrustedNetworkManager
Types ¶
type ChainRecordRegistryProvider ¶ added in v0.2.0
type ChainRecordRegistryProvider struct {
DB map[isc.ChainID]*registry.ChainRecord
}
func NewChainRecordRegistryProvider ¶ added in v0.2.0
func NewChainRecordRegistryProvider() *ChainRecordRegistryProvider
func (*ChainRecordRegistryProvider) AddChainRecord ¶ added in v1.0.3
func (p *ChainRecordRegistryProvider) AddChainRecord(chainRecord *registry.ChainRecord) error
func (*ChainRecordRegistryProvider) LoadChainRecord ¶ added in v0.2.0
func (p *ChainRecordRegistryProvider) LoadChainRecord(chainID isc.ChainID) (*registry.ChainRecord, error)
type DkgRegistryProvider ¶ added in v0.1.0
DkgRegistryProvider stands for a mock for dkg.DKShareRegistryProvider.
func NewDkgRegistryProvider ¶ added in v0.1.0
func NewDkgRegistryProvider(nodePrivKey *cryptolib.PrivateKey) *DkgRegistryProvider
NewDkgRegistryProvider creates new mocked DKG registry provider.
func (*DkgRegistryProvider) LoadDKShare ¶ added in v0.1.0
LoadDKShare implements dkg.DKShareRegistryProvider.
func (*DkgRegistryProvider) SaveDKShare ¶ added in v0.1.0
func (p *DkgRegistryProvider) SaveDKShare(dkShare tcrypto.DKShare) error
SaveDKShare implements dkg.DKShareRegistryProvider.
type PeeringNetBehavior ¶ added in v0.1.0
type PeeringNetBehavior interface { AddLink(inCh, outCh chan *peeringMsg, dstPubKey *cryptolib.PublicKey) Close() }
An interface for all the network behaviors.
func NewPeeringNetReliable ¶ added in v0.1.0
func NewPeeringNetReliable(log *logger.Logger) PeeringNetBehavior
NewPeeringNetReliable constructs the PeeringNetBehavior.
func NewPeeringNetUnreliable ¶ added in v0.1.0
func NewPeeringNetUnreliable(deliverPct, repeatPct int, delayFrom, delayTill time.Duration, log *logger.Logger) PeeringNetBehavior
NewPeeringNetReliable constructs the PeeringNetBehavior.
type PeeringNetDynamic ¶ added in v0.2.0
type PeeringNetDynamic struct {
// contains filtered or unexported fields
}
peeringNetDynamic provides a behavior of a network with dynamically changeable working conditions. It works as peeringNetReliable without any handlers set.
func NewPeeringNetDynamic ¶ added in v0.2.0
func NewPeeringNetDynamic(log *logger.Logger) *PeeringNetDynamic
NewPeeringNetDynamic constructs the PeeringNetBehavior.
func (*PeeringNetDynamic) AddLink ¶ added in v0.2.0
func (pndT *PeeringNetDynamic) AddLink(inCh, outCh chan *peeringMsg, dstPubKey *cryptolib.PublicKey)
AddLink implements PeeringNetBehavior.
func (*PeeringNetDynamic) Close ¶ added in v0.2.0
func (pndT *PeeringNetDynamic) Close()
Close implements PeeringNetBehavior.
func (*PeeringNetDynamic) RemoveHandler ¶ added in v0.2.0
func (pndT *PeeringNetDynamic) RemoveHandler(id string) bool
func (*PeeringNetDynamic) WithDelayingChannel ¶ added in v0.2.0
func (pndT *PeeringNetDynamic) WithDelayingChannel(id *string, delayFrom, delayTill time.Duration) *PeeringNetDynamic
func (*PeeringNetDynamic) WithLosingChannel ¶ added in v0.2.0
func (pndT *PeeringNetDynamic) WithLosingChannel(id *string, deliveryProbability int) *PeeringNetDynamic
func (*PeeringNetDynamic) WithPeerDisconnected ¶ added in v0.2.0
func (pndT *PeeringNetDynamic) WithPeerDisconnected(id *string, peerPubKey *cryptolib.PublicKey) *PeeringNetDynamic
func (*PeeringNetDynamic) WithRepeatingChannel ¶ added in v0.2.0
func (pndT *PeeringNetDynamic) WithRepeatingChannel(id *string, repeatProbability int) *PeeringNetDynamic
type PeeringNetwork ¶ added in v0.1.0
type PeeringNetwork struct {
// contains filtered or unexported fields
}
PeeringNetwork represents a global view of the mocked network.
func NewPeeringNetwork ¶ added in v0.1.0
func NewPeeringNetwork( peeringURLs []string, nodeIdentities []*cryptolib.KeyPair, bufSize int, behavior PeeringNetBehavior, log *logger.Logger, ) *PeeringNetwork
NewPeeringNetwork creates new test network, it can then be used to create network nodes.
func (*PeeringNetwork) Close ¶ added in v0.2.0
func (p *PeeringNetwork) Close() error
Close implements the io.Closer interface.
func (*PeeringNetwork) NetworkProviders ¶ added in v0.1.0
func (p *PeeringNetwork) NetworkProviders() []peering.NetworkProvider
NetworkProviders returns network providers for each of the nodes in the network.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
privtangle is a cluster of HORNET nodes started for testing purposes.
|
privtangle is a cluster of HORNET nodes started for testing purposes. |
Package utxodb provides tools to simulate an in-memory synchronous ledger, for testing purposes.
|
Package utxodb provides tools to simulate an in-memory synchronous ledger, for testing purposes. |