Documentation
¶
Index ¶
- Constants
- Variables
- func ParseGetClientStateArgs(args []interface{}) (string, error)
- func ParseUpdateClientArgs(args []interface{}) (string, []byte, error)
- func ParseVerifyMembershipArgs(method *abi.Method, args []interface{}) (string, []byte, clienttypes.Height, [][]byte, []byte, error)
- func ParseVerifyNonMembershipArgs(method *abi.Method, args []interface{}) (string, []byte, clienttypes.Height, [][]byte, error)
- type Precompile
- func (p Precompile) Execute(ctx sdk.Context, stateDB vm.StateDB, contract *vm.Contract, readOnly bool) ([]byte, error)
- func (p *Precompile) GetClientState(ctx sdk.Context, _ *vm.Contract, _ vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (Precompile) IsTransaction(method *abi.Method) bool
- func (p Precompile) Logger(ctx sdk.Context) log.Logger
- func (Precompile) Name() string
- func (p Precompile) RequiredGas(input []byte) uint64
- func (p Precompile) Run(evm *vm.EVM, contract *vm.Contract, readonly bool) ([]byte, error)
- func (p *Precompile) UpdateClient(ctx sdk.Context, _ *vm.Contract, _ vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p *Precompile) VerifyMembership(ctx sdk.Context, _ *vm.Contract, _ vm.StateDB, method *abi.Method, ...) ([]byte, error)
- func (p *Precompile) VerifyNonMembership(ctx sdk.Context, _ *vm.Contract, _ vm.StateDB, method *abi.Method, ...) ([]byte, error)
Constants ¶
const ( UpdateClientMethod = "updateClient" VerifyMembershipMethod = "verifyMembership" VerifyNonMembershipMethod = "verifyNonMembership" )
const ( UpdateResultSuccess uint8 = 0 UpdateResultMisbehaviour uint8 = 1 )
const (
// GetClientStateMethod defines the get client state query method name.
GetClientStateMethod = "getClientState"
)
Variables ¶
var (
ABI abi.ABI
)
Functions ¶
func ParseGetClientStateArgs ¶
ParseGetClientStateArgs parses the arguments for the GetClientState method.
func ParseUpdateClientArgs ¶
ParseUpdateClientArgs parses the arguments for the UpdateClient method.
func ParseVerifyMembershipArgs ¶
func ParseVerifyMembershipArgs(method *abi.Method, args []interface{}) (string, []byte, clienttypes.Height, [][]byte, []byte, error)
ParseVerifyMembershipArgs parses the arguments for the VerifyMembership method.
func ParseVerifyNonMembershipArgs ¶
func ParseVerifyNonMembershipArgs(method *abi.Method, args []interface{}) (string, []byte, clienttypes.Height, [][]byte, error)
ParseVerifyNonMembershipArgs parses the arguments for the VerifyNonMembership method.
Types ¶
type Precompile ¶
type Precompile struct {
cmn.Precompile
abi.ABI
// contains filtered or unexported fields
}
Precompile defines the precompiled contract for ICS02.
func NewPrecompile ¶
func NewPrecompile( cdc codec.Codec, clientKeeper ibcutils.ClientKeeper, ) *Precompile
NewPrecompile creates a new Client Precompile instance as a PrecompiledContract interface.
func (*Precompile) GetClientState ¶
func (p *Precompile) GetClientState( ctx sdk.Context, _ *vm.Contract, _ vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
GetClientState returns the client state for the precompile's client ID.
func (Precompile) IsTransaction ¶
func (Precompile) IsTransaction(method *abi.Method) bool
IsTransaction checks if the given method name corresponds to a transaction or query.
func (Precompile) Logger ¶
func (p Precompile) Logger(ctx sdk.Context) log.Logger
Logger returns a precompile-specific logger.
func (Precompile) Name ¶
func (Precompile) Name() string
func (Precompile) RequiredGas ¶
func (p Precompile) RequiredGas(input []byte) uint64
RequiredGas calculates the precompiled contract's base gas rate.
func (*Precompile) UpdateClient ¶
func (p *Precompile) UpdateClient( ctx sdk.Context, _ *vm.Contract, _ vm.StateDB, method *abi.Method, args []interface{}, ) ([]byte, error)
UpdateClient implements the ICS02 UpdateClient transactions.