utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2019 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigEndianToUin64

func BigEndianToUin64(b []byte) uint64

func Bytes2Hex

func Bytes2Hex(d []byte) string

func BytesToAddress

func BytesToAddress(b []byte) types.Address

func CopyBytes

func CopyBytes(b []byte) (copiedBytes []byte)

func EncodeUint256

func EncodeUint256(num int) string

func EncodingAddress

func EncodingAddress(address string) string

func EvmCall

func EvmCall(nonce uint64, to *typec.Address, amount *big.Int, gasLimit uint64, gasPrice *big.Int,
	data []byte, from *typec.Address) ([]byte, error)

func FromHex

func FromHex(s string) []byte

FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".

func GetAccountNonce

func GetAccountNonce(genesis *types.Block, account types.Address) uint64

func GetDefaultAddressByContractType

func GetDefaultAddressByContractType(contract types.ContractType) string

func Hex2Bytes

func Hex2Bytes(str string) []byte

Hex2Bytes returns the bytes represented by the hexadecimal string str.

func HexToAddress

func HexToAddress(s string) types.Address

func NewTransaction

func NewTransaction(nonce uint64, to *types.Address, amount *big.Int, gasLimit uint64,
	gasPrice *big.Int, data []byte, from types.Address) *types.Transaction

func NewTransactionForCall

func NewTransactionForCall(to types.Address, data []byte) types.Transaction

New a transaction

func SetBytes

func SetBytes(b []byte, a *types.Address)

func Uint64ToString

func Uint64ToString(item uint64) string

Types

type RefAddress

type RefAddress struct {
	Addr typec.Address
}

func NewRefAddress

func NewRefAddress(addr typec.Address) *RefAddress

func (*RefAddress) Address

func (self *RefAddress) Address() typec.Address

Jump to

Keyboard shortcuts

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