Documentation ¶
Index ¶
- func NewHandler(keeper Keeper) sdk.Handler
- func NewQuerier(keeper Keeper) sdk.Querier
- type Keeper
- func (k Keeper) FindAncestor(ctx sdk.Context, digestLE types.Hash256Digest, offset uint32) (types.Hash256Digest, sdk.Error)
- func (k Keeper) GetBestKnownDigest(ctx sdk.Context) (types.Hash256Digest, sdk.Error)
- func (k Keeper) GetHeader(ctx sdk.Context, digestLE types.Hash256Digest) (types.BitcoinHeader, sdk.Error)
- func (k Keeper) GetLastReorgLCA(ctx sdk.Context) (types.Hash256Digest, sdk.Error)
- func (k Keeper) GetRelayGenesis(ctx sdk.Context) (types.Hash256Digest, sdk.Error)
- func (k Keeper) HasHeader(ctx sdk.Context, digestLE types.Hash256Digest) bool
- func (k Keeper) HeaviestFromAncestor(ctx sdk.Context, ancestor, currentBest, newBest types.Hash256Digest, ...) (types.Hash256Digest, sdk.Error)
- func (k Keeper) IngestDifficultyChange(ctx sdk.Context, prevEpochStartLE types.Hash256Digest, ...) sdk.Error
- func (k Keeper) IngestHeaderChain(ctx sdk.Context, headers []types.BitcoinHeader) sdk.Error
- func (k Keeper) IsAncestor(ctx sdk.Context, digestLE, ancestor types.Hash256Digest, limit uint32) bool
- func (k Keeper) IsMostRecentCommonAncestor(ctx sdk.Context, ancestor, left, right types.Hash256Digest, limit uint32) bool
- func (k Keeper) MarkNewHeaviest(ctx sdk.Context, ancestor types.Hash256Digest, ...) sdk.Error
- func (k Keeper) SetGenesisState(ctx sdk.Context, genesis, epochStart btcspv.BitcoinHeader) sdk.Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
NewHandler returns a handler for relay type messages.
func NewQuerier ¶
NewQuerier makes a query routing function
Types ¶
type Keeper ¶
type Keeper struct { IsMainNet bool ProofHandler types.ProofHandler // contains filtered or unexported fields }
Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine
func NewKeeper ¶
func NewKeeper(storeKey sdk.StoreKey, cdc *codec.Codec, mainnet bool, handler types.ProofHandler) Keeper
NewKeeper instantiates a new keeper
func (Keeper) FindAncestor ¶
func (k Keeper) FindAncestor(ctx sdk.Context, digestLE types.Hash256Digest, offset uint32) (types.Hash256Digest, sdk.Error)
FindAncestor finds the nth ancestor of some digest
func (Keeper) GetBestKnownDigest ¶
GetBestKnownDigest returns the best known digest in the relay
func (Keeper) GetHeader ¶
func (k Keeper) GetHeader(ctx sdk.Context, digestLE types.Hash256Digest) (types.BitcoinHeader, sdk.Error)
GetHeader retrieves a header from the store using its LE diges
func (Keeper) GetLastReorgLCA ¶
GetLastReorgLCA returns the best known digest in the relay
func (Keeper) GetRelayGenesis ¶
GetRelayGenesis returns the first digest in the relay
func (Keeper) HeaviestFromAncestor ¶
func (k Keeper) HeaviestFromAncestor(ctx sdk.Context, ancestor, currentBest, newBest types.Hash256Digest, limit uint32) (types.Hash256Digest, sdk.Error)
HeaviestFromAncestor determines the heavier descendant of a common ancestor
func (Keeper) IngestDifficultyChange ¶
func (k Keeper) IngestDifficultyChange(ctx sdk.Context, prevEpochStartLE types.Hash256Digest, headers []types.BitcoinHeader) sdk.Error
IngestDifficultyChange ingests a chain of headers
func (Keeper) IngestHeaderChain ¶
IngestHeaderChain ingests a chain of headers
func (Keeper) IsAncestor ¶
func (k Keeper) IsAncestor(ctx sdk.Context, digestLE, ancestor types.Hash256Digest, limit uint32) bool
IsAncestor checks if there is a link between an ancestor and header
func (Keeper) IsMostRecentCommonAncestor ¶
func (k Keeper) IsMostRecentCommonAncestor(ctx sdk.Context, ancestor, left, right types.Hash256Digest, limit uint32) bool
IsMostRecentCommonAncestor checks if a proposed ancestor is the LCA of two digests
func (Keeper) MarkNewHeaviest ¶
func (k Keeper) MarkNewHeaviest(ctx sdk.Context, ancestor types.Hash256Digest, currentBest, newBest types.RawHeader, limit uint32) sdk.Error
MarkNewHeaviest updates the best known digest and LCA
func (Keeper) SetGenesisState ¶
func (k Keeper) SetGenesisState(ctx sdk.Context, genesis, epochStart btcspv.BitcoinHeader) sdk.Error
SetGenesisState sets the genesis state