transaction

package
v2.2.2+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	Type      TransactionType `msg:"type" json:"type"`
	Timestamp int64           `msg:"timestamp" json:"timestamp"`
	Signer    string          `msg:"signer" json:"signer"`
	Signature string          `msg:"signature" json:"signature"`
	Nonce     uint32          `msg:"nonce" json:"nonce"`
	Data      []byte          `msg:"data" json:"data"`
}

func New

func New(t TransactionType, signer string, data []byte) *Transaction

func (*Transaction) FromBytes

func (t *Transaction) FromBytes(bs []byte) error

func (*Transaction) Hash

func (t *Transaction) Hash() []byte

func (*Transaction) Sign

func (t *Transaction) Sign(key *crypto.Key) error

func (*Transaction) ToBytes

func (t *Transaction) ToBytes() ([]byte, error)

func (*Transaction) Verify

func (t *Transaction) Verify(key *crypto.Key) error

type TransactionType

type TransactionType string
const (
	AccountAdd TransactionType = "add-account"
	PayloadAdd TransactionType = "add-payload"
)

Jump to

Keyboard shortcuts

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