types

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// HashLength is the expected length of the hash
	HashLength = 32
	// AddressLength is the expected length of the address
	AddressLength = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address [AddressLength]byte

func BytesToAddress

func BytesToAddress(b []byte) Address

func HexToAddress

func HexToAddress(s string) Address

func (Address) Bytes

func (a Address) Bytes() []byte

func (*Address) SetBytes

func (a *Address) SetBytes(b []byte)

type Hash

type Hash [HashLength]byte

func BigToHash

func BigToHash(b *big.Int) Hash

func BytesToHash

func BytesToHash(b []byte) Hash

func HexToHash

func HexToHash(s string) Hash

func (Hash) Bytes

func (h Hash) Bytes() []byte

func (*Hash) SetBytes

func (h *Hash) SetBytes(b []byte)

type Transaction

type Transaction struct {
	Nonce     uint64  `json:"nonce"`
	Value     big.Int `json:"value"`
	To        string  `json:"to"`
	Data      []byte  `json:"data"`
	GasPrice  big.Int `json:"gasPrice"`
	GasLimit  uint64  `json:"gasLimit"`
	Signature []byte  `json:"signature"`
}

func NewTransaction

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

Jump to

Keyboard shortcuts

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