txs

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ok     = 0
	Failed = 1
)

Variables

This section is empty.

Functions

func NewAminoCodec

func NewAminoCodec() *amino.Codec

Types

type Envelope

type Envelope struct {
	ChainID     string             `json:"chainId"`
	Type        tx.Type            `json:"type"`
	Tx          tx.Tx              `json:"tx"`
	Signatories []crypto.Signatory `json:"signatories,omitempty"`
	// contains filtered or unexported fields
}

Envelope contains both the signable Tx and the signatures for each input (in signatories)

func Enclose

func Enclose(chainId string, tx tx.Tx) *Envelope

func (*Envelope) Decode added in v0.3.0

func (env *Envelope) Decode(bs []byte) error

func (*Envelope) Encode added in v0.3.0

func (env *Envelope) Encode() ([]byte, error)

func (*Envelope) GenerateReceipt

func (env *Envelope) GenerateReceipt() *Receipt

Generate a transaction Receipt containing the Tx hash. Returned by ABCI methods.

func (*Envelope) Hash

func (env *Envelope) Hash() []byte

func (*Envelope) Marshal added in v0.3.0

func (env *Envelope) Marshal() ([]byte, error)

func (*Envelope) MarshalTo added in v0.3.0

func (env *Envelope) MarshalTo(data []byte) (int, error)

func (*Envelope) Sign

func (env *Envelope) Sign(signers ...crypto.Signer) error

Sign the Tx by adding Signatories containing the signatures for each Input. Signder for each input must be provided (in any order).

func (*Envelope) Size added in v0.3.0

func (env *Envelope) Size() int

func (*Envelope) String

func (env *Envelope) String() string

func (*Envelope) Unmarshal added in v0.3.0

func (env *Envelope) Unmarshal(bs []byte) error

func (*Envelope) UnmarshalJSON

func (env *Envelope) UnmarshalJSON(data []byte) error

Marshaling/Unmarshaling methods

func (*Envelope) Verify

func (env *Envelope) Verify() error

Verify verifies the validity of the Signatories' Signatures in the Envelope. The Signatories must appear in the same order as the inputs as returned by Tx.GetInputs().

type Receipt

type Receipt struct {
	Type            tx.Type         `json:"type"`
	Hash            binary.HexBytes `json:"hash"`
	Status          int             `json:"status"`
	Height          int64           `json:"height,omitempty"`
	GasUsed         uint64          `json:"gasUsed,omitempty"`
	GasWanted       uint64          `json:"gasWanted,omitempty"`
	ContractAddress *crypto.Address `json:"contractAddress,omitempty"`
	Logs            evm.Logs        `json:"logs,omitempty"`
	Output          binary.HexBytes `json:"output,omitempty"`
}

Transaction receipt

func (*Receipt) Decode added in v0.3.0

func (r *Receipt) Decode(bs []byte) error

func (*Receipt) Encode added in v0.3.0

func (r *Receipt) Encode() ([]byte, error)

For Recipt

func (*Receipt) Marshal added in v0.3.0

func (r *Receipt) Marshal() ([]byte, error)

func (*Receipt) MarshalTo added in v0.3.0

func (r *Receipt) MarshalTo(data []byte) (int, error)

func (*Receipt) Size added in v0.3.0

func (r *Receipt) Size() int

func (*Receipt) Unmarshal added in v0.3.0

func (r *Receipt) Unmarshal(bs []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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