ethereum

package
v0.0.0-...-5628e88 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 31 Imported by: 2

Documentation

Overview

mainly copied from https://github.com/hyperledger-labs/yui-ibc-solidity/blob/05047b73f12020ed671b8ca9d9e3d188d5befbd5/pkg/client/proof.go

Index

Constants

View Source
const AccountStorageRootIndex = 2

Variables

View Source
var (
	ErrInvalidLengthConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the module interfaces to protobuf Any.

Types

type Client

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

func NewClient

func NewClient(endpoint string) (*Client, error)

func (Client) GetETHProof

func (cl Client) GetETHProof(address common.Address, storageKeys [][]byte, blockNumber *big.Int) (*ETHProof, error)

type ETHProof

type ETHProof struct {
	AccountProofRLP []byte
	StorageProofRLP [][]byte
}

type Module

type Module struct{}

func (Module) GetCmd

func (Module) GetCmd(ctx *config.Context) *cobra.Command

GetCmd returns the command

func (Module) Name

func (Module) Name() string

Name returns the name of the module

func (Module) RegisterInterfaces

func (Module) RegisterInterfaces(registry codectypes.InterfaceRegistry)

RegisterInterfaces register the module interfaces to protobuf Any.

type Prover

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

func NewProver

func NewProver(chain *ethereum.Chain, config ProverConfig) (*Prover, error)

func (*Prover) CreateMsgCreateClient

func (pr *Prover) CreateMsgCreateClient(clientID string, dstHeader core.HeaderI, signer sdk.AccAddress) (*clienttypes.MsgCreateClient, error)

CreateMsgCreateClient creates a CreateClientMsg to this chain

func (*Prover) GetChainID

func (pr *Prover) GetChainID() string

GetChainID returns the chain ID

func (*Prover) GetLatestLightHeight

func (pr *Prover) GetLatestLightHeight() (int64, error)

GetLatestLightHeight returns the latest height on the light client

func (*Prover) QueryChannelWithProof

func (pr *Prover) QueryChannelWithProof(height int64) (chanRes *chantypes.QueryChannelResponse, err error)

QueryChannelWithProof returns the Channel and its proof

func (*Prover) QueryClientConsensusStateWithProof

func (pr *Prover) QueryClientConsensusStateWithProof(height int64, dstClientConsHeight ibcexported.Height) (*clienttypes.QueryConsensusStateResponse, error)

QueryClientConsensusState returns the ClientConsensusState and its proof

func (*Prover) QueryClientStateWithProof

func (pr *Prover) QueryClientStateWithProof(height int64) (*clienttypes.QueryClientStateResponse, error)

QueryClientStateWithProof returns the ClientState and its proof

func (*Prover) QueryConnectionWithProof

func (pr *Prover) QueryConnectionWithProof(height int64) (*conntypes.QueryConnectionResponse, error)

QueryConnectionWithProof returns the Connection and its proof

func (*Prover) QueryLatestHeader

func (pr *Prover) QueryLatestHeader() (out core.HeaderI, err error)

QueryLatestHeader returns the latest header from the chain

func (*Prover) QueryPacketAcknowledgementCommitmentWithProof

func (pr *Prover) QueryPacketAcknowledgementCommitmentWithProof(height int64, seq uint64) (ackRes *chantypes.QueryPacketAcknowledgementResponse, err error)

QueryPacketAcknowledgementCommitmentWithProof returns the packet acknowledgement commitment and its proof

func (*Prover) QueryPacketCommitmentWithProof

func (pr *Prover) QueryPacketCommitmentWithProof(height int64, seq uint64) (comRes *chantypes.QueryPacketCommitmentResponse, err error)

QueryPacketCommitmentWithProof returns the packet commitment and its proof

func (*Prover) SetupHeader

func (pr *Prover) SetupHeader(dst core.LightClientIBCQueryierI, baseSrcHeader core.HeaderI) (core.HeaderI, error)

SetupHeader creates a new header based on a given header

func (*Prover) UpdateLightWithHeader

func (pr *Prover) UpdateLightWithHeader() (header core.HeaderI, provableHeight int64, queryableHeight int64, err error)

UpdateLightWithHeader updates a header on the light client and returns the header and height corresponding to the chain

type ProverConfig

type ProverConfig struct {
	ChainId    string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	EthChainId int64  `protobuf:"varint,2,opt,name=eth_chain_id,json=ethChainId,proto3" json:"eth_chain_id,omitempty"`
	RpcAddr    string `protobuf:"bytes,3,opt,name=rpc_addr,json=rpcAddr,proto3" json:"rpc_addr,omitempty"`
	// Currently, the only local signer is supported for prover.
	// Remote signer may replace these in the future.
	HdwMnemonic    string `protobuf:"bytes,4,opt,name=hdw_mnemonic,json=hdwMnemonic,proto3" json:"hdw_mnemonic,omitempty"`
	HdwPath        string `protobuf:"bytes,5,opt,name=hdw_path,json=hdwPath,proto3" json:"hdw_path,omitempty"`
	IbcHostAddress string `protobuf:"bytes,6,opt,name=ibc_host_address,json=ibcHostAddress,proto3" json:"ibc_host_address,omitempty"`
	Diversifier    string `protobuf:"bytes,7,opt,name=diversifier,proto3" json:"diversifier,omitempty"`
}

func (ProverConfig) Build

func (c ProverConfig) Build(chain core.ChainI) (core.ProverI, error)

func (*ProverConfig) Descriptor

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

func (ProverConfig) IBCHostAddress

func (c ProverConfig) IBCHostAddress() common.Address

func (*ProverConfig) Marshal

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

func (*ProverConfig) MarshalTo

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

func (*ProverConfig) MarshalToSizedBuffer

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

func (*ProverConfig) ProtoMessage

func (*ProverConfig) ProtoMessage()

func (*ProverConfig) Reset

func (m *ProverConfig) Reset()

func (*ProverConfig) Size

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

func (*ProverConfig) String

func (m *ProverConfig) String() string

func (*ProverConfig) Unmarshal

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

func (*ProverConfig) XXX_DiscardUnknown

func (m *ProverConfig) XXX_DiscardUnknown()

func (*ProverConfig) XXX_Marshal

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

func (*ProverConfig) XXX_Merge

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

func (*ProverConfig) XXX_Size

func (m *ProverConfig) XXX_Size() int

func (*ProverConfig) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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