txutil

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2019 License: Apache-2.0 Imports: 11 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 Client added in v0.0.6

type Client interface {
	Key() keys.Info
	Signer() Signer
	Nonce() (uint64, error)
	BroadcastTxCommit(tx interface{}) (*tmctypes.ResultBroadcastTxCommit, error)
}

func NewClient added in v0.0.6

func NewClient(parent tmclient.ABCIClient, signer Signer, key keys.Info, nonce uint64) Client

type KeySigner

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

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

type SignableTx added in v0.0.3

type SignableTx interface {
	Sign(key crypto.PubKey, sig []byte) error
	SignBytes() []byte
}

type Signer

type Signer interface {
	Sign(tx SignableTx) error
	SignBytes(bytes []byte) ([]byte, crypto.PubKey, error)
}

Transaction signer

func NewKeystoreSigner

func NewKeystoreSigner(store StoreSigner, 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 StoreSigner added in v0.0.3

type StoreSigner interface {
	Sign(name, passphrase string, msg []byte) ([]byte, crypto.PubKey, error)
}

type TxBuilder

type TxBuilder interface {
	SignableTx
	Signature() []byte
	TxBytes() ([]byte, error)
}

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)

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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