tx

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalJSON added in v0.0.3

func MarshalJSON(tx TypedTx) ([]byte, error)

func NewTx

func NewTx(val TypedTx) (types.Tx, error)

Get a raw Tx from val.

Types

type Register

type Register struct {
	DOID      string        `json:"DOID"`
	Owner     types.Address `json:"owner"`
	Signature types.Hash    `json:"signature"`
}

func (*Register) Type

func (r *Register) Type() Type

type Type added in v0.0.3

type Type uint8

Type of transaction.

A uint8 for rlp serializing, but marshalled as string in JSON.

const (
	TypeRegister Type = iota
)

Transaction types, append only.

func (Type) MarshalText added in v0.0.3

func (t Type) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (Type) String added in v0.0.3

func (t Type) String() string

String returns the type string.

func (*Type) UnmarshalJSON added in v0.0.3

func (t *Type) UnmarshalJSON(input []byte) error

UnmarshalJSON implements json.Unmarshaler.

func (*Type) UnmarshalText added in v0.0.3

func (t *Type) UnmarshalText(input []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type TypedTx added in v0.0.3

type TypedTx interface {
	Type() Type // return type of transaction
}

TypedTx is the interface of all kinds of transactions

func Decode

func Decode(b types.Tx) (TypedTx, error)

func NewTypedTx added in v0.0.3

func NewTypedTx(t Type) TypedTx

func UnmarshalJSON added in v0.0.3

func UnmarshalJSON(data []byte) (TypedTx, error)

Jump to

Keyboard shortcuts

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