types

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 38 Imported by: 12

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName defines the module name
	ModuleName = "btccheckpoint"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	TStoreKey = "transient_btccheckpoint"

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_btccheckpoint"

	LatestFinalizedEpochKey = "latestFinalizedEpoch"
)
View Source
const (
	DefaultBtcConfirmationDepth          uint64 = 10
	DefaultCheckpointFinalizationTimeout uint64 = 100
	DefaultCheckpointTag                        = "01020304"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default capability global index

Variables

View Source
var (
	ErrInvalidLengthBtccheckpoint        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowBtccheckpoint          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupBtccheckpoint = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidCheckpointProof            = errorsmod.Register(ModuleName, 1100, "Invalid checkpoint proof")
	ErrDuplicatedSubmission              = errorsmod.Register(ModuleName, 1101, "Duplicated submission")
	ErrNoCheckpointsForPreviousEpoch     = errorsmod.Register(ModuleName, 1102, "No checkpoints for previous epoch")
	ErrInvalidHeader                     = errorsmod.Register(ModuleName, 1103, "Proof headers are invalid")
	ErrProvidedHeaderFromDifferentForks  = errorsmod.Register(ModuleName, 1104, "Proof header from different forks")
	ErrProvidedHeaderDoesNotHaveAncestor = errorsmod.Register(ModuleName, 1105, "Proof header does not have ancestor in previous epoch")
	ErrEpochAlreadyFinalized             = errorsmod.Register(ModuleName, 1106, "Submission denied. Epoch already finalized")
)

x/btccheckpoint module sentinel errors

View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	SubmisionKeyPrefix       = []byte{3}
	EpochDataPrefix          = []byte{4}
	LastFinalizedEpochKey    = append([]byte{5}, []byte(LatestFinalizedEpochKey)...)
	BtcLightClientUpdatedKey = append([]byte{6}, []byte(btcLightClientUpdated)...)
	ParamsKey                = []byte{7}
)
View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var BtcStatus_name = map[int32]string{
	0: "EPOCH_STATUS_SUBMITTED",
	1: "EPOCH_STATUS_CONFIRMED",
	2: "EPOCH_STATUS_FINALIZED",
}
View Source
var BtcStatus_value = map[string]int32{
	"EPOCH_STATUS_SUBMITTED": 0,
	"EPOCH_STATUS_CONFIRMED": 1,
	"EPOCH_STATUS_FINALIZED": 2,
}

Functions

func CreateProofForIdx

func CreateProofForIdx(transactions [][]byte, idx uint) ([]*chainhash.Hash, error)

quite inefficiet method of calculating merkle proofs, created for testing purposes

func ExtractOpReturnData

func ExtractOpReturnData(tx *btcutil.Tx) []byte

func GetBtcLightClientUpdatedKey added in v0.6.0

func GetBtcLightClientUpdatedKey() []byte

func GetEpochIndexKey

func GetEpochIndexKey(e uint64) []byte

func GetLatestFinalizedEpochKey

func GetLatestFinalizedEpochKey() []byte

func KeyPrefix

func KeyPrefix(p string) []byte

func ParseTransaction

func ParseTransaction(bytes []byte) (*btcutil.Tx, error)

func PrefixedSubmisionKey

func PrefixedSubmisionKey(cdc codec.BinaryCodec, k *SubmissionKey) []byte

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type AccountKeeper

type AccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI
}

AccountKeeper defines the expected account keeper used for simulations (noalias)

type BTCCheckpointInfo

type BTCCheckpointInfo struct {
	// epoch number of this checkpoint
	EpochNumber uint64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"`
	// btc height of the best submission of the epoch
	BestSubmissionBtcBlockHeight uint64 `` /* 152-byte string literal not displayed */
	// hash of the btc block which determines checkpoint btc block height i.e.
	// youngest block of best submission
	BestSubmissionBtcBlockHash *github_com_babylonchain_babylon_types.BTCHeaderHashBytes `` /* 213-byte string literal not displayed */
	// the BTC checkpoint transactions of the best submission
	BestSubmissionTransactions []*TransactionInfo `` /* 141-byte string literal not displayed */
	// list of vigilantes' addresses of the best submission
	BestSubmissionVigilanteAddressList []*CheckpointAddresses `` /* 169-byte string literal not displayed */
}

BTCCheckpointInfo contains all data about best submission of checkpoint for given epoch. Best submission is the submission which is deeper in btc ledger

func (*BTCCheckpointInfo) Descriptor

func (*BTCCheckpointInfo) Descriptor() ([]byte, []int)

func (*BTCCheckpointInfo) GetBestSubmissionBtcBlockHeight added in v0.6.0

func (m *BTCCheckpointInfo) GetBestSubmissionBtcBlockHeight() uint64

func (*BTCCheckpointInfo) GetBestSubmissionTransactions added in v0.6.0

func (m *BTCCheckpointInfo) GetBestSubmissionTransactions() []*TransactionInfo

func (*BTCCheckpointInfo) GetBestSubmissionVigilanteAddressList added in v0.6.0

func (m *BTCCheckpointInfo) GetBestSubmissionVigilanteAddressList() []*CheckpointAddresses

func (*BTCCheckpointInfo) GetEpochNumber

func (m *BTCCheckpointInfo) GetEpochNumber() uint64

func (*BTCCheckpointInfo) Marshal

func (m *BTCCheckpointInfo) Marshal() (dAtA []byte, err error)

func (*BTCCheckpointInfo) MarshalTo

func (m *BTCCheckpointInfo) MarshalTo(dAtA []byte) (int, error)

func (*BTCCheckpointInfo) MarshalToSizedBuffer

func (m *BTCCheckpointInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BTCCheckpointInfo) ProtoMessage

func (*BTCCheckpointInfo) ProtoMessage()

func (*BTCCheckpointInfo) Reset

func (m *BTCCheckpointInfo) Reset()

func (*BTCCheckpointInfo) Size

func (m *BTCCheckpointInfo) Size() (n int)

func (*BTCCheckpointInfo) String

func (m *BTCCheckpointInfo) String() string

func (*BTCCheckpointInfo) Unmarshal

func (m *BTCCheckpointInfo) Unmarshal(dAtA []byte) error

func (*BTCCheckpointInfo) XXX_DiscardUnknown

func (m *BTCCheckpointInfo) XXX_DiscardUnknown()

func (*BTCCheckpointInfo) XXX_Marshal

func (m *BTCCheckpointInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BTCCheckpointInfo) XXX_Merge

func (m *BTCCheckpointInfo) XXX_Merge(src proto.Message)

func (*BTCCheckpointInfo) XXX_Size

func (m *BTCCheckpointInfo) XXX_Size() int

func (*BTCCheckpointInfo) XXX_Unmarshal

func (m *BTCCheckpointInfo) XXX_Unmarshal(b []byte) error

type BTCLightClientKeeper

type BTCLightClientKeeper interface {
	// BlockHeight should validate if header with given hash is valid and if it is
	// part of known chain. In case this is true it should return this block height
	// in case this is false it should return error
	BlockHeight(ctx sdk.Context, headerHash *bbn.BTCHeaderHashBytes) (uint64, error)

	// MainChainDepth returns the depth of the header in the main chain or -1 if it does not exist in it
	// Error is returned if header is unknown to lightclient
	MainChainDepth(ctx sdk.Context, headerBytes *bbn.BTCHeaderHashBytes) (int64, error)
}

type BTCSpvProof

type BTCSpvProof struct {
	// Valid bitcoin transaction containing OP_RETURN opcode.
	BtcTransaction []byte `protobuf:"bytes,1,opt,name=btc_transaction,json=btcTransaction,proto3" json:"btc_transaction,omitempty"`
	// Index of transaction within the block. Index is needed to determine if
	// currently hashed node is left or right.
	BtcTransactionIndex uint32 `protobuf:"varint,2,opt,name=btc_transaction_index,json=btcTransactionIndex,proto3" json:"btc_transaction_index,omitempty"`
	// List of concatenated intermediate merkle tree nodes, without root node and
	// leaf node against which we calculate the proof. Each node has 32 byte
	// length. Example proof can look like: 32_bytes_of_node1 || 32_bytes_of_node2
	// ||  32_bytes_of_node3 so the length of the proof will always be divisible
	// by 32.
	MerkleNodes []byte `protobuf:"bytes,3,opt,name=merkle_nodes,json=merkleNodes,proto3" json:"merkle_nodes,omitempty"`
	// Valid btc header which confirms btc_transaction.
	// Should have exactly 80 bytes
	ConfirmingBtcHeader *github_com_babylonchain_babylon_types.BTCHeaderBytes `` /* 184-byte string literal not displayed */
}

Consider we have a Merkle tree with following structure:

          ROOT
         /    \
    H1234      H5555
   /     \       \
 H12     H34      H55
/  \    /  \     /

H1 H2 H3 H4 H5 L1 L2 L3 L4 L5 To prove L3 was part of ROOT we need: - btc_transaction_index = 2 which in binary is 010 (where 0 means going left, 1 means going right in the tree) - merkle_nodes we'd have H4 || H12 || H5555 By looking at 010 we would know that H4 is a right sibling, H12 is left, H5555 is right again.

func NewSpvProofFromHexBytes

func NewSpvProofFromHexBytes(c codec.Codec, proof string) (*BTCSpvProof, error)

func SpvProofFromHeaderAndTransactions

func SpvProofFromHeaderAndTransactions(
	headerBytes *types.BTCHeaderBytes,
	transactions [][]byte,
	transactionIdx uint,
) (*BTCSpvProof, error)

TODO: tests and benchmarking on this function

func (*BTCSpvProof) Descriptor

func (*BTCSpvProof) Descriptor() ([]byte, []int)

func (*BTCSpvProof) GetBtcTransaction

func (m *BTCSpvProof) GetBtcTransaction() []byte

func (*BTCSpvProof) GetBtcTransactionIndex

func (m *BTCSpvProof) GetBtcTransactionIndex() uint32

func (*BTCSpvProof) GetMerkleNodes

func (m *BTCSpvProof) GetMerkleNodes() []byte

func (*BTCSpvProof) Marshal

func (m *BTCSpvProof) Marshal() (dAtA []byte, err error)

func (*BTCSpvProof) MarshalTo

func (m *BTCSpvProof) MarshalTo(dAtA []byte) (int, error)

func (*BTCSpvProof) MarshalToSizedBuffer

func (m *BTCSpvProof) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BTCSpvProof) ProtoMessage

func (*BTCSpvProof) ProtoMessage()

func (*BTCSpvProof) Reset

func (m *BTCSpvProof) Reset()

func (*BTCSpvProof) Size

func (m *BTCSpvProof) Size() (n int)

func (*BTCSpvProof) String

func (m *BTCSpvProof) String() string

func (*BTCSpvProof) Unmarshal

func (m *BTCSpvProof) Unmarshal(dAtA []byte) error

func (*BTCSpvProof) XXX_DiscardUnknown

func (m *BTCSpvProof) XXX_DiscardUnknown()

func (*BTCSpvProof) XXX_Marshal

func (m *BTCSpvProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BTCSpvProof) XXX_Merge

func (m *BTCSpvProof) XXX_Merge(src proto.Message)

func (*BTCSpvProof) XXX_Size

func (m *BTCSpvProof) XXX_Size() int

func (*BTCSpvProof) XXX_Unmarshal

func (m *BTCSpvProof) XXX_Unmarshal(b []byte) error

type BankKeeper

type BankKeeper interface {
	SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
}

BankKeeper defines the expected interface needed to retrieve account balances.

type BtcStatus

type BtcStatus int32

BtcStatus is an enum describing the current btc status of the checkpoint

const (
	// SUBMITTED Epoch has Submitted btc status if there ever was at least one
	// known submission on btc main chain
	Submitted BtcStatus = 0
	// CONFIRMED Epoch has Confirmed btc status if there ever was at least one
	// known submission on btc main chain which was k-deep
	Confirmed BtcStatus = 1
	// CONFIRMED Epoch has Finalized btc status if there is was at exactly one
	// knon submission on btc main chain which is w-deep
	Finalized BtcStatus = 2
)

func (BtcStatus) EnumDescriptor

func (BtcStatus) EnumDescriptor() ([]byte, []int)

func (BtcStatus) String

func (x BtcStatus) String() string

type CheckpointAddresses

type CheckpointAddresses struct {
	// TODO: this could probably be better typed
	// submitter is the address of the checkpoint submitter to BTC, extracted from
	// the checkpoint itself.
	Submitter []byte `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"`
	// reporter is the address of the reporter who reported the submissions,
	// calculated from submission message MsgInsertBTCSpvProof itself
	Reporter []byte `protobuf:"bytes,2,opt,name=reporter,proto3" json:"reporter,omitempty"`
}

CheckpointAddresses contains the addresses of the submitter and reporter of a given checkpoint

func (*CheckpointAddresses) Descriptor

func (*CheckpointAddresses) Descriptor() ([]byte, []int)

func (*CheckpointAddresses) GetReporter

func (m *CheckpointAddresses) GetReporter() []byte

func (*CheckpointAddresses) GetSubmitter

func (m *CheckpointAddresses) GetSubmitter() []byte

func (*CheckpointAddresses) Marshal

func (m *CheckpointAddresses) Marshal() (dAtA []byte, err error)

func (*CheckpointAddresses) MarshalTo

func (m *CheckpointAddresses) MarshalTo(dAtA []byte) (int, error)

func (*CheckpointAddresses) MarshalToSizedBuffer

func (m *CheckpointAddresses) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CheckpointAddresses) ProtoMessage

func (*CheckpointAddresses) ProtoMessage()

func (*CheckpointAddresses) Reset

func (m *CheckpointAddresses) Reset()

func (*CheckpointAddresses) Size

func (m *CheckpointAddresses) Size() (n int)

func (*CheckpointAddresses) String

func (m *CheckpointAddresses) String() string

func (*CheckpointAddresses) Unmarshal

func (m *CheckpointAddresses) Unmarshal(dAtA []byte) error

func (*CheckpointAddresses) XXX_DiscardUnknown

func (m *CheckpointAddresses) XXX_DiscardUnknown()

func (*CheckpointAddresses) XXX_Marshal

func (m *CheckpointAddresses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CheckpointAddresses) XXX_Merge

func (m *CheckpointAddresses) XXX_Merge(src proto.Message)

func (*CheckpointAddresses) XXX_Size

func (m *CheckpointAddresses) XXX_Size() int

func (*CheckpointAddresses) XXX_Unmarshal

func (m *CheckpointAddresses) XXX_Unmarshal(b []byte) error

type CheckpointingKeeper

type CheckpointingKeeper interface {
	VerifyCheckpoint(ctx sdk.Context, checkpoint txformat.RawBtcCheckpoint) error

	// SetCheckpointSubmitted informs checkpointing module that checkpoint was
	// successfully submitted on btc chain.
	SetCheckpointSubmitted(ctx sdk.Context, epoch uint64)
	// SetCheckpointConfirmed informs checkpointing module that checkpoint was
	// successfully submitted on btc chain, and it is at least K-deep on the main chain
	SetCheckpointConfirmed(ctx sdk.Context, epoch uint64)
	// SetCheckpointFinalized informs checkpointing module that checkpoint was
	// successfully submitted on btc chain, and it is at least W-deep on the main chain
	SetCheckpointFinalized(ctx sdk.Context, epoch uint64)

	// SetCheckpointForgotten informs checkpointing module that this checkpoint lost
	// all submissions on btc chain
	SetCheckpointForgotten(ctx sdk.Context, epoch uint64)
}

type EpochData

type EpochData struct {
	// List of all received checkpoints during this epoch, sorted by order of
	// submission.
	Key []*SubmissionKey `protobuf:"bytes,1,rep,name=key,proto3" json:"key,omitempty"`
	// Current btc status of the epoch
	Status BtcStatus `protobuf:"varint,2,opt,name=status,proto3,enum=babylon.btccheckpoint.v1.BtcStatus" json:"status,omitempty"`
}

Data stored in db and indexed by epoch number TODO: Add btc blockheight at epooch end, when adding hadnling of epoching callbacks

func NewEmptyEpochData

func NewEmptyEpochData() EpochData

func (*EpochData) AppendKey

func (s *EpochData) AppendKey(k SubmissionKey)

func (*EpochData) Descriptor

func (*EpochData) Descriptor() ([]byte, []int)

func (*EpochData) GetKey

func (m *EpochData) GetKey() []*SubmissionKey

func (*EpochData) GetStatus

func (m *EpochData) GetStatus() BtcStatus

func (*EpochData) Marshal

func (m *EpochData) Marshal() (dAtA []byte, err error)

func (*EpochData) MarshalTo

func (m *EpochData) MarshalTo(dAtA []byte) (int, error)

func (*EpochData) MarshalToSizedBuffer

func (m *EpochData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*EpochData) ProtoMessage

func (*EpochData) ProtoMessage()

func (*EpochData) Reset

func (m *EpochData) Reset()

func (*EpochData) Size

func (m *EpochData) Size() (n int)

func (*EpochData) String

func (m *EpochData) String() string

func (*EpochData) Unmarshal

func (m *EpochData) Unmarshal(dAtA []byte) error

func (*EpochData) XXX_DiscardUnknown

func (m *EpochData) XXX_DiscardUnknown()

func (*EpochData) XXX_Marshal

func (m *EpochData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*EpochData) XXX_Merge

func (m *EpochData) XXX_Merge(src proto.Message)

func (*EpochData) XXX_Size

func (m *EpochData) XXX_Size() int

func (*EpochData) XXX_Unmarshal

func (m *EpochData) XXX_Unmarshal(b []byte) error

type GenesisState

type GenesisState struct {
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

GenesisState defines the btccheckpoint module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Capability genesis state

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (GenesisState) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type MockBTCLightClientKeeper

type MockBTCLightClientKeeper struct {
	// contains filtered or unexported fields
}

func NewMockBTCLightClientKeeper

func NewMockBTCLightClientKeeper() *MockBTCLightClientKeeper

func (MockBTCLightClientKeeper) BlockHeight

func (mb MockBTCLightClientKeeper) BlockHeight(ctx sdk.Context, header *bbn.BTCHeaderHashBytes) (uint64, error)

func (MockBTCLightClientKeeper) MainChainDepth

func (ck MockBTCLightClientKeeper) MainChainDepth(ctx sdk.Context, headerBytes *bbn.BTCHeaderHashBytes) (int64, error)

func (*MockBTCLightClientKeeper) SetDepth

func (mc *MockBTCLightClientKeeper) SetDepth(header *bbn.BTCHeaderHashBytes, dd int64)

type MockCheckpointingKeeper

type MockCheckpointingKeeper struct {
	// contains filtered or unexported fields
}

func NewMockCheckpointingKeeper

func NewMockCheckpointingKeeper() *MockCheckpointingKeeper

func (*MockCheckpointingKeeper) ReturnError

func (mc *MockCheckpointingKeeper) ReturnError()

func (*MockCheckpointingKeeper) ReturnSuccess

func (mc *MockCheckpointingKeeper) ReturnSuccess()

func (MockCheckpointingKeeper) SetCheckpointConfirmed

func (ck MockCheckpointingKeeper) SetCheckpointConfirmed(ctx sdk.Context, epoch uint64)

SetCheckpointConfirmed Informs checkpointing module that checkpoint was successfully submitted on btc chain, and it is at least K-deep on the main chain

func (MockCheckpointingKeeper) SetCheckpointFinalized

func (ck MockCheckpointingKeeper) SetCheckpointFinalized(ctx sdk.Context, epoch uint64)

SetCheckpointFinalized Informs checkpointing module that checkpoint was successfully submitted on btc chain, and it is at least W-deep on the main chain

func (MockCheckpointingKeeper) SetCheckpointForgotten

func (ck MockCheckpointingKeeper) SetCheckpointForgotten(ctx sdk.Context, epoch uint64)

SetCheckpointForgotten Informs checkpointing module that was in submitted state lost all its checkpoints and is checkpoint empty

func (MockCheckpointingKeeper) SetCheckpointSubmitted

func (ck MockCheckpointingKeeper) SetCheckpointSubmitted(ctx sdk.Context, epoch uint64)

SetCheckpointSubmitted Informs checkpointing module that checkpoint was successfully submitted on btc chain.

func (MockCheckpointingKeeper) VerifyCheckpoint

func (ck MockCheckpointingKeeper) VerifyCheckpoint(ctx sdk.Context, checkpoint txformat.RawBtcCheckpoint) error

type MsgClient

type MsgClient interface {
	// InsertBTCSpvProof tries to insert a new checkpoint into the store.
	InsertBTCSpvProof(ctx context.Context, in *MsgInsertBTCSpvProof, opts ...grpc.CallOption) (*MsgInsertBTCSpvProofResponse, error)
	// UpdateParams updates the btccheckpoint module parameters.
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgInsertBTCSpvProof

type MsgInsertBTCSpvProof struct {
	Submitter string         `protobuf:"bytes,1,opt,name=submitter,proto3" json:"submitter,omitempty"`
	Proofs    []*BTCSpvProof `protobuf:"bytes,2,rep,name=proofs,proto3" json:"proofs,omitempty"`
}

MsgInsertBTCSpvProof defines resquest to insert a new checkpoint into the store

func (*MsgInsertBTCSpvProof) Descriptor

func (*MsgInsertBTCSpvProof) Descriptor() ([]byte, []int)

func (*MsgInsertBTCSpvProof) GetProofs

func (m *MsgInsertBTCSpvProof) GetProofs() []*BTCSpvProof

func (*MsgInsertBTCSpvProof) GetSigners

func (m *MsgInsertBTCSpvProof) GetSigners() []sdk.AccAddress

func (*MsgInsertBTCSpvProof) GetSubmitter

func (m *MsgInsertBTCSpvProof) GetSubmitter() string

func (*MsgInsertBTCSpvProof) Marshal

func (m *MsgInsertBTCSpvProof) Marshal() (dAtA []byte, err error)

func (*MsgInsertBTCSpvProof) MarshalTo

func (m *MsgInsertBTCSpvProof) MarshalTo(dAtA []byte) (int, error)

func (*MsgInsertBTCSpvProof) MarshalToSizedBuffer

func (m *MsgInsertBTCSpvProof) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgInsertBTCSpvProof) ProtoMessage

func (*MsgInsertBTCSpvProof) ProtoMessage()

func (*MsgInsertBTCSpvProof) Reset

func (m *MsgInsertBTCSpvProof) Reset()

func (*MsgInsertBTCSpvProof) Size

func (m *MsgInsertBTCSpvProof) Size() (n int)

func (*MsgInsertBTCSpvProof) String

func (m *MsgInsertBTCSpvProof) String() string

func (*MsgInsertBTCSpvProof) Unmarshal

func (m *MsgInsertBTCSpvProof) Unmarshal(dAtA []byte) error

func (*MsgInsertBTCSpvProof) ValidateBasic

func (m *MsgInsertBTCSpvProof) ValidateBasic() error

func (*MsgInsertBTCSpvProof) XXX_DiscardUnknown

func (m *MsgInsertBTCSpvProof) XXX_DiscardUnknown()

func (*MsgInsertBTCSpvProof) XXX_Marshal

func (m *MsgInsertBTCSpvProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgInsertBTCSpvProof) XXX_Merge

func (m *MsgInsertBTCSpvProof) XXX_Merge(src proto.Message)

func (*MsgInsertBTCSpvProof) XXX_Size

func (m *MsgInsertBTCSpvProof) XXX_Size() int

func (*MsgInsertBTCSpvProof) XXX_Unmarshal

func (m *MsgInsertBTCSpvProof) XXX_Unmarshal(b []byte) error

type MsgInsertBTCSpvProofResponse

type MsgInsertBTCSpvProofResponse struct {
}

MsgInsertBTCSpvProofResponse defines the response for the MsgInsertBTCSpvProof message

func (*MsgInsertBTCSpvProofResponse) Descriptor

func (*MsgInsertBTCSpvProofResponse) Descriptor() ([]byte, []int)

func (*MsgInsertBTCSpvProofResponse) Marshal

func (m *MsgInsertBTCSpvProofResponse) Marshal() (dAtA []byte, err error)

func (*MsgInsertBTCSpvProofResponse) MarshalTo

func (m *MsgInsertBTCSpvProofResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgInsertBTCSpvProofResponse) MarshalToSizedBuffer

func (m *MsgInsertBTCSpvProofResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgInsertBTCSpvProofResponse) ProtoMessage

func (*MsgInsertBTCSpvProofResponse) ProtoMessage()

func (*MsgInsertBTCSpvProofResponse) Reset

func (m *MsgInsertBTCSpvProofResponse) Reset()

func (*MsgInsertBTCSpvProofResponse) Size

func (m *MsgInsertBTCSpvProofResponse) Size() (n int)

func (*MsgInsertBTCSpvProofResponse) String

func (*MsgInsertBTCSpvProofResponse) Unmarshal

func (m *MsgInsertBTCSpvProofResponse) Unmarshal(dAtA []byte) error

func (*MsgInsertBTCSpvProofResponse) XXX_DiscardUnknown

func (m *MsgInsertBTCSpvProofResponse) XXX_DiscardUnknown()

func (*MsgInsertBTCSpvProofResponse) XXX_Marshal

func (m *MsgInsertBTCSpvProofResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgInsertBTCSpvProofResponse) XXX_Merge

func (m *MsgInsertBTCSpvProofResponse) XXX_Merge(src proto.Message)

func (*MsgInsertBTCSpvProofResponse) XXX_Size

func (m *MsgInsertBTCSpvProofResponse) XXX_Size() int

func (*MsgInsertBTCSpvProofResponse) XXX_Unmarshal

func (m *MsgInsertBTCSpvProofResponse) XXX_Unmarshal(b []byte) error

type MsgServer

type MsgServer interface {
	// InsertBTCSpvProof tries to insert a new checkpoint into the store.
	InsertBTCSpvProof(context.Context, *MsgInsertBTCSpvProof) (*MsgInsertBTCSpvProofResponse, error)
	// UpdateParams updates the btccheckpoint module parameters.
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateParams added in v0.6.0

type MsgUpdateParams struct {
	// authority is the address of the governance account.
	// just FYI: cosmos.AddressString marks that this field should use type alias
	// for AddressString instead of string, but the functionality is not yet implemented
	// in cosmos-proto
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params defines the btccheckpoint parameters to update.
	//
	// NOTE: All parameters must be supplied.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams defines a message to update the btccheckpoint module params.

func (*MsgUpdateParams) Descriptor added in v0.6.0

func (*MsgUpdateParams) Descriptor() ([]byte, []int)

func (*MsgUpdateParams) GetAuthority added in v0.6.0

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams added in v0.6.0

func (m *MsgUpdateParams) GetParams() Params

func (*MsgUpdateParams) GetSigners added in v0.6.0

func (m *MsgUpdateParams) GetSigners() []sdk.AccAddress

GetSigners returns the expected signers for a MsgUpdateParams message.

func (*MsgUpdateParams) Marshal added in v0.6.0

func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParams) MarshalTo added in v0.6.0

func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParams) MarshalToSizedBuffer added in v0.6.0

func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParams) ProtoMessage added in v0.6.0

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset added in v0.6.0

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size added in v0.6.0

func (m *MsgUpdateParams) Size() (n int)

func (*MsgUpdateParams) String added in v0.6.0

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal added in v0.6.0

func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error

func (*MsgUpdateParams) ValidateBasic added in v0.6.0

func (m *MsgUpdateParams) ValidateBasic() error

ValidateBasic does a sanity check on the provided data.

func (*MsgUpdateParams) XXX_DiscardUnknown added in v0.6.0

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal added in v0.6.0

func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParams) XXX_Merge added in v0.6.0

func (m *MsgUpdateParams) XXX_Merge(src proto.Message)

func (*MsgUpdateParams) XXX_Size added in v0.6.0

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal added in v0.6.0

func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error

type MsgUpdateParamsResponse added in v0.6.0

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response to the MsgUpdateParams message.

func (*MsgUpdateParamsResponse) Descriptor added in v0.6.0

func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int)

func (*MsgUpdateParamsResponse) Marshal added in v0.6.0

func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParamsResponse) MarshalTo added in v0.6.0

func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer added in v0.6.0

func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) ProtoMessage added in v0.6.0

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset added in v0.6.0

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size added in v0.6.0

func (m *MsgUpdateParamsResponse) Size() (n int)

func (*MsgUpdateParamsResponse) String added in v0.6.0

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal added in v0.6.0

func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown added in v0.6.0

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal added in v0.6.0

func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParamsResponse) XXX_Merge added in v0.6.0

func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message)

func (*MsgUpdateParamsResponse) XXX_Size added in v0.6.0

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal added in v0.6.0

func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error

type Params

type Params struct {
	// btc_confirmation_depth is the confirmation depth in BTC.
	// A block is considered irreversible only when it is at least k-deep in BTC
	// (k in research paper)
	BtcConfirmationDepth uint64 `` /* 154-byte string literal not displayed */
	// checkpoint_finalization_timeout is the maximum time window (measured in BTC
	// blocks) between a checkpoint
	// - being submitted to BTC, and
	// - being reported back to BBN
	// If a checkpoint has not been reported back within w BTC blocks, then BBN
	// has dishonest majority and is stalling checkpoints (w in research paper)
	CheckpointFinalizationTimeout uint64 `` /* 190-byte string literal not displayed */
	// 4byte tag in hex format, required to be present in the OP_RETURN transaction
	// related to babylon
	CheckpointTag string `protobuf:"bytes,3,opt,name=checkpoint_tag,json=checkpointTag,proto3" json:"checkpoint_tag,omitempty" yaml:"checkpoint_tag"`
}

Params defines the parameters for the module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams

func NewParams(btcConfirmationDepth uint64, checkpointFinalizationTimeout uint64, checkpointTag string) Params

NewParams creates a new Params instance

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) Equal

func (this *Params) Equal(that interface{}) bool

func (*Params) GetBtcConfirmationDepth

func (m *Params) GetBtcConfirmationDepth() uint64

func (*Params) GetCheckpointFinalizationTimeout

func (m *Params) GetCheckpointFinalizationTimeout() uint64

func (*Params) GetCheckpointTag added in v0.6.0

func (m *Params) GetCheckpointTag() string

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (Params) Validate

func (p Params) Validate() error

Validate validates the set of params

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type ParsedProof

type ParsedProof struct {
	// keeping header hash to avoid recomputing it everytime
	BlockHash        types.BTCHeaderHashBytes
	Transaction      *btcutil.Tx
	TransactionBytes []byte
	TransactionIdx   uint32
	OpReturnData     []byte
}

Parsed proof represent semantically valid: - Bitcoin Header - Bitcoin Header hash - Bitcoin Transaction - Bitcoin Transaction index in block - Non-empty OpReturnData

func ParseProof

func ParseProof(
	btcTransaction []byte,
	transactionIndex uint32,
	merkleProof []byte,
	btcHeader *types.BTCHeaderBytes,
	powLimit *big.Int) (*ParsedProof, error)

TODO define domain errors with nice error messages TODO add some tests for the proof validation

type QueryBtcCheckpointInfoRequest

type QueryBtcCheckpointInfoRequest struct {
	// Number of epoch for which the earliest checkpointing btc height is
	// requested
	EpochNum uint64 `protobuf:"varint,1,opt,name=epoch_num,json=epochNum,proto3" json:"epoch_num,omitempty"`
}

QueryBtcCheckpointInfoRequest defines the query to get the best checkpoint for a given epoch

func (*QueryBtcCheckpointInfoRequest) Descriptor

func (*QueryBtcCheckpointInfoRequest) Descriptor() ([]byte, []int)

func (*QueryBtcCheckpointInfoRequest) GetEpochNum

func (m *QueryBtcCheckpointInfoRequest) GetEpochNum() uint64

func (*QueryBtcCheckpointInfoRequest) Marshal

func (m *QueryBtcCheckpointInfoRequest) Marshal() (dAtA []byte, err error)

func (*QueryBtcCheckpointInfoRequest) MarshalTo

func (m *QueryBtcCheckpointInfoRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryBtcCheckpointInfoRequest) MarshalToSizedBuffer

func (m *QueryBtcCheckpointInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBtcCheckpointInfoRequest) ProtoMessage

func (*QueryBtcCheckpointInfoRequest) ProtoMessage()

func (*QueryBtcCheckpointInfoRequest) Reset

func (m *QueryBtcCheckpointInfoRequest) Reset()

func (*QueryBtcCheckpointInfoRequest) Size

func (m *QueryBtcCheckpointInfoRequest) Size() (n int)

func (*QueryBtcCheckpointInfoRequest) String

func (*QueryBtcCheckpointInfoRequest) Unmarshal

func (m *QueryBtcCheckpointInfoRequest) Unmarshal(dAtA []byte) error

func (*QueryBtcCheckpointInfoRequest) XXX_DiscardUnknown

func (m *QueryBtcCheckpointInfoRequest) XXX_DiscardUnknown()

func (*QueryBtcCheckpointInfoRequest) XXX_Marshal

func (m *QueryBtcCheckpointInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBtcCheckpointInfoRequest) XXX_Merge

func (m *QueryBtcCheckpointInfoRequest) XXX_Merge(src proto.Message)

func (*QueryBtcCheckpointInfoRequest) XXX_Size

func (m *QueryBtcCheckpointInfoRequest) XXX_Size() int

func (*QueryBtcCheckpointInfoRequest) XXX_Unmarshal

func (m *QueryBtcCheckpointInfoRequest) XXX_Unmarshal(b []byte) error

type QueryBtcCheckpointInfoResponse

type QueryBtcCheckpointInfoResponse struct {
	Info *BTCCheckpointInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"`
}

QueryBtcCheckpointInfoResponse is response type for the Query/BtcCheckpointInfo RPC method

func (*QueryBtcCheckpointInfoResponse) Descriptor

func (*QueryBtcCheckpointInfoResponse) Descriptor() ([]byte, []int)

func (*QueryBtcCheckpointInfoResponse) GetInfo

func (*QueryBtcCheckpointInfoResponse) Marshal

func (m *QueryBtcCheckpointInfoResponse) Marshal() (dAtA []byte, err error)

func (*QueryBtcCheckpointInfoResponse) MarshalTo

func (m *QueryBtcCheckpointInfoResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryBtcCheckpointInfoResponse) MarshalToSizedBuffer

func (m *QueryBtcCheckpointInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBtcCheckpointInfoResponse) ProtoMessage

func (*QueryBtcCheckpointInfoResponse) ProtoMessage()

func (*QueryBtcCheckpointInfoResponse) Reset

func (m *QueryBtcCheckpointInfoResponse) Reset()

func (*QueryBtcCheckpointInfoResponse) Size

func (m *QueryBtcCheckpointInfoResponse) Size() (n int)

func (*QueryBtcCheckpointInfoResponse) String

func (*QueryBtcCheckpointInfoResponse) Unmarshal

func (m *QueryBtcCheckpointInfoResponse) Unmarshal(dAtA []byte) error

func (*QueryBtcCheckpointInfoResponse) XXX_DiscardUnknown

func (m *QueryBtcCheckpointInfoResponse) XXX_DiscardUnknown()

func (*QueryBtcCheckpointInfoResponse) XXX_Marshal

func (m *QueryBtcCheckpointInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBtcCheckpointInfoResponse) XXX_Merge

func (m *QueryBtcCheckpointInfoResponse) XXX_Merge(src proto.Message)

func (*QueryBtcCheckpointInfoResponse) XXX_Size

func (m *QueryBtcCheckpointInfoResponse) XXX_Size() int

func (*QueryBtcCheckpointInfoResponse) XXX_Unmarshal

func (m *QueryBtcCheckpointInfoResponse) XXX_Unmarshal(b []byte) error

type QueryBtcCheckpointsInfoRequest

type QueryBtcCheckpointsInfoRequest struct {
	// pagination defines whether to have the pagination in the request
	Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryBtcCheckpointsInfoRequest is request type for the Query/BtcCheckpointsInfo RPC method

func (*QueryBtcCheckpointsInfoRequest) Descriptor

func (*QueryBtcCheckpointsInfoRequest) Descriptor() ([]byte, []int)

func (*QueryBtcCheckpointsInfoRequest) GetPagination

func (m *QueryBtcCheckpointsInfoRequest) GetPagination() *query.PageRequest

func (*QueryBtcCheckpointsInfoRequest) Marshal

func (m *QueryBtcCheckpointsInfoRequest) Marshal() (dAtA []byte, err error)

func (*QueryBtcCheckpointsInfoRequest) MarshalTo

func (m *QueryBtcCheckpointsInfoRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryBtcCheckpointsInfoRequest) MarshalToSizedBuffer

func (m *QueryBtcCheckpointsInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBtcCheckpointsInfoRequest) ProtoMessage

func (*QueryBtcCheckpointsInfoRequest) ProtoMessage()

func (*QueryBtcCheckpointsInfoRequest) Reset

func (m *QueryBtcCheckpointsInfoRequest) Reset()

func (*QueryBtcCheckpointsInfoRequest) Size

func (m *QueryBtcCheckpointsInfoRequest) Size() (n int)

func (*QueryBtcCheckpointsInfoRequest) String

func (*QueryBtcCheckpointsInfoRequest) Unmarshal

func (m *QueryBtcCheckpointsInfoRequest) Unmarshal(dAtA []byte) error

func (*QueryBtcCheckpointsInfoRequest) XXX_DiscardUnknown

func (m *QueryBtcCheckpointsInfoRequest) XXX_DiscardUnknown()

func (*QueryBtcCheckpointsInfoRequest) XXX_Marshal

func (m *QueryBtcCheckpointsInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBtcCheckpointsInfoRequest) XXX_Merge

func (m *QueryBtcCheckpointsInfoRequest) XXX_Merge(src proto.Message)

func (*QueryBtcCheckpointsInfoRequest) XXX_Size

func (m *QueryBtcCheckpointsInfoRequest) XXX_Size() int

func (*QueryBtcCheckpointsInfoRequest) XXX_Unmarshal

func (m *QueryBtcCheckpointsInfoRequest) XXX_Unmarshal(b []byte) error

type QueryBtcCheckpointsInfoResponse

type QueryBtcCheckpointsInfoResponse struct {
	InfoList []*BTCCheckpointInfo `protobuf:"bytes,1,rep,name=info_list,json=infoList,proto3" json:"info_list,omitempty"`
	// pagination defines the pagination in the response
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryBtcCheckpointsInfoResponse is response type for the Query/BtcCheckpointsInfo RPC method

func (*QueryBtcCheckpointsInfoResponse) Descriptor

func (*QueryBtcCheckpointsInfoResponse) Descriptor() ([]byte, []int)

func (*QueryBtcCheckpointsInfoResponse) GetInfoList

func (*QueryBtcCheckpointsInfoResponse) GetPagination

func (*QueryBtcCheckpointsInfoResponse) Marshal

func (m *QueryBtcCheckpointsInfoResponse) Marshal() (dAtA []byte, err error)

func (*QueryBtcCheckpointsInfoResponse) MarshalTo

func (m *QueryBtcCheckpointsInfoResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryBtcCheckpointsInfoResponse) MarshalToSizedBuffer

func (m *QueryBtcCheckpointsInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryBtcCheckpointsInfoResponse) ProtoMessage

func (*QueryBtcCheckpointsInfoResponse) ProtoMessage()

func (*QueryBtcCheckpointsInfoResponse) Reset

func (*QueryBtcCheckpointsInfoResponse) Size

func (m *QueryBtcCheckpointsInfoResponse) Size() (n int)

func (*QueryBtcCheckpointsInfoResponse) String

func (*QueryBtcCheckpointsInfoResponse) Unmarshal

func (m *QueryBtcCheckpointsInfoResponse) Unmarshal(dAtA []byte) error

func (*QueryBtcCheckpointsInfoResponse) XXX_DiscardUnknown

func (m *QueryBtcCheckpointsInfoResponse) XXX_DiscardUnknown()

func (*QueryBtcCheckpointsInfoResponse) XXX_Marshal

func (m *QueryBtcCheckpointsInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryBtcCheckpointsInfoResponse) XXX_Merge

func (m *QueryBtcCheckpointsInfoResponse) XXX_Merge(src proto.Message)

func (*QueryBtcCheckpointsInfoResponse) XXX_Size

func (m *QueryBtcCheckpointsInfoResponse) XXX_Size() int

func (*QueryBtcCheckpointsInfoResponse) XXX_Unmarshal

func (m *QueryBtcCheckpointsInfoResponse) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	// Parameters queries the parameters of the module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// BtcCheckpointInfo returns checkpoint info for a given epoch
	BtcCheckpointInfo(ctx context.Context, in *QueryBtcCheckpointInfoRequest, opts ...grpc.CallOption) (*QueryBtcCheckpointInfoResponse, error)
	// BtcCheckpointsInfo returns checkpoint info for a range of epochs
	BtcCheckpointsInfo(ctx context.Context, in *QueryBtcCheckpointsInfoRequest, opts ...grpc.CallOption) (*QueryBtcCheckpointsInfoResponse, error)
	// EpochSubmissions returns all submissions for a given epoch
	EpochSubmissions(ctx context.Context, in *QueryEpochSubmissionsRequest, opts ...grpc.CallOption) (*QueryEpochSubmissionsResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryEpochSubmissionsRequest

type QueryEpochSubmissionsRequest struct {
	// Number of epoch for which submissions are requested
	EpochNum   uint64             `protobuf:"varint,1,opt,name=epoch_num,json=epochNum,proto3" json:"epoch_num,omitempty"`
	Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryEpochSubmissionsRequest defines a request to get all submissions in given epoch

func (*QueryEpochSubmissionsRequest) Descriptor

func (*QueryEpochSubmissionsRequest) Descriptor() ([]byte, []int)

func (*QueryEpochSubmissionsRequest) GetEpochNum

func (m *QueryEpochSubmissionsRequest) GetEpochNum() uint64

func (*QueryEpochSubmissionsRequest) GetPagination

func (m *QueryEpochSubmissionsRequest) GetPagination() *query.PageRequest

func (*QueryEpochSubmissionsRequest) Marshal

func (m *QueryEpochSubmissionsRequest) Marshal() (dAtA []byte, err error)

func (*QueryEpochSubmissionsRequest) MarshalTo

func (m *QueryEpochSubmissionsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryEpochSubmissionsRequest) MarshalToSizedBuffer

func (m *QueryEpochSubmissionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryEpochSubmissionsRequest) ProtoMessage

func (*QueryEpochSubmissionsRequest) ProtoMessage()

func (*QueryEpochSubmissionsRequest) Reset

func (m *QueryEpochSubmissionsRequest) Reset()

func (*QueryEpochSubmissionsRequest) Size

func (m *QueryEpochSubmissionsRequest) Size() (n int)

func (*QueryEpochSubmissionsRequest) String

func (*QueryEpochSubmissionsRequest) Unmarshal

func (m *QueryEpochSubmissionsRequest) Unmarshal(dAtA []byte) error

func (*QueryEpochSubmissionsRequest) XXX_DiscardUnknown

func (m *QueryEpochSubmissionsRequest) XXX_DiscardUnknown()

func (*QueryEpochSubmissionsRequest) XXX_Marshal

func (m *QueryEpochSubmissionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryEpochSubmissionsRequest) XXX_Merge

func (m *QueryEpochSubmissionsRequest) XXX_Merge(src proto.Message)

func (*QueryEpochSubmissionsRequest) XXX_Size

func (m *QueryEpochSubmissionsRequest) XXX_Size() int

func (*QueryEpochSubmissionsRequest) XXX_Unmarshal

func (m *QueryEpochSubmissionsRequest) XXX_Unmarshal(b []byte) error

type QueryEpochSubmissionsResponse

type QueryEpochSubmissionsResponse struct {
	// All submissions saved during an epoch.
	Keys       []*SubmissionKey    `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
	Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
}

QueryEpochSubmissionsResponse defines a response to get all submissions in given epoch (QueryEpochSubmissionsRequest)

func (*QueryEpochSubmissionsResponse) Descriptor

func (*QueryEpochSubmissionsResponse) Descriptor() ([]byte, []int)

func (*QueryEpochSubmissionsResponse) GetKeys

func (*QueryEpochSubmissionsResponse) GetPagination

func (m *QueryEpochSubmissionsResponse) GetPagination() *query.PageResponse

func (*QueryEpochSubmissionsResponse) Marshal

func (m *QueryEpochSubmissionsResponse) Marshal() (dAtA []byte, err error)

func (*QueryEpochSubmissionsResponse) MarshalTo

func (m *QueryEpochSubmissionsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryEpochSubmissionsResponse) MarshalToSizedBuffer

func (m *QueryEpochSubmissionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryEpochSubmissionsResponse) ProtoMessage

func (*QueryEpochSubmissionsResponse) ProtoMessage()

func (*QueryEpochSubmissionsResponse) Reset

func (m *QueryEpochSubmissionsResponse) Reset()

func (*QueryEpochSubmissionsResponse) Size

func (m *QueryEpochSubmissionsResponse) Size() (n int)

func (*QueryEpochSubmissionsResponse) String

func (*QueryEpochSubmissionsResponse) Unmarshal

func (m *QueryEpochSubmissionsResponse) Unmarshal(dAtA []byte) error

func (*QueryEpochSubmissionsResponse) XXX_DiscardUnknown

func (m *QueryEpochSubmissionsResponse) XXX_DiscardUnknown()

func (*QueryEpochSubmissionsResponse) XXX_Marshal

func (m *QueryEpochSubmissionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryEpochSubmissionsResponse) XXX_Merge

func (m *QueryEpochSubmissionsResponse) XXX_Merge(src proto.Message)

func (*QueryEpochSubmissionsResponse) XXX_Size

func (m *QueryEpochSubmissionsResponse) XXX_Size() int

func (*QueryEpochSubmissionsResponse) XXX_Unmarshal

func (m *QueryEpochSubmissionsResponse) XXX_Unmarshal(b []byte) error

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	// params holds all the parameters of this module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Parameters queries the parameters of the module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// BtcCheckpointInfo returns checkpoint info for a given epoch
	BtcCheckpointInfo(context.Context, *QueryBtcCheckpointInfoRequest) (*QueryBtcCheckpointInfoResponse, error)
	// BtcCheckpointsInfo returns checkpoint info for a range of epochs
	BtcCheckpointsInfo(context.Context, *QueryBtcCheckpointsInfoRequest) (*QueryBtcCheckpointsInfoResponse, error)
	// EpochSubmissions returns all submissions for a given epoch
	EpochSubmissions(context.Context, *QueryEpochSubmissionsRequest) (*QueryEpochSubmissionsResponse, error)
}

QueryServer is the server API for Query service.

type RawCheckpointSubmission

type RawCheckpointSubmission struct {
	Reporter       sdk.AccAddress
	Proof1         ParsedProof
	Proof2         ParsedProof
	CheckpointData btctxformatter.RawBtcCheckpoint
}

Semantically valid checkpoint submission with: - valid submitter address - at least 2 parsed proof Modelling proofs as separate Proof1 and Proof2, as this is more explicit than []*ParsedProof.

func ParseSubmission

func ParseSubmission(
	m *MsgInsertBTCSpvProof,
	powLimit *big.Int,
	expectedTag txformat.BabylonTag) (*RawCheckpointSubmission, error)

func ParseTwoProofs

func ParseTwoProofs(
	submitter sdk.AccAddress,
	proofs []*BTCSpvProof,
	powLimit *big.Int,
	expectedTag txformat.BabylonTag) (*RawCheckpointSubmission, error)

Parse and Validate transactions which should contain OP_RETURN data. OP_RETURN bytes are not validated in any way. It is up to the caller attach semantic meaning and validity to those bytes. Returned ParsedProofs are in same order as raw proofs

func (*RawCheckpointSubmission) GetFirstBlockHash

func (s *RawCheckpointSubmission) GetFirstBlockHash() types.BTCHeaderHashBytes

func (*RawCheckpointSubmission) GetProofs

func (s *RawCheckpointSubmission) GetProofs() []*ParsedProof

func (*RawCheckpointSubmission) GetSecondBlockHash

func (s *RawCheckpointSubmission) GetSecondBlockHash() types.BTCHeaderHashBytes

func (*RawCheckpointSubmission) GetSubmissionData

func (rsc *RawCheckpointSubmission) GetSubmissionData(epochNum uint64, txsInfo []*TransactionInfo) SubmissionData

func (*RawCheckpointSubmission) GetSubmissionKey

func (rsc *RawCheckpointSubmission) GetSubmissionKey() SubmissionKey

func (*RawCheckpointSubmission) InOneBlock

func (s *RawCheckpointSubmission) InOneBlock() bool

type SubmissionBtcInfo

type SubmissionBtcInfo struct {
	SubmissionKey SubmissionKey
	// Depth of the oldest btc header of the submission
	OldestBlockDepth uint64

	// Depth of the youngest btc header of the submission
	YoungestBlockDepth uint64

	// Hash of the youngest btc header of the submission
	YoungestBlockHash types.BTCHeaderHashBytes

	// Index of the lowest index transaction in youngest submission block
	YoungestBlockLowestTxIdx uint32
}

SubmissionBtcInfo encapsualte important information about submission posistion on btc ledger

func (*SubmissionBtcInfo) HappenedAfter

func (submission *SubmissionBtcInfo) HappenedAfter(parentEpochSubmission *SubmissionBtcInfo) bool

HappenedAfter returns true if `this` submission happened after `that` submission

func (*SubmissionBtcInfo) IsBetterThan

func (newSubmission *SubmissionBtcInfo) IsBetterThan(currentBestSubmission *SubmissionBtcInfo) bool

func (*SubmissionBtcInfo) SubmissionDepth

func (submission *SubmissionBtcInfo) SubmissionDepth() uint64

SubmissionDepth return depth of the submission. Due to the fact that submissions are splitted between several btc blocks, in Babylon subbmission depth is the depth of the youngest btc block

type SubmissionData

type SubmissionData struct {
	// address of the submitter and reporter
	VigilanteAddresses *CheckpointAddresses `protobuf:"bytes,1,opt,name=vigilante_addresses,json=vigilanteAddresses,proto3" json:"vigilante_addresses,omitempty"`
	// txs_info is the two `TransactionInfo`s corresponding to the submission
	// It is used for
	// - recovering address of sender of btc transction to payup the reward.
	// - allowing the ZoneConcierge module to prove the checkpoint is submitted to
	// BTC
	TxsInfo []*TransactionInfo `protobuf:"bytes,2,rep,name=txs_info,json=txsInfo,proto3" json:"txs_info,omitempty"`
	Epoch   uint64             `protobuf:"varint,3,opt,name=epoch,proto3" json:"epoch,omitempty"`
}

TODO: Determine if we should keep any block number or depth info. On one hand it may be usefull to determine if block is stable or not, on other depth/block number info, without context (i.e info about chain) is pretty useless and blockshash in enough to retrieve is from lightclient

func (*SubmissionData) Descriptor

func (*SubmissionData) Descriptor() ([]byte, []int)

func (*SubmissionData) GetEpoch

func (m *SubmissionData) GetEpoch() uint64

func (*SubmissionData) GetTxsInfo

func (m *SubmissionData) GetTxsInfo() []*TransactionInfo

func (*SubmissionData) GetVigilanteAddresses

func (m *SubmissionData) GetVigilanteAddresses() *CheckpointAddresses

func (*SubmissionData) Marshal

func (m *SubmissionData) Marshal() (dAtA []byte, err error)

func (*SubmissionData) MarshalTo

func (m *SubmissionData) MarshalTo(dAtA []byte) (int, error)

func (*SubmissionData) MarshalToSizedBuffer

func (m *SubmissionData) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SubmissionData) ProtoMessage

func (*SubmissionData) ProtoMessage()

func (*SubmissionData) Reset

func (m *SubmissionData) Reset()

func (*SubmissionData) Size

func (m *SubmissionData) Size() (n int)

func (*SubmissionData) String

func (m *SubmissionData) String() string

func (*SubmissionData) Unmarshal

func (m *SubmissionData) Unmarshal(dAtA []byte) error

func (*SubmissionData) XXX_DiscardUnknown

func (m *SubmissionData) XXX_DiscardUnknown()

func (*SubmissionData) XXX_Marshal

func (m *SubmissionData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubmissionData) XXX_Merge

func (m *SubmissionData) XXX_Merge(src proto.Message)

func (*SubmissionData) XXX_Size

func (m *SubmissionData) XXX_Size() int

func (*SubmissionData) XXX_Unmarshal

func (m *SubmissionData) XXX_Unmarshal(b []byte) error

type SubmissionKey

type SubmissionKey struct {
	Key []*TransactionKey `protobuf:"bytes,1,rep,name=key,proto3" json:"key,omitempty"`
}

Checkpoint can be composed from multiple transactions, so to identify whole submission we need list of transaction keys. Each submission can generally be identified by this list of (txIdx, blockHash) tuples. Note: this could possibly be optimized as if transactions were in one block they would have the same block hash and different indexes, but each blockhash is only 33 (1 byte for prefix encoding and 32 byte hash), so there should be other strong arguments for this optimization

func (*SubmissionKey) Descriptor

func (*SubmissionKey) Descriptor() ([]byte, []int)

func (*SubmissionKey) GetKey

func (m *SubmissionKey) GetKey() []*TransactionKey

func (*SubmissionKey) GetKeyBlockHashes

func (sk *SubmissionKey) GetKeyBlockHashes() []*types.BTCHeaderHashBytes

func (*SubmissionKey) Marshal

func (m *SubmissionKey) Marshal() (dAtA []byte, err error)

func (*SubmissionKey) MarshalTo

func (m *SubmissionKey) MarshalTo(dAtA []byte) (int, error)

func (*SubmissionKey) MarshalToSizedBuffer

func (m *SubmissionKey) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SubmissionKey) ProtoMessage

func (*SubmissionKey) ProtoMessage()

func (*SubmissionKey) Reset

func (m *SubmissionKey) Reset()

func (*SubmissionKey) Size

func (m *SubmissionKey) Size() (n int)

func (*SubmissionKey) String

func (m *SubmissionKey) String() string

func (*SubmissionKey) Unmarshal

func (m *SubmissionKey) Unmarshal(dAtA []byte) error

func (*SubmissionKey) XXX_DiscardUnknown

func (m *SubmissionKey) XXX_DiscardUnknown()

func (*SubmissionKey) XXX_Marshal

func (m *SubmissionKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SubmissionKey) XXX_Merge

func (m *SubmissionKey) XXX_Merge(src proto.Message)

func (*SubmissionKey) XXX_Size

func (m *SubmissionKey) XXX_Size() int

func (*SubmissionKey) XXX_Unmarshal

func (m *SubmissionKey) XXX_Unmarshal(b []byte) error

type TransactionInfo

type TransactionInfo struct {
	// key is the position (txIdx, blockHash) of this tx on BTC blockchain
	// Although it is already a part of SubmissionKey, we store it here again
	// to make TransactionInfo self-contained.
	// For example, storing the key allows TransactionInfo to not relay on
	// the fact that TransactionInfo will be ordered in the same order as
	// TransactionKeys in SubmissionKey.
	Key *TransactionKey `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// transaction is the full transaction in bytes
	Transaction []byte `protobuf:"bytes,2,opt,name=transaction,proto3" json:"transaction,omitempty"`
	// proof is the Merkle proof that this tx is included in the position in `key`
	// TODO: maybe it could use here better format as we already processed and
	// valideated the proof?
	Proof []byte `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"`
}

TransactionInfo is the info of a tx that contains Babylon checkpoint, including - the position of the tx on BTC blockchain - the full tx content - the Merkle proof that this tx is on the above position

func NewTransactionInfo

func NewTransactionInfo(txKey *TransactionKey, txBytes []byte, proof []byte) *TransactionInfo

func (*TransactionInfo) Descriptor

func (*TransactionInfo) Descriptor() ([]byte, []int)

func (*TransactionInfo) GetKey

func (m *TransactionInfo) GetKey() *TransactionKey

func (*TransactionInfo) GetProof

func (m *TransactionInfo) GetProof() []byte

func (*TransactionInfo) GetTransaction

func (m *TransactionInfo) GetTransaction() []byte

func (*TransactionInfo) Marshal

func (m *TransactionInfo) Marshal() (dAtA []byte, err error)

func (*TransactionInfo) MarshalTo

func (m *TransactionInfo) MarshalTo(dAtA []byte) (int, error)

func (*TransactionInfo) MarshalToSizedBuffer

func (m *TransactionInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TransactionInfo) ProtoMessage

func (*TransactionInfo) ProtoMessage()

func (*TransactionInfo) Reset

func (m *TransactionInfo) Reset()

func (*TransactionInfo) Size

func (m *TransactionInfo) Size() (n int)

func (*TransactionInfo) String

func (m *TransactionInfo) String() string

func (*TransactionInfo) Unmarshal

func (m *TransactionInfo) Unmarshal(dAtA []byte) error

func (*TransactionInfo) ValidateBasic

func (ti *TransactionInfo) ValidateBasic() error

func (*TransactionInfo) XXX_DiscardUnknown

func (m *TransactionInfo) XXX_DiscardUnknown()

func (*TransactionInfo) XXX_Marshal

func (m *TransactionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransactionInfo) XXX_Merge

func (m *TransactionInfo) XXX_Merge(src proto.Message)

func (*TransactionInfo) XXX_Size

func (m *TransactionInfo) XXX_Size() int

func (*TransactionInfo) XXX_Unmarshal

func (m *TransactionInfo) XXX_Unmarshal(b []byte) error

type TransactionKey

type TransactionKey struct {
	Index uint32                                                    `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	Hash  *github_com_babylonchain_babylon_types.BTCHeaderHashBytes `` /* 129-byte string literal not displayed */
}

Each provided OP_RETURN transaction can be idendtified by hash of block in which transaction was included and transaction index in the block

func (*TransactionKey) Descriptor

func (*TransactionKey) Descriptor() ([]byte, []int)

func (*TransactionKey) GetIndex

func (m *TransactionKey) GetIndex() uint32

func (*TransactionKey) Marshal

func (m *TransactionKey) Marshal() (dAtA []byte, err error)

func (*TransactionKey) MarshalTo

func (m *TransactionKey) MarshalTo(dAtA []byte) (int, error)

func (*TransactionKey) MarshalToSizedBuffer

func (m *TransactionKey) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TransactionKey) ProtoMessage

func (*TransactionKey) ProtoMessage()

func (*TransactionKey) Reset

func (m *TransactionKey) Reset()

func (*TransactionKey) Size

func (m *TransactionKey) Size() (n int)

func (*TransactionKey) String

func (m *TransactionKey) String() string

func (*TransactionKey) Unmarshal

func (m *TransactionKey) Unmarshal(dAtA []byte) error

func (*TransactionKey) XXX_DiscardUnknown

func (m *TransactionKey) XXX_DiscardUnknown()

func (*TransactionKey) XXX_Marshal

func (m *TransactionKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TransactionKey) XXX_Merge

func (m *TransactionKey) XXX_Merge(src proto.Message)

func (*TransactionKey) XXX_Size

func (m *TransactionKey) XXX_Size() int

func (*TransactionKey) XXX_Unmarshal

func (m *TransactionKey) XXX_Unmarshal(b []byte) error

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) InsertBTCSpvProof

func (*UnimplementedMsgServer) UpdateParams added in v0.6.0

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) BtcCheckpointInfo

func (*UnimplementedQueryServer) BtcCheckpointsInfo

func (*UnimplementedQueryServer) EpochSubmissions

func (*UnimplementedQueryServer) Params

Jump to

Keyboard shortcuts

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