meter

package
v0.0.0-...-d3fc0de Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BlockInterval uint64 = 10 // time interval between two consecutive blocks.

	TxGas                     uint64 = 5000
	ClauseGas                 uint64 = params.TxGas - TxGas
	ClauseGasContractCreation uint64 = params.TxGasContractCreation - TxGas

	MinGasLimit          uint64 = 1000 * 1000
	InitialGasLimit      uint64 = 10 * 1000 * 1000 // InitialGasLimit gas limit value int genesis block.
	GasLimitBoundDivisor uint64 = 1024             // from ethereum
	GetBalanceGas        uint64 = 400              //EIP158 gas table
	SloadGas             uint64 = 200              // EIP158 gas table
	SstoreSetGas         uint64 = params.SstoreSetGas
	SstoreResetGas       uint64 = params.SstoreResetGas

	MaxTxWorkDelay uint32 = 30 // (unit: block) if tx delay exceeds this value, no energy can be exchanged.

	MaxBlockProposers uint64 = 101

	TolerableBlockPackingTime = 500 * time.Millisecond // the indicator to adjust target block gas limit

	MaxStateHistory = 65535 // max guaranteed state history allowed to be accessed in EVM, presented in block number
)

Constants of block chain.

View Source
const (
	// AddressLength length of address in bytes.
	AddressLength = common.AddressLength
)

Variables

This section is empty.

Functions

func NewBlake2b

func NewBlake2b() hash.Hash

NewBlake2b return blake2b-256 hash.

Types

type Address

type Address common.Address

Address address of account.

func BytesToAddress

func BytesToAddress(b []byte) Address

BytesToAddress converts bytes slice into address. If b is larger than address legnth, b will be cropped (from the left). If b is smaller than address length, b will be extended (from the left).

func MustParseAddress

func MustParseAddress(s string) Address

MustParseAddress convert string presented address into Address type, panic on error.

func ParseAddress

func ParseAddress(s string) (Address, error)

ParseAddress convert string presented address into Address type.

func (Address) Bytes

func (a Address) Bytes() []byte

Bytes returns byte slice form of address.

func (Address) String

func (a Address) String() string

String implements the stringer interface

type Bytes32

type Bytes32 [32]byte

Bytes32 array of 32 bytes.

func Blake2b

func Blake2b(data ...[]byte) (b32 Bytes32)

Blake2b computes blake2b-256 checksum for given data.

func MustParseBytes32

func MustParseBytes32(s string) Bytes32

MustParseBytes32 convert string presented into Bytes32 type, panic on error.

func ParseBytes32

func ParseBytes32(s string) (Bytes32, error)

ParseBytes32 convert string presented into Bytes32 type

func (Bytes32) Bytes

func (b Bytes32) Bytes() []byte

Bytes returns byte slice form of Bytes32.

func (Bytes32) String

func (b Bytes32) String() string

String implements stringer

type StorageSize

type StorageSize int64

StorageSize describes storage size in bytes.

func (StorageSize) Int64

func (ss StorageSize) Int64() int64

Int64 returns int64 value.

func (StorageSize) String

func (ss StorageSize) String() string

func (*StorageSize) Write

func (ss *StorageSize) Write(b []byte) (int, error)

Write implements io.Writer, so it can be passed into function that accepts io.Writer to count written bytes.

Jump to

Keyboard shortcuts

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