ntransaction

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: LGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrBadTransactionParam is returned when invalid params are given to the
	// controller upon execution of a transaction.
	ErrBadTransactionParam = errors.New("transaction has bad parameters")
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Behavior behavior
	Result   *api.Return
	Receipt  *core.TransactionInfo
	// contains filtered or unexported fields
}

Controller drives the transaction signing process

func NewController

func NewController(
	client *client.GrpcClient,
	privKey string,
	tx *core.Transaction,
	options ...func(*Controller),
) *Controller

NewController initializes a Controller, caller can control behavior via options

func (*Controller) ExecuteTransaction

func (C *Controller) ExecuteTransaction() error

ExecuteTransaction is the single entrypoint to execute a plain transaction. Each step in transaction creation, execution probably includes a mutation Each becomes a no-op if executionError occurred in any previous step

func (*Controller) GetRawData

func (C *Controller) GetRawData() ([]byte, error)

GetRawData Byes from Transaction

func (*Controller) GetResultError

func (C *Controller) GetResultError() error

GetResultError return result error

func (*Controller) SignTxWithPrivKey

func (C *Controller) SignTxWithPrivKey(pk *ecdsa.PrivateKey, tx *core.Transaction) (*core.Transaction, error)

SignTxWithPrivKey signs the given transaction with the requested account.

func (*Controller) TransactionHash

func (C *Controller) TransactionHash() (string, error)

TransactionHash extract hash from TX

type SignerImpl

type SignerImpl int
const (
	Software SignerImpl = iota
	Ledger
)

Jump to

Keyboard shortcuts

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