types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 12 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// EthBech32Prefix defines the Bech32 prefix used for EthAccounts
	EthBech32Prefix = "eth"

	// Bech32PrefixAccAddr defines the Bech32 prefix of an account's address
	Bech32PrefixAccAddr = EthBech32Prefix
	// Bech32PrefixAccPub defines the Bech32 prefix of an account's public key
	Bech32PrefixAccPub = EthBech32Prefix + sdk.PrefixPublic
	// Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address
	Bech32PrefixValAddr = EthBech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator
	// Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key
	Bech32PrefixValPub = EthBech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic
	// Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address
	Bech32PrefixConsAddr = EthBech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus
	// Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key
	Bech32PrefixConsPub = EthBech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
)
View Source
const (
	// DefaultGasPrice is default gas price for evm transactions
	DefaultGasPrice = 20
	// DefaultRPCGasLimit is default gas limit for RPC call operations
	DefaultRPCGasLimit = 10000000

	// DenomDefault defines the single coin type/denomination supported in
	// Ethermint.
	DenomDefault = "photon"
)
View Source
const (
	// EthAccountName is the amino encoding name for EthAccount
	EthAccountName = "ethermint/EthAccount"
)
View Source
const (
	// RootCodespace is the codespace for all errors defined in this package
	RootCodespace = "ethermint"
)

Variables

View Source
var (
	// ErrInvalidValue returns an error resulting from an invalid value.
	ErrInvalidValue = sdkerrors.Register(RootCodespace, 2, "invalid value")

	// ErrInvalidChainID returns an error resulting from an invalid chain ID.
	ErrInvalidChainID = sdkerrors.Register(RootCodespace, 3, "invalid chain ID")

	// ErrVMExecution returns an error resulting from an error in EVM execution.
	ErrVMExecution = sdkerrors.Register(RootCodespace, 4, "error while executing evm transaction")
)

Functions

func ProtoAccount

func ProtoAccount() exported.Account

ProtoAccount defines the prototype function for BaseAccount used for an AccountKeeper.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the account interfaces and concrete types on the provided Amino codec.

func SetBech32Prefixes added in v0.1.0

func SetBech32Prefixes(config *sdk.Config)

SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.

Types

type Code

type Code []byte

Code is account Code type alias

func (Code) String

func (c Code) String() string

type EthAccount

type EthAccount struct {
	*authtypes.BaseAccount `json:"base_account" yaml:"base_account"`
	CodeHash               []byte `json:"code_hash" yaml:"code_hash"`
}

EthAccount implements the auth.Account interface and embeds an auth.BaseAccount type. It is compatible with the auth.AccountKeeper.

func (EthAccount) Balance added in v0.1.0

func (acc EthAccount) Balance() sdk.Int

Balance returns the balance of an account.

func (EthAccount) EthAddress added in v0.1.0

func (acc EthAccount) EthAddress() ethcmn.Address

EthAddress returns the account address ethereum format.

func (EthAccount) MarshalJSON

func (acc EthAccount) MarshalJSON() ([]byte, error)

MarshalJSON returns the JSON representation of an EthAccount.

func (EthAccount) MarshalYAML

func (acc EthAccount) MarshalYAML() (interface{}, error)

MarshalYAML returns the YAML representation of an account.

func (*EthAccount) SetBalance added in v0.1.0

func (acc *EthAccount) SetBalance(amt sdk.Int)

SetBalance sets an account's balance of photons

func (*EthAccount) UnmarshalJSON

func (acc *EthAccount) UnmarshalJSON(bz []byte) error

UnmarshalJSON unmarshals raw JSON bytes into an EthAccount.

Jump to

Keyboard shortcuts

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