util

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxGas                       uint64 = 21000 // Per transaction not creating a contract.
	PrecompiledContractsSendGas uint64 = 21068
)

Variables

View Source
var (
	ErrInvalidMethodParam          = errors.New("invalid method param")
	ErrInsufficientBalance         = errors.New("insufficient balance for transfer")
	ErrContractAddressCreationFail = errors.New("contract address creation fail")
	ErrAddressCollision            = errors.New("contract address collision")
	ErrIdCollision                 = errors.New("id collision")
	ErrExecutionReverted           = errors.New("execution reverted")
	ErrGasUintOverflow             = errors.New("gas uint64 overflow")
	ErrReturnDataOutOfBounds       = errors.New("evm: return data out of bounds")
	ErrCalcPoWTwice                = errors.New("calc PoW twice referring to one snapshot block")
	ErrAbiMethodNotFound           = errors.New("abi: method not found")
)
View Source
var (
	AttovPerVite = big.NewInt(1e18)
)
View Source
var (
	ErrOutOfQuota = errors.New("out of quota")
)

Functions

func CalcQuotaUsed

func CalcQuotaUsed(quotaTotal, quotaAddition, quotaLeft, quotaRefund uint64, err error) uint64

func DataGasCost

func DataGasCost(data []byte) (uint64, error)

func IntrinsicGasCost

func IntrinsicGasCost(data []byte, isCreate bool) (uint64, error)

func IsSnapshotGid

func IsSnapshotGid(gid types.Gid) bool

func IsViteToken

func IsViteToken(tokenId types.TokenTypeId) bool

func MakeSendBlock

func MakeSendBlock(block *ledger.AccountBlock, toAddress types.Address, blockType byte, amount *big.Int, tokenId types.TokenTypeId, height uint64, data []byte) *ledger.AccountBlock

func UseQuota

func UseQuota(quotaLeft, cost uint64) (uint64, error)

func UseQuotaForData

func UseQuotaForData(data []byte, quotaLeft uint64) (uint64, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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