mocks

package
v0.0.0-...-15eb78e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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)) (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

GetState returns the current state of the catchpoint catchup

func (*MockCatchpointCatchupAccessor) ProgressStagingBalances

func (m *MockCatchpointCatchupAccessor) ProgressStagingBalances(ctx context.Context, sectionName string, bytes []byte, progress *ledger.CatchpointCatchupAccessorProgress) (err error)

ProgressStagingBalances 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

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) (err error)

StoreBlock stores a single block to the blocks database.

func (*MockCatchpointCatchupAccessor) StoreFirstBlock

func (m *MockCatchpointCatchupAccessor) StoreFirstBlock(ctx context.Context, blk *bookkeeping.Block) (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
}

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) Disconnect

func (network *MockNetwork) Disconnect(badpeer network.Peer)

Disconnect - unused function

func (*MockNetwork) DisconnectPeers

func (network *MockNetwork) DisconnectPeers()

DisconnectPeers - unused function

func (*MockNetwork) GetHTTPRequestConnection

func (network *MockNetwork) GetHTTPRequestConnection(request *http.Request) (conn net.Conn)

GetHTTPRequestConnection - empty implementation

func (*MockNetwork) GetPeers

func (network *MockNetwork) GetPeers(options ...network.PeerOption) []network.Peer

GetPeers - unused function

func (*MockNetwork) GetRoundTripper

func (network *MockNetwork) GetRoundTripper() http.RoundTripper

GetRoundTripper -- returns the network round tripper

func (*MockNetwork) OnNetworkAdvance

func (network *MockNetwork) OnNetworkAdvance()

OnNetworkAdvance - empty implementation

func (*MockNetwork) Ready

func (network *MockNetwork) Ready() chan struct{}

Ready - always ready

func (*MockNetwork) RegisterHTTPHandler

func (network *MockNetwork) RegisterHTTPHandler(path string, handler http.Handler)

RegisterHTTPHandler - 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) 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

func (*MockNetwork) Start

func (network *MockNetwork) Start()

Start - unused function

func (*MockNetwork) Stop

func (network *MockNetwork) Stop()

Stop - unused function

func (*MockNetwork) SubstituteGenesisID

func (network *MockNetwork) SubstituteGenesisID(rawURL string) string

SubstituteGenesisID - empty implementation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL