Documentation
¶
Overview ¶
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Copyright 2021 Evmos Foundation This file is part of Evmos' Ethermint library.
The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with the Ethermint library. If not, see https://github.com/xpladev/ethermint/blob/main/LICENSE
Index ¶
- Constants
- Variables
- func IsValidInt256(i *big.Int) bool
- func ParseChainID(chainID string) (*big.Int, error)
- func ProtoAccount() sdk.AccountI
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func SafeInt64(value uint64) (int64, error)
- func SafeNewIntFromBigInt(i *big.Int) (sdkmath.Int, error)
- func ValidateAddress(address string) error
- type EncodingConfig
- type EthAccount
- func (*EthAccount) Descriptor() ([]byte, []int)
- func (acc EthAccount) EthAddress() common.Address
- func (acc EthAccount) GetBaseAccount() *authtypes.BaseAccount
- func (acc EthAccount) GetCodeHash() common.Hash
- func (m *EthAccount) Marshal() (dAtA []byte, err error)
- func (m *EthAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EthAccount) ProtoMessage()
- func (m *EthAccount) Reset()
- func (acc *EthAccount) SetCodeHash(codeHash common.Hash) error
- func (m *EthAccount) Size() (n int)
- func (acc EthAccount) Type() int8
- func (m *EthAccount) Unmarshal(dAtA []byte) error
- func (m *EthAccount) XXX_DiscardUnknown()
- func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EthAccount) XXX_Merge(src proto.Message)
- func (m *EthAccount) XXX_Size() int
- func (m *EthAccount) XXX_Unmarshal(b []byte) error
- type EthAccountI
- type ExtensionOptionDynamicFeeTx
- func (*ExtensionOptionDynamicFeeTx) Descriptor() ([]byte, []int)
- func (m *ExtensionOptionDynamicFeeTx) Marshal() (dAtA []byte, err error)
- func (m *ExtensionOptionDynamicFeeTx) MarshalTo(dAtA []byte) (int, error)
- func (m *ExtensionOptionDynamicFeeTx) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ExtensionOptionDynamicFeeTx) ProtoMessage()
- func (m *ExtensionOptionDynamicFeeTx) Reset()
- func (m *ExtensionOptionDynamicFeeTx) Size() (n int)
- func (m *ExtensionOptionDynamicFeeTx) String() string
- func (m *ExtensionOptionDynamicFeeTx) Unmarshal(dAtA []byte) error
- func (m *ExtensionOptionDynamicFeeTx) XXX_DiscardUnknown()
- func (m *ExtensionOptionDynamicFeeTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExtensionOptionDynamicFeeTx) XXX_Merge(src proto.Message)
- func (m *ExtensionOptionDynamicFeeTx) XXX_Size() int
- func (m *ExtensionOptionDynamicFeeTx) XXX_Unmarshal(b []byte) error
- type ExtensionOptionsWeb3Tx
- func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
- func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
- func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
- func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ExtensionOptionsWeb3Tx) ProtoMessage()
- func (m *ExtensionOptionsWeb3Tx) Reset()
- func (m *ExtensionOptionsWeb3Tx) Size() (n int)
- func (m *ExtensionOptionsWeb3Tx) String() string
- func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
- func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
- func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
- func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
- func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error
Constants ¶
const ( // AccountTypeEOA defines the type for externally owned accounts (EOAs) AccountTypeEOA = int8(iota + 1) // AccountTypeContract defines the type for contract accounts AccountTypeContract )
const (
// RootCodespace is the codespace for all errors defined in this package
RootCodespace = "ethermint"
)
Variables ¶
var ( ErrInvalidLengthAccount = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAccount = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupAccount = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthDynamicFee = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowDynamicFee = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupDynamicFee = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthWeb3 = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWeb3 = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupWeb3 = fmt.Errorf("proto: unexpected end of group") )
var ( // ErrInvalidChainID returns an error resulting from an invalid chain ID. ErrInvalidChainID = errorsmod.Register(RootCodespace, 3, "invalid chain ID") )
Functions ¶
func IsValidInt256 ¶
IsValidInt256 check the bound of 256 bit number
func ParseChainID ¶
ParseChainID parses a string chain identifier's epoch to an Ethereum-compatible chain-id in *big.Int format. The function returns an error if the chain-id has an invalid format
func ProtoAccount ¶
ProtoAccount defines the prototype function for BaseAccount used for an AccountKeeper.
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.
func SafeNewIntFromBigInt ¶
SafeNewIntFromBigInt constructs Int from big.Int, return error if more than 256bits
func ValidateAddress ¶
ValidateAddress returns an error if the provided string is either not a hex formatted string address
Types ¶
type EncodingConfig ¶
type EncodingConfig sdktestutil.TestEncodingConfig
type EthAccount ¶
type EthAccount struct {
// base_account is an authtypes.BaseAccount
*types.BaseAccount `` /* 136-byte string literal not displayed */
// code_hash is the hash calculated from the code contents
CodeHash string `protobuf:"bytes,2,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty" yaml:"code_hash"`
}
EthAccount implements the sdk.AccountI interface and embeds an authtypes.BaseAccount type. It is compatible with the auth AccountKeeper.
func (*EthAccount) Descriptor ¶
func (*EthAccount) Descriptor() ([]byte, []int)
func (EthAccount) EthAddress ¶
func (acc EthAccount) EthAddress() common.Address
EthAddress returns the account address ethereum format.
func (EthAccount) GetBaseAccount ¶
func (acc EthAccount) GetBaseAccount() *authtypes.BaseAccount
GetBaseAccount returns base account.
func (EthAccount) GetCodeHash ¶
func (acc EthAccount) GetCodeHash() common.Hash
GetCodeHash returns the account code hash in byte format
func (*EthAccount) Marshal ¶
func (m *EthAccount) Marshal() (dAtA []byte, err error)
func (*EthAccount) MarshalToSizedBuffer ¶
func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EthAccount) ProtoMessage ¶
func (*EthAccount) ProtoMessage()
func (*EthAccount) Reset ¶
func (m *EthAccount) Reset()
func (*EthAccount) SetCodeHash ¶
func (acc *EthAccount) SetCodeHash(codeHash common.Hash) error
SetCodeHash sets the account code hash to the EthAccount fields
func (*EthAccount) Size ¶
func (m *EthAccount) Size() (n int)
func (EthAccount) Type ¶
func (acc EthAccount) Type() int8
Type returns the type of Ethereum Account (EOA or Contract)
func (*EthAccount) Unmarshal ¶
func (m *EthAccount) Unmarshal(dAtA []byte) error
func (*EthAccount) XXX_DiscardUnknown ¶
func (m *EthAccount) XXX_DiscardUnknown()
func (*EthAccount) XXX_Marshal ¶
func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EthAccount) XXX_Merge ¶
func (m *EthAccount) XXX_Merge(src proto.Message)
func (*EthAccount) XXX_Size ¶
func (m *EthAccount) XXX_Size() int
func (*EthAccount) XXX_Unmarshal ¶
func (m *EthAccount) XXX_Unmarshal(b []byte) error
type EthAccountI ¶
type EthAccountI interface {
sdk.AccountI
// EthAddress returns the ethereum Address representation of the AccAddress
EthAddress() common.Address
// CodeHash is the keccak256 hash of the contract code (if any)
GetCodeHash() common.Hash
// SetCodeHash sets the code hash to the account fields
SetCodeHash(code common.Hash) error
// Type returns the type of Ethereum Account (EOA or Contract)
Type() int8
}
EthAccountI represents the interface of an EVM compatible account
type ExtensionOptionDynamicFeeTx ¶
type ExtensionOptionDynamicFeeTx struct {
// max_priority_price is the same as `max_priority_fee_per_gas` in eip-1559 spec
MaxPriorityPrice cosmossdk_io_math.Int `` /* 134-byte string literal not displayed */
}
ExtensionOptionDynamicFeeTx is an extension option that specifies the maxPrioPrice for cosmos tx
func (*ExtensionOptionDynamicFeeTx) Descriptor ¶
func (*ExtensionOptionDynamicFeeTx) Descriptor() ([]byte, []int)
func (*ExtensionOptionDynamicFeeTx) Marshal ¶
func (m *ExtensionOptionDynamicFeeTx) Marshal() (dAtA []byte, err error)
func (*ExtensionOptionDynamicFeeTx) MarshalTo ¶
func (m *ExtensionOptionDynamicFeeTx) MarshalTo(dAtA []byte) (int, error)
func (*ExtensionOptionDynamicFeeTx) MarshalToSizedBuffer ¶
func (m *ExtensionOptionDynamicFeeTx) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ExtensionOptionDynamicFeeTx) ProtoMessage ¶
func (*ExtensionOptionDynamicFeeTx) ProtoMessage()
func (*ExtensionOptionDynamicFeeTx) Reset ¶
func (m *ExtensionOptionDynamicFeeTx) Reset()
func (*ExtensionOptionDynamicFeeTx) Size ¶
func (m *ExtensionOptionDynamicFeeTx) Size() (n int)
func (*ExtensionOptionDynamicFeeTx) String ¶
func (m *ExtensionOptionDynamicFeeTx) String() string
func (*ExtensionOptionDynamicFeeTx) Unmarshal ¶
func (m *ExtensionOptionDynamicFeeTx) Unmarshal(dAtA []byte) error
func (*ExtensionOptionDynamicFeeTx) XXX_DiscardUnknown ¶
func (m *ExtensionOptionDynamicFeeTx) XXX_DiscardUnknown()
func (*ExtensionOptionDynamicFeeTx) XXX_Marshal ¶
func (m *ExtensionOptionDynamicFeeTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExtensionOptionDynamicFeeTx) XXX_Merge ¶
func (m *ExtensionOptionDynamicFeeTx) XXX_Merge(src proto.Message)
func (*ExtensionOptionDynamicFeeTx) XXX_Size ¶
func (m *ExtensionOptionDynamicFeeTx) XXX_Size() int
func (*ExtensionOptionDynamicFeeTx) XXX_Unmarshal ¶
func (m *ExtensionOptionDynamicFeeTx) XXX_Unmarshal(b []byte) error
type ExtensionOptionsWeb3Tx ¶
type ExtensionOptionsWeb3Tx struct {
// typed_data_chain_id is used only in EIP712 Domain and should match
// Ethereum network ID in a Web3 provider (e.g. Metamask).
TypedDataChainID uint64 `protobuf:"varint,1,opt,name=typed_data_chain_id,json=typedDataChainId,proto3" json:"typedDataChainID,omitempty"`
// fee_payer is an account address for the fee payer. It will be validated
// during EIP712 signature checking.
FeePayer string `protobuf:"bytes,2,opt,name=fee_payer,json=feePayer,proto3" json:"feePayer,omitempty"`
// fee_payer_sig is a signature data from the fee paying account,
// allows to perform fee delegation when using EIP712 Domain.
FeePayerSig []byte `protobuf:"bytes,3,opt,name=fee_payer_sig,json=feePayerSig,proto3" json:"feePayerSig,omitempty"`
}
ExtensionOptionsWeb3Tx is an extension option that specifies the typed chain id, the fee payer as well as its signature data.
func (*ExtensionOptionsWeb3Tx) Descriptor ¶
func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
func (*ExtensionOptionsWeb3Tx) Marshal ¶
func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
func (*ExtensionOptionsWeb3Tx) MarshalTo ¶
func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) MarshalToSizedBuffer ¶
func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) ProtoMessage ¶
func (*ExtensionOptionsWeb3Tx) ProtoMessage()
func (*ExtensionOptionsWeb3Tx) Reset ¶
func (m *ExtensionOptionsWeb3Tx) Reset()
func (*ExtensionOptionsWeb3Tx) Size ¶
func (m *ExtensionOptionsWeb3Tx) Size() (n int)
func (*ExtensionOptionsWeb3Tx) String ¶
func (m *ExtensionOptionsWeb3Tx) String() string
func (*ExtensionOptionsWeb3Tx) Unmarshal ¶
func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
func (*ExtensionOptionsWeb3Tx) XXX_DiscardUnknown ¶
func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
func (*ExtensionOptionsWeb3Tx) XXX_Marshal ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExtensionOptionsWeb3Tx) XXX_Merge ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
func (*ExtensionOptionsWeb3Tx) XXX_Size ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
func (*ExtensionOptionsWeb3Tx) XXX_Unmarshal ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error