Documentation ¶
Index ¶
- Variables
- func IsErrorInvalidProof(err error) bool
- func ValidateBitcoinHeader(headerBytes []byte, blockHash []byte, chainID int64) error
- type BlockHeader
- func (*BlockHeader) Descriptor() ([]byte, []int)
- func (m *BlockHeader) GetChainId() int64
- func (m *BlockHeader) GetHash() []byte
- func (m *BlockHeader) GetHeader() HeaderData
- func (m *BlockHeader) GetHeight() int64
- func (m *BlockHeader) GetParentHash() []byte
- func (m *BlockHeader) Marshal() (dAtA []byte, err error)
- func (m *BlockHeader) MarshalTo(dAtA []byte) (int, error)
- func (m *BlockHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*BlockHeader) ProtoMessage()
- func (m *BlockHeader) Reset()
- func (m *BlockHeader) Size() (n int)
- func (m *BlockHeader) String() string
- func (m *BlockHeader) Unmarshal(dAtA []byte) error
- func (m *BlockHeader) XXX_DiscardUnknown()
- func (m *BlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BlockHeader) XXX_Merge(src proto.Message)
- func (m *BlockHeader) XXX_Size() int
- func (m *BlockHeader) XXX_Unmarshal(b []byte) error
- type ErrInvalidProof
- type HeaderData
- func (*HeaderData) Descriptor() ([]byte, []int)
- func (m *HeaderData) GetBitcoinHeader() []byte
- func (m *HeaderData) GetData() isHeaderData_Data
- func (m *HeaderData) GetEthereumHeader() []byte
- func (m *HeaderData) Marshal() (dAtA []byte, err error)
- func (m *HeaderData) MarshalTo(dAtA []byte) (int, error)
- func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (h HeaderData) ParentHash() ([]byte, error)
- func (*HeaderData) ProtoMessage()
- func (m *HeaderData) Reset()
- func (m *HeaderData) Size() (n int)
- func (m *HeaderData) String() string
- func (m *HeaderData) Unmarshal(dAtA []byte) error
- func (h HeaderData) Validate(blockHash []byte, chainID int64, height int64) error
- func (h HeaderData) ValidateTimestamp(zetaTime time.Time) error
- func (m *HeaderData) XXX_DiscardUnknown()
- func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *HeaderData) XXX_Merge(src proto.Message)
- func (*HeaderData) XXX_OneofWrappers() []interface{}
- func (m *HeaderData) XXX_Size() int
- func (m *HeaderData) XXX_Unmarshal(b []byte) error
- type HeaderData_BitcoinHeader
- type HeaderData_EthereumHeader
- type Proof
- func (*Proof) Descriptor() ([]byte, []int)
- func (m *Proof) GetBitcoinProof() *bitcoin.Proof
- func (m *Proof) GetEthereumProof() *ethereum.Proof
- func (m *Proof) GetProof() isProof_Proof
- func (m *Proof) Marshal() (dAtA []byte, err error)
- func (m *Proof) MarshalTo(dAtA []byte) (int, error)
- func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Proof) ProtoMessage()
- func (m *Proof) Reset()
- func (m *Proof) Size() (n int)
- func (m *Proof) String() string
- func (m *Proof) Unmarshal(dAtA []byte) error
- func (p Proof) Verify(headerData HeaderData, txIndex int) ([]byte, error)
- func (m *Proof) XXX_DiscardUnknown()
- func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Proof) XXX_Merge(src proto.Message)
- func (*Proof) XXX_OneofWrappers() []interface{}
- func (m *Proof) XXX_Size() int
- func (m *Proof) XXX_Unmarshal(b []byte) error
- type Proof_BitcoinProof
- type Proof_EthereumProof
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func IsErrorInvalidProof ¶
IsErrorInvalidProof returns true if the error is an ErrInvalidProof
Types ¶
type BlockHeader ¶
type BlockHeader struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` ParentHash []byte `protobuf:"bytes,3,opt,name=parent_hash,json=parentHash,proto3" json:"parent_hash,omitempty"` ChainId int64 `protobuf:"varint,4,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` // chain specific header Header HeaderData `protobuf:"bytes,5,opt,name=header,proto3" json:"header"` }
func (*BlockHeader) Descriptor ¶
func (*BlockHeader) Descriptor() ([]byte, []int)
func (*BlockHeader) GetChainId ¶
func (m *BlockHeader) GetChainId() int64
func (*BlockHeader) GetHash ¶
func (m *BlockHeader) GetHash() []byte
func (*BlockHeader) GetHeader ¶
func (m *BlockHeader) GetHeader() HeaderData
func (*BlockHeader) GetHeight ¶
func (m *BlockHeader) GetHeight() int64
func (*BlockHeader) GetParentHash ¶
func (m *BlockHeader) GetParentHash() []byte
func (*BlockHeader) Marshal ¶
func (m *BlockHeader) Marshal() (dAtA []byte, err error)
func (*BlockHeader) MarshalToSizedBuffer ¶
func (m *BlockHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*BlockHeader) ProtoMessage ¶
func (*BlockHeader) ProtoMessage()
func (*BlockHeader) Reset ¶
func (m *BlockHeader) Reset()
func (*BlockHeader) Size ¶
func (m *BlockHeader) Size() (n int)
func (*BlockHeader) String ¶
func (m *BlockHeader) String() string
func (*BlockHeader) Unmarshal ¶
func (m *BlockHeader) Unmarshal(dAtA []byte) error
func (*BlockHeader) XXX_DiscardUnknown ¶
func (m *BlockHeader) XXX_DiscardUnknown()
func (*BlockHeader) XXX_Marshal ¶
func (m *BlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BlockHeader) XXX_Merge ¶
func (m *BlockHeader) XXX_Merge(src proto.Message)
func (*BlockHeader) XXX_Size ¶
func (m *BlockHeader) XXX_Size() int
func (*BlockHeader) XXX_Unmarshal ¶
func (m *BlockHeader) XXX_Unmarshal(b []byte) error
type ErrInvalidProof ¶
type ErrInvalidProof struct {
Err error
}
ErrInvalidProof is a error type for invalid proofs embedding the underlying error
func NewErrInvalidProof ¶
func NewErrInvalidProof(err error) ErrInvalidProof
func (ErrInvalidProof) Error ¶
func (e ErrInvalidProof) Error() string
type HeaderData ¶
type HeaderData struct { // Types that are valid to be assigned to Data: // // *HeaderData_EthereumHeader // *HeaderData_BitcoinHeader Data isHeaderData_Data `protobuf_oneof:"data"` }
func NewBitcoinHeader ¶
func NewBitcoinHeader(header []byte) HeaderData
NewBitcoinHeader returns a new HeaderData containing a Bitcoin header
func NewEthereumHeader ¶
func NewEthereumHeader(header []byte) HeaderData
NewEthereumHeader returns a new HeaderData containing an Ethereum header
func (*HeaderData) Descriptor ¶
func (*HeaderData) Descriptor() ([]byte, []int)
func (*HeaderData) GetBitcoinHeader ¶
func (m *HeaderData) GetBitcoinHeader() []byte
func (*HeaderData) GetData ¶
func (m *HeaderData) GetData() isHeaderData_Data
func (*HeaderData) GetEthereumHeader ¶
func (m *HeaderData) GetEthereumHeader() []byte
func (*HeaderData) Marshal ¶
func (m *HeaderData) Marshal() (dAtA []byte, err error)
func (*HeaderData) MarshalToSizedBuffer ¶
func (m *HeaderData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (HeaderData) ParentHash ¶
func (h HeaderData) ParentHash() ([]byte, error)
ParentHash extracts the parent hash from the header
func (*HeaderData) ProtoMessage ¶
func (*HeaderData) ProtoMessage()
func (*HeaderData) Reset ¶
func (m *HeaderData) Reset()
func (*HeaderData) Size ¶
func (m *HeaderData) Size() (n int)
func (*HeaderData) String ¶
func (m *HeaderData) String() string
func (*HeaderData) Unmarshal ¶
func (m *HeaderData) Unmarshal(dAtA []byte) error
func (HeaderData) Validate ¶
func (h HeaderData) Validate(blockHash []byte, chainID int64, height int64) error
Validate performs a basic validation of the HeaderData
func (HeaderData) ValidateTimestamp ¶
func (h HeaderData) ValidateTimestamp(zetaTime time.Time) error
func (*HeaderData) XXX_DiscardUnknown ¶
func (m *HeaderData) XXX_DiscardUnknown()
func (*HeaderData) XXX_Marshal ¶
func (m *HeaderData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HeaderData) XXX_Merge ¶
func (m *HeaderData) XXX_Merge(src proto.Message)
func (*HeaderData) XXX_OneofWrappers ¶
func (*HeaderData) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*HeaderData) XXX_Size ¶
func (m *HeaderData) XXX_Size() int
func (*HeaderData) XXX_Unmarshal ¶
func (m *HeaderData) XXX_Unmarshal(b []byte) error
type HeaderData_BitcoinHeader ¶
type HeaderData_BitcoinHeader struct {
BitcoinHeader []byte `protobuf:"bytes,2,opt,name=bitcoin_header,json=bitcoinHeader,proto3,oneof" json:"bitcoin_header,omitempty"`
}
func (*HeaderData_BitcoinHeader) MarshalTo ¶
func (m *HeaderData_BitcoinHeader) MarshalTo(dAtA []byte) (int, error)
func (*HeaderData_BitcoinHeader) MarshalToSizedBuffer ¶
func (m *HeaderData_BitcoinHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HeaderData_BitcoinHeader) Size ¶
func (m *HeaderData_BitcoinHeader) Size() (n int)
type HeaderData_EthereumHeader ¶
type HeaderData_EthereumHeader struct {
EthereumHeader []byte `protobuf:"bytes,1,opt,name=ethereum_header,json=ethereumHeader,proto3,oneof" json:"ethereum_header,omitempty"`
}
func (*HeaderData_EthereumHeader) MarshalTo ¶
func (m *HeaderData_EthereumHeader) MarshalTo(dAtA []byte) (int, error)
func (*HeaderData_EthereumHeader) MarshalToSizedBuffer ¶
func (m *HeaderData_EthereumHeader) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*HeaderData_EthereumHeader) Size ¶
func (m *HeaderData_EthereumHeader) Size() (n int)
type Proof ¶
type Proof struct { // Types that are valid to be assigned to Proof: // // *Proof_EthereumProof // *Proof_BitcoinProof Proof isProof_Proof `protobuf_oneof:"proof"` }
func NewBitcoinProof ¶
NewBitcoinProof returns a new Proof containing a Bitcoin proof
func NewEthereumProof ¶
NewEthereumProof returns a new Proof containing an Ethereum proof
func (*Proof) Descriptor ¶
func (*Proof) GetBitcoinProof ¶
func (*Proof) GetEthereumProof ¶
func (*Proof) ProtoMessage ¶
func (*Proof) ProtoMessage()
func (Proof) Verify ¶
func (p Proof) Verify(headerData HeaderData, txIndex int) ([]byte, error)
Verify verifies the proof against the header Returns the verified tx in bytes if the verification is successful
func (*Proof) XXX_DiscardUnknown ¶
func (m *Proof) XXX_DiscardUnknown()
func (*Proof) XXX_Marshal ¶
func (*Proof) XXX_OneofWrappers ¶
func (*Proof) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Proof) XXX_Unmarshal ¶
type Proof_BitcoinProof ¶
type Proof_BitcoinProof struct {
BitcoinProof *bitcoin.Proof `protobuf:"bytes,2,opt,name=bitcoin_proof,json=bitcoinProof,proto3,oneof" json:"bitcoin_proof,omitempty"`
}
func (*Proof_BitcoinProof) MarshalTo ¶
func (m *Proof_BitcoinProof) MarshalTo(dAtA []byte) (int, error)
func (*Proof_BitcoinProof) MarshalToSizedBuffer ¶
func (m *Proof_BitcoinProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Proof_BitcoinProof) Size ¶
func (m *Proof_BitcoinProof) Size() (n int)
type Proof_EthereumProof ¶
type Proof_EthereumProof struct {
EthereumProof *ethereum.Proof `protobuf:"bytes,1,opt,name=ethereum_proof,json=ethereumProof,proto3,oneof" json:"ethereum_proof,omitempty"`
}
func (*Proof_EthereumProof) MarshalTo ¶
func (m *Proof_EthereumProof) MarshalTo(dAtA []byte) (int, error)
func (*Proof_EthereumProof) MarshalToSizedBuffer ¶
func (m *Proof_EthereumProof) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Proof_EthereumProof) Size ¶
func (m *Proof_EthereumProof) Size() (n int)