sdk

package
v0.1.10-beta Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2019 License: GPL-3.0 Imports: 8 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 (
	ZeroInt = NewInt(0)
	OnInt   = NewInt(1)
	E18Int  = NewInt(1e18)
)
View Source
var (
	ZeroRat = NewRat(0, 1)
	OneRat  = NewRat(1, 1)
)
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 Int

type Int struct {
	*big.Int `json:"int"`
}

func NewInt

func NewInt(x int64) Int

func NewIntFromBigInt

func NewIntFromBigInt(i *big.Int) Int

func NewIntFromString

func NewIntFromString(s string) (res Int, ok bool)

func (Int) Abs

func (i Int) Abs() Int

func (Int) Add

func (i Int) Add(i2 Int) Int

func (Int) Div

func (i Int) Div(i2 Int) Int

func (Int) Equal

func (i Int) Equal(i2 Int) bool

Equal compares two Ints

func (Int) GT

func (i Int) GT(i2 Int) bool

func (Int) GTE

func (i Int) GTE(i2 Int) bool

func (Int) LT

func (i Int) LT(i2 Int) bool

func (Int) LTE

func (i Int) LTE(i2 Int) bool

func (Int) Mul

func (i Int) Mul(i2 Int) Int

func (Int) MulRat

func (i Int) MulRat(r Rat) Int

func (Int) Neg

func (i Int) Neg() Int

func (Int) Sub

func (i Int) Sub(i2 Int) Int

type Rat

type Rat struct {
	*big.Rat `json:"rat"`
}

func NewRat

func NewRat(a, b int64) Rat

func NewRatFromString

func NewRatFromString(s string) (Rat, bool)

func (Rat) Add

func (r Rat) Add(r2 Rat) Rat

func (Rat) Cmp

func (r Rat) Cmp(r2 Rat) int

func (Rat) Equal

func (r Rat) Equal(r2 Rat) bool

func (Rat) GT

func (r Rat) GT(r2 Rat) bool

func (Rat) GTE

func (r Rat) GTE(r2 Rat) bool

func (Rat) IsNil

func (r Rat) IsNil() bool

func (Rat) LT

func (r Rat) LT(r2 Rat) bool

func (Rat) LTE

func (r Rat) LTE(r2 Rat) bool

func (Rat) MarshalJSON

func (r Rat) MarshalJSON() ([]byte, error)

Wraps r.MarshalText().

func (Rat) Mul

func (r Rat) Mul(r2 Rat) Rat

func (Rat) Quo

func (r Rat) Quo(r2 Rat) Rat

func (Rat) Sub

func (r Rat) Sub(r2 Rat) Rat

func (*Rat) UnmarshalJSON

func (r *Rat) UnmarshalJSON(b []byte) (err error)

Requires a valid JSON string - strings quotes and calls UnmarshalText

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)

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
go-wire is our custom codec package for serializing and deserializing data and structures as binary and JSON blobs.
go-wire is our custom codec package for serializing and deserializing data and structures as binary and JSON blobs.
data
Data is designed to provide a standard interface and helper functions to easily allow serialization and deserialization of your data structures in both binary and json representations.
Data is designed to provide a standard interface and helper functions to easily allow serialization and deserialization of your data structures in both binary and json representations.
data/base58
Package base58 provides base58-check encoding.
Package base58 provides base58-check encoding.
nolint
nolint

Jump to

Keyboard shortcuts

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