types

package
v0.0.0-...-9687111 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCodespace reserves a Codespace for Ethermint.
	DefaultCodespace = "ethermint"

	CodeInvalidValue   uint32 = 1
	CodeInvalidChainID uint32 = 2
	CodeInvalidSender  uint32 = 3
	CodeVMExecution    uint32 = 4
	CodeInvalidNonce   uint32 = 5
	CodeInternalError  uint32 = 6
)

Ethermint error codes

View Source
const (
	// DefaultGasPrice is default gas price for evm transactions
	DefaultGasPrice = 20
	// DefaultRPCGasLimit is default gas limit for RPC call operations
	DefaultRPCGasLimit = 10000000
)
View Source
const (
	// DenomDefault defines the single coin type/denomination supported in
	// Ethermint.
	DenomDefault = "photon"
)
View Source
const (
	// Amino encoding name
	EthermintAccountName = "emint/Account"
)

Variables

View Source
var (
	ErrInvalidValue   = sdk.Register(DefaultCodespace, CodeInvalidValue, "invalid value")
	ErrInvalidChainID = sdk.Register(DefaultCodespace, CodeInvalidChainID, "invalid chainid")
	ErrInvalidSender  = sdk.Register(DefaultCodespace, CodeInvalidSender, "invalid sender")
	ErrVMExecution    = sdk.Register(DefaultCodespace, CodeVMExecution, "vme execution failed")
	ErrInvalidNonce   = sdk.Register(DefaultCodespace, CodeInvalidNonce, "invalid nonce")
	ErrInternalError  = sdk.Register(DefaultCodespace, CodeInternalError, "internal errot")
)

Functions

func ProtoBaseAccount

func ProtoBaseAccount() exported.Account

ProtoBaseAccount defines the prototype function for BaseAccount used for an account mapper.

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers all the necessary types with amino for the given codec.

func WrapErrInternalError

func WrapErrInternalError(msg string) error

func WrapErrInvalidChainID

func WrapErrInvalidChainID(msg string) error

ErrInvalidChainID returns a standardized SDK error resulting from an invalid chain ID.

func WrapErrInvalidNonce

func WrapErrInvalidNonce(msg string) error

ErrVMExecution returns a standardized SDK error resulting from an error in EVM execution.

func WrapErrInvalidSender

func WrapErrInvalidSender(msg string) error

ErrInvalidSender returns a standardized SDK error resulting from an invalid transaction sender.

func WrapErrInvalidValue

func WrapErrInvalidValue(msg string) error

ErrInvalidValue returns a standardized SDK error resulting from an invalid value.

func WrapErrVMExecution

func WrapErrVMExecution(msg string) error

ErrVMExecution returns a standardized SDK error resulting from an error in EVM execution.

Types

type Account

type Account struct {
	*auth.BaseAccount

	CodeHash []byte
}

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

func (Account) Balance

func (acc Account) Balance() sdk.Int

Balance returns the balance of an account.

func (Account) MarshalJSON

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

MarshalJSON returns the JSON representation of an Account.

func (Account) MarshalYAML

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

MarshalYAML returns the YAML representation of an account.

func (Account) SetBalance

func (acc Account) SetBalance(amt sdk.Int)

SetBalance sets an account's balance of photons

func (*Account) UnmarshalJSON

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

UnmarshalJSON unmarshals raw JSON bytes into an Account.

type AppContext

type AppContext struct {
}

AppContext provides the ability for the application to pass around and obtain immutable objects easily. More importantly, it allows for the utilization of the object-capability model in which components gain access to other components for which they truly need.

type Code

type Code []byte

Code is account Code type alias

func (Code) String

func (c Code) String() string

type Storage

type Storage map[ethcmn.Hash]ethcmn.Hash

Storage is account storage type alias

func (Storage) Copy

func (c Storage) Copy() Storage

Copy returns a copy of storage.

func (Storage) String

func (c Storage) String() (str string)

Jump to

Keyboard shortcuts

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