Documentation ¶
Index ¶
- type MockCatchpointCatchupAccessor
- func (m *MockCatchpointCatchupAccessor) BuildMerkleTrie(ctx context.Context, progressUpdates func(uint64, uint64)) (err error)
- func (m *MockCatchpointCatchupAccessor) CompleteCatchup(ctx context.Context) (err error)
- func (m *MockCatchpointCatchupAccessor) EnsureFirstBlock(ctx context.Context) (blk bookkeeping.Block, err error)
- func (m *MockCatchpointCatchupAccessor) FinishBlocks(ctx context.Context, applyChanges bool) (err error)
- func (m *MockCatchpointCatchupAccessor) GetCatchupBlockRound(ctx context.Context) (round basics.Round, err error)
- func (m *MockCatchpointCatchupAccessor) GetLabel(ctx context.Context) (label string, err error)
- func (m *MockCatchpointCatchupAccessor) GetState(ctx context.Context) (state ledger.CatchpointCatchupState, err error)
- func (m *MockCatchpointCatchupAccessor) GetVerifyData(ctx context.Context) (balancesHash crypto.Digest, spverHash crypto.Digest, ...)
- func (m *MockCatchpointCatchupAccessor) Ledger() (l ledger.CatchupAccessorClientLedger)
- func (m *MockCatchpointCatchupAccessor) ProcessStagingBalances(ctx context.Context, sectionName string, bytes []byte, ...) (err error)
- func (m *MockCatchpointCatchupAccessor) ResetStagingBalances(ctx context.Context, newCatchup bool) (err error)
- func (m *MockCatchpointCatchupAccessor) SetLabel(ctx context.Context, label string) (err error)
- func (m *MockCatchpointCatchupAccessor) SetState(ctx context.Context, state ledger.CatchpointCatchupState) (err error)
- func (m *MockCatchpointCatchupAccessor) StoreBalancesRound(ctx context.Context, blk *bookkeeping.Block) (err error)
- func (m *MockCatchpointCatchupAccessor) StoreBlock(ctx context.Context, blk *bookkeeping.Block, cert *agreement.Certificate) (err error)
- func (m *MockCatchpointCatchupAccessor) StoreFirstBlock(ctx context.Context, blk *bookkeeping.Block, cert *agreement.Certificate) (err error)
- func (m *MockCatchpointCatchupAccessor) VerifyCatchpoint(ctx context.Context, blk *bookkeeping.Block) (err error)
- type MockNetwork
- func (network *MockNetwork) Address() (string, bool)
- func (network *MockNetwork) Broadcast(ctx context.Context, tag protocol.Tag, data []byte, wait bool, ...) error
- func (network *MockNetwork) ClearHandlers()
- func (network *MockNetwork) ClearProcessors()
- func (network *MockNetwork) Disconnect(badpeer network.DisconnectablePeer)
- func (network *MockNetwork) DisconnectPeers()
- func (network *MockNetwork) GetGenesisID() string
- func (network *MockNetwork) GetHTTPClient(address string) (*http.Client, error)
- func (network *MockNetwork) GetPeers(options ...network.PeerOption) []network.Peer
- func (network *MockNetwork) OnNetworkAdvance()
- func (network *MockNetwork) Ready() chan struct{}
- func (network *MockNetwork) RegisterHTTPHandler(path string, handler http.Handler)
- func (network *MockNetwork) RegisterHTTPHandlerFunc(path string, handler func(http.ResponseWriter, *http.Request))
- func (network *MockNetwork) RegisterHandlers(dispatch []network.TaggedMessageHandler)
- func (network *MockNetwork) RegisterRPCName(name string, rcvr interface{})
- func (network *MockNetwork) RegisterValidatorHandlers(dispatch []network.TaggedMessageValidatorHandler)
- func (network *MockNetwork) Relay(ctx context.Context, tag protocol.Tag, data []byte, wait bool, ...) error
- func (network *MockNetwork) RequestConnectOutgoing(replace bool, quit <-chan struct{})
- func (network *MockNetwork) Start() error
- func (network *MockNetwork) Stop()
- type MockParticipationRegistry
- func (m *MockParticipationRegistry) AppendKeys(id account.ParticipationID, keys account.StateProofKeys) error
- func (m *MockParticipationRegistry) Close()
- func (m *MockParticipationRegistry) Delete(id account.ParticipationID) error
- func (m *MockParticipationRegistry) DeleteExpired(latestRound basics.Round, agreementProto config.ConsensusParams) error
- func (m *MockParticipationRegistry) DeleteStateProofKeys(id account.ParticipationID, round basics.Round) error
- func (m *MockParticipationRegistry) Flush(timeout time.Duration) error
- func (m *MockParticipationRegistry) Get(id account.ParticipationID) account.ParticipationRecord
- func (m *MockParticipationRegistry) GetAll() []account.ParticipationRecord
- func (m *MockParticipationRegistry) GetForRound(id account.ParticipationID, round basics.Round) (account.ParticipationRecordForRound, error)
- func (m *MockParticipationRegistry) GetStateProofSecretsForRound(id account.ParticipationID, round basics.Round) (account.StateProofSecretsForRound, error)
- func (m *MockParticipationRegistry) HasLiveKeys(from, to basics.Round) bool
- func (m *MockParticipationRegistry) Insert(record account.Participation) (account.ParticipationID, error)
- func (m *MockParticipationRegistry) Record(account basics.Address, round basics.Round, ...) error
- func (m *MockParticipationRegistry) Register(id account.ParticipationID, on basics.Round) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockCatchpointCatchupAccessor ¶
type MockCatchpointCatchupAccessor struct{}
MockCatchpointCatchupAccessor is a dummy CatchpointCatchupAccessor implementation which doesn't do anything.
func (*MockCatchpointCatchupAccessor) BuildMerkleTrie ¶
func (m *MockCatchpointCatchupAccessor) BuildMerkleTrie(ctx context.Context, progressUpdates func(uint64, uint64)) (err error)
BuildMerkleTrie inserts the account hashes into the merkle trie
func (*MockCatchpointCatchupAccessor) CompleteCatchup ¶
func (m *MockCatchpointCatchupAccessor) CompleteCatchup(ctx context.Context) (err error)
CompleteCatchup completes the catchpoint catchup process by switching the databases tables around and reloading the ledger.
func (*MockCatchpointCatchupAccessor) EnsureFirstBlock ¶
func (m *MockCatchpointCatchupAccessor) EnsureFirstBlock(ctx context.Context) (blk bookkeeping.Block, err error)
EnsureFirstBlock ensure that we have a single block in the staging block table, and returns that block
func (*MockCatchpointCatchupAccessor) FinishBlocks ¶
func (m *MockCatchpointCatchupAccessor) FinishBlocks(ctx context.Context, applyChanges bool) (err error)
FinishBlocks concludes the catchup of the blocks database.
func (*MockCatchpointCatchupAccessor) GetCatchupBlockRound ¶
func (m *MockCatchpointCatchupAccessor) GetCatchupBlockRound(ctx context.Context) (round basics.Round, err error)
GetCatchupBlockRound returns the latest block round matching the current catchpoint
func (*MockCatchpointCatchupAccessor) GetLabel ¶
func (m *MockCatchpointCatchupAccessor) GetLabel(ctx context.Context) (label string, err error)
GetLabel returns the current catchpoint catchup label
func (*MockCatchpointCatchupAccessor) GetState ¶
func (m *MockCatchpointCatchupAccessor) GetState(ctx context.Context) (state ledger.CatchpointCatchupState, err error)
GetState returns the current state of the catchpoint catchup
func (*MockCatchpointCatchupAccessor) GetVerifyData ¶
func (m *MockCatchpointCatchupAccessor) GetVerifyData(ctx context.Context) (balancesHash crypto.Digest, spverHash crypto.Digest, totals ledgercore.AccountTotals, err error)
GetVerifyData returns the balances hash, spver hash and totals used by VerifyCatchpoint
func (*MockCatchpointCatchupAccessor) Ledger ¶
func (m *MockCatchpointCatchupAccessor) Ledger() (l ledger.CatchupAccessorClientLedger)
Ledger returns ledger instance as CatchupAccessorClientLedger interface
func (*MockCatchpointCatchupAccessor) ProcessStagingBalances ¶
func (m *MockCatchpointCatchupAccessor) ProcessStagingBalances(ctx context.Context, sectionName string, bytes []byte, progress *ledger.CatchpointCatchupAccessorProgress) (err error)
ProcessStagingBalances deserialize the given bytes as a temporary staging balances
func (*MockCatchpointCatchupAccessor) ResetStagingBalances ¶
func (m *MockCatchpointCatchupAccessor) ResetStagingBalances(ctx context.Context, newCatchup bool) (err error)
ResetStagingBalances resets the current staging balances, preparing for a new set of balances to be added
func (*MockCatchpointCatchupAccessor) SetLabel ¶
func (m *MockCatchpointCatchupAccessor) SetLabel(ctx context.Context, label string) (err error)
SetLabel set the catchpoint catchup label
func (*MockCatchpointCatchupAccessor) SetState ¶
func (m *MockCatchpointCatchupAccessor) SetState(ctx context.Context, state ledger.CatchpointCatchupState) (err error)
SetState set the state of the catchpoint catchup
func (*MockCatchpointCatchupAccessor) StoreBalancesRound ¶
func (m *MockCatchpointCatchupAccessor) StoreBalancesRound(ctx context.Context, blk *bookkeeping.Block) (err error)
StoreBalancesRound calculates the balances round based on the first block and the associated consensus parametets, and store that to the database
func (*MockCatchpointCatchupAccessor) StoreBlock ¶
func (m *MockCatchpointCatchupAccessor) StoreBlock(ctx context.Context, blk *bookkeeping.Block, cert *agreement.Certificate) (err error)
StoreBlock stores a single block to the blocks database.
func (*MockCatchpointCatchupAccessor) StoreFirstBlock ¶
func (m *MockCatchpointCatchupAccessor) StoreFirstBlock(ctx context.Context, blk *bookkeeping.Block, cert *agreement.Certificate) (err error)
StoreFirstBlock stores a single block to the blocks database.
func (*MockCatchpointCatchupAccessor) VerifyCatchpoint ¶
func (m *MockCatchpointCatchupAccessor) VerifyCatchpoint(ctx context.Context, blk *bookkeeping.Block) (err error)
VerifyCatchpoint verifies that the catchpoint is valid by reconstructing the label.
type MockNetwork ¶
type MockNetwork struct { network.GossipNode GenesisID string }
MockNetwork is a dummy network that doesn't do anything
func (*MockNetwork) Address ¶
func (network *MockNetwork) Address() (string, bool)
Address - unused function
func (*MockNetwork) Broadcast ¶
func (network *MockNetwork) Broadcast(ctx context.Context, tag protocol.Tag, data []byte, wait bool, except network.Peer) error
Broadcast - unused function
func (*MockNetwork) ClearHandlers ¶
func (network *MockNetwork) ClearHandlers()
ClearHandlers - empty implementation
func (*MockNetwork) ClearProcessors ¶
func (network *MockNetwork) ClearProcessors()
ClearProcessors - empty implementation
func (*MockNetwork) Disconnect ¶
func (network *MockNetwork) Disconnect(badpeer network.DisconnectablePeer)
Disconnect - unused function
func (*MockNetwork) DisconnectPeers ¶
func (network *MockNetwork) DisconnectPeers()
DisconnectPeers - unused function
func (*MockNetwork) GetGenesisID ¶
func (network *MockNetwork) GetGenesisID() string
GetGenesisID - empty implementation
func (*MockNetwork) GetHTTPClient ¶
func (network *MockNetwork) GetHTTPClient(address string) (*http.Client, error)
GetHTTPClient returns a http.Client with a suitable for the network
func (*MockNetwork) GetPeers ¶
func (network *MockNetwork) GetPeers(options ...network.PeerOption) []network.Peer
GetPeers - unused function
func (*MockNetwork) OnNetworkAdvance ¶
func (network *MockNetwork) OnNetworkAdvance()
OnNetworkAdvance - empty implementation
func (*MockNetwork) RegisterHTTPHandler ¶
func (network *MockNetwork) RegisterHTTPHandler(path string, handler http.Handler)
RegisterHTTPHandler - empty implementation
func (*MockNetwork) RegisterHTTPHandlerFunc ¶
func (network *MockNetwork) RegisterHTTPHandlerFunc(path string, handler func(http.ResponseWriter, *http.Request))
RegisterHTTPHandlerFunc - empty implementation
func (*MockNetwork) RegisterHandlers ¶
func (network *MockNetwork) RegisterHandlers(dispatch []network.TaggedMessageHandler)
RegisterHandlers - empty implementation.
func (*MockNetwork) RegisterRPCName ¶
func (network *MockNetwork) RegisterRPCName(name string, rcvr interface{})
RegisterRPCName - unused function
func (*MockNetwork) RegisterValidatorHandlers ¶
func (network *MockNetwork) RegisterValidatorHandlers(dispatch []network.TaggedMessageValidatorHandler)
RegisterValidatorHandlers - empty implementation.
func (*MockNetwork) Relay ¶
func (network *MockNetwork) Relay(ctx context.Context, tag protocol.Tag, data []byte, wait bool, except network.Peer) error
Relay - unused function
func (*MockNetwork) RequestConnectOutgoing ¶
func (network *MockNetwork) RequestConnectOutgoing(replace bool, quit <-chan struct{})
RequestConnectOutgoing - unused function
type MockParticipationRegistry ¶
type MockParticipationRegistry struct { }
MockParticipationRegistry is a dummy ParticipationRegistry that doesn't do anything
func (*MockParticipationRegistry) AppendKeys ¶
func (m *MockParticipationRegistry) AppendKeys(id account.ParticipationID, keys account.StateProofKeys) error
AppendKeys appends state proof keys to an existing Participation record. Keys can only be appended once, an error will occur when the data is flushed when inserting a duplicate key.
func (*MockParticipationRegistry) Close ¶
func (m *MockParticipationRegistry) Close()
Close any resources used to implement the interface.
func (*MockParticipationRegistry) Delete ¶
func (m *MockParticipationRegistry) Delete(id account.ParticipationID) error
Delete removes a record from storage.
func (*MockParticipationRegistry) DeleteExpired ¶
func (m *MockParticipationRegistry) DeleteExpired(latestRound basics.Round, agreementProto config.ConsensusParams) error
DeleteExpired removes all records from storage which are expired on the given round.
func (*MockParticipationRegistry) DeleteStateProofKeys ¶
func (m *MockParticipationRegistry) DeleteStateProofKeys(id account.ParticipationID, round basics.Round) error
DeleteStateProofKeys removes all stateproof keys preceding a given round (including)
func (*MockParticipationRegistry) Flush ¶
func (m *MockParticipationRegistry) Flush(timeout time.Duration) error
Flush ensures that all changes have been written to the underlying data store.
func (*MockParticipationRegistry) Get ¶
func (m *MockParticipationRegistry) Get(id account.ParticipationID) account.ParticipationRecord
Get a participation record.
func (*MockParticipationRegistry) GetAll ¶
func (m *MockParticipationRegistry) GetAll() []account.ParticipationRecord
GetAll of the participation records.
func (*MockParticipationRegistry) GetForRound ¶
func (m *MockParticipationRegistry) GetForRound(id account.ParticipationID, round basics.Round) (account.ParticipationRecordForRound, error)
GetForRound fetches a record with voting secrets for a particular round.
func (*MockParticipationRegistry) GetStateProofSecretsForRound ¶
func (m *MockParticipationRegistry) GetStateProofSecretsForRound(id account.ParticipationID, round basics.Round) (account.StateProofSecretsForRound, error)
GetStateProofSecretsForRound fetches a record with stateproof secrets for a particular round.
func (*MockParticipationRegistry) HasLiveKeys ¶
func (m *MockParticipationRegistry) HasLiveKeys(from, to basics.Round) bool
HasLiveKeys quickly tests to see if there is a valid participation key over some range of rounds
func (*MockParticipationRegistry) Insert ¶
func (m *MockParticipationRegistry) Insert(record account.Participation) (account.ParticipationID, error)
Insert adds a record to storage and computes the ParticipationID
func (*MockParticipationRegistry) Record ¶
func (m *MockParticipationRegistry) Record(account basics.Address, round basics.Round, participationType account.ParticipationAction) error
Record sets the Last* field for the active ParticipationID for the given account.
func (*MockParticipationRegistry) Register ¶
func (m *MockParticipationRegistry) Register(id account.ParticipationID, on basics.Round) error
Register updates the EffectiveFirst and EffectiveLast fields. If there are multiple records for the account then it is possible for multiple records to be updated.