sdk

package
v0.1.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2018 License: GPL-3.0 Imports: 7 Imported by: 33

Documentation

Index

Constants

View Source
const (
	// ModuleNameBase is the module name for internal functionality
	ModuleNameBase = "base"
	// ChainKey is the option key for setting the chain id
	ChainKey = "chain_id"
)

Variables

View Source
var TxMapper = data.NewMapper(Tx{})

Functions

This section is empty.

Types

type CheckResult

type CheckResult struct {
	Data []byte
	Log  string
	// GasAllocated is the maximum units of work we allow this tx to perform
	GasAllocated int64
	// GasPayment is the total fees for this tx (or other source of payment)
	GasPayment int64
}

CheckResult captures any non-error abci result to make sure people use error for error cases

func NewCheck

func NewCheck(gasAllocated int64, log string) CheckResult

NewCheck sets the gas used and the response data but no more info these are the most common info needed to be set by the Handler

func (CheckResult) GetData

func (c CheckResult) GetData() []byte

func (CheckResult) ToABCI

func (c CheckResult) ToABCI() abci.ResponseCheckTx

type DeliverResult

type DeliverResult struct {
	Data    []byte
	Log     string
	Diff    []*abci.Validator
	GasUsed int64 // unused
	GasFee  *big.Int
}

DeliverResult captures any non-error abci result to make sure people use error for error cases

func (DeliverResult) GetData

func (d DeliverResult) GetData() []byte

func (DeliverResult) ToABCI

type Result

type Result interface {
	GetData() []byte
}

type Tx

type Tx struct {
	TxInner "json:\"unwrap\""
}

func (Tx) Empty

func (h Tx) Empty() bool

func (Tx) GetKind

func (t Tx) GetKind() (string, error)

TODO: put this functionality into go-data in a cleaner and more efficient way

func (Tx) GetLayer

func (t Tx) GetLayer() TxLayer

func (Tx) GetMod

func (t Tx) GetMod() (string, error)

func (Tx) IsLayer

func (t Tx) IsLayer() bool

func (Tx) MarshalJSON

func (h Tx) MarshalJSON() ([]byte, error)

func (*Tx) UnmarshalJSON

func (h *Tx) UnmarshalJSON(data []byte) (err error)

func (Tx) Unwrap

func (h Tx) Unwrap() TxInner

Unwrap recovers the concrete interface safely (regardless of levels of embeds)

type TxInner

type TxInner interface {
	Wrap() Tx

	// ValidateBasic should be a stateless check and just verify that the
	// tx is properly formated (required strings not blank, signatures exist, etc.)
	// this can also be run on the client-side for better debugging before posting a tx
	ValidateBasic() error
}

TxInner is the interface all concrete transactions should implement.

It adds bindings for clean un/marhsaling of the various implementations both as json and binary, as well as some common functionality to move them.

+gen wrapper:"Tx"

type TxLayer

type TxLayer interface {
	TxInner
	Next() Tx
}

TxLayer provides a standard way to deal with "middleware" tx, That add context to an embedded tx.

Directories

Path Synopsis
commands
Package commands contains any general setup/helpers valid for all subcommands
Package commands contains any general setup/helpers valid for all subcommands
nolint
nolint
nolint
nolint
nolint
nolint

Jump to

Keyboard shortcuts

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