txrecords

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(b *bytes.Buffer, t *TxRecord) error

Decode a TxRecord from a buffer

func Encode

func Encode(b *bytes.Buffer, t *TxRecord) error

Encode the TxRecord into a buffer

Types

type Direction

type Direction uint8

Direction is an enum which tells us whether a transaction is incoming or outgoing.

const (
	// In identifies incoming transaction
	In Direction = iota
	// Out identifies outgoing transaction
	Out
)

type TxRecord

type TxRecord struct {
	Direction
	Timestamp int64
	Height    uint64
	transactions.TxType
	Amount       uint64
	UnlockHeight uint64
	Recipient    string
}

TxRecord encapsulates the data stored on the DB related to a transaction such as block heigth, direction, amount, etc

func New

func New(tx transactions.Transaction, height uint64, direction Direction, privView *key.PrivateView) *TxRecord

New creates a TxRecord

Jump to

Keyboard shortcuts

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