txutil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTx

func BuildTx(signer Signer, nonce uint64, payload interface{}) ([]byte, error)

func ProcessTx

func ProcessTx(buf []byte) (*types.Tx, error)

Types

type KeySigner

type KeySigner interface {
	PubKey() crypto.PubKey
	Sign([]byte) crypto.Signature
}

Subset of crypto.PrivKey used to create Signer backed by an in-memory private key.

type Signer

type Signer interface {
	Sign(tx keys.Signable) error
}

Transaction signer

func NewKeystoreSigner

func NewKeystoreSigner(store keys.Signer, keyName, password string) Signer

Return a Signer backed by a keystore

func NewPrivateKeySigner

func NewPrivateKeySigner(key KeySigner) Signer

Return a Signer backed by the given KeySigner (such as a crypto.PrivKey)

type TxBuilder

type TxBuilder interface {
	keys.Signable
	Signature() *base.Signature
}

func NewTxBuilder

func NewTxBuilder(nonce uint64, payload interface{}) (TxBuilder, error)

type TxProcessor

type TxProcessor interface {
	Validate() error
	GetTx() *types.Tx
}

func NewTxProcessor

func NewTxProcessor(buf []byte) (TxProcessor, error)

Jump to

Keyboard shortcuts

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