common

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const (
	AddressLength = 20
	HashLength    = 32
)

Lengths of hashes and addresses in bytes.

Variables

This section is empty.

Functions

func BytesToAddress added in v1.0.0

func BytesToAddress(b []byte) types.Address

BytesToAddress returns Address with value b. If b is larger than len(h), b will be cropped from the left.

func BytesToHash added in v1.1.0

func BytesToHash(b []byte) types.Hash

BytesToHash sets b to hash. If b is larger than len(h), b will be cropped from the left.

func CopyBytes

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

func FromHex added in v1.0.0

func FromHex(s string) []byte

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

func HashAlg added in v1.0.0

func HashAlg() hash.Hash

func Hex2Bytes added in v1.0.0

func Hex2Bytes(str string) []byte

Hex2Bytes returns the bytes represented by the hexadecimal string str.

func HexToAddress added in v1.0.0

func HexToAddress(s string) types.Address

HexToAddress returns Address with byte values of s. If s is larger than len(h), s will be cropped from the left.

func HexToHash added in v1.1.0

func HexToHash(s string) types.Hash

HexToHash sets byte representation of s to hash. If b is larger than len(h), b will be cropped from the left.

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 TxHash

func TxHash(tx *types.Transaction) types.Hash

Hash hashes the RLP encoding of tx. It uniquely identifies the transaction.

Types

This section is empty.

Jump to

Keyboard shortcuts

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