transaction

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: Apache-2.0, BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const IdLength = 64

Variables

View Source
var EmptyId = Id{}

Functions

func FromStorage

func FromStorage(id []byte) (result objectstorage.StorableObject)

Get's called when we restore a transaction from storage. The bytes and the content will be unmarshaled by an external caller (the objectStorage factory).

Types

type CachedTransaction

type CachedTransaction struct {
	objectstorage.CachedObject
}

func (*CachedTransaction) Consume

func (cachedTransaction *CachedTransaction) Consume(consumer func(object *Transaction)) bool

func (*CachedTransaction) Retain

func (cachedTransaction *CachedTransaction) Retain() *CachedTransaction

func (*CachedTransaction) Unwrap

func (cachedTransaction *CachedTransaction) Unwrap() *Transaction

type Id

type Id [IdLength]byte

func NewId

func NewId(id []byte) (result Id)

func (*Id) MarshalBinary

func (id *Id) MarshalBinary() (result []byte, err error)

func (Id) String

func (id Id) String() string

func (*Id) UnmarshalBinary

func (id *Id) UnmarshalBinary(data []byte) (err error)

type Transaction

type Transaction struct {
	// base functionality of StorableObject
	objectstorage.StorableObjectFlags
	// contains filtered or unexported fields
}

func FromBytes

func FromBytes(bytes []byte) (result *Transaction, err error)

func New

func New(trunkTransactionId Id, branchTransactionId Id, issuer *identity.Identity, payload payload.Payload) (result *Transaction)

Allows us to "issue" a transaction.

func (*Transaction) GetBranchTransactionId

func (transaction *Transaction) GetBranchTransactionId() Id

func (*Transaction) GetBytes

func (transaction *Transaction) GetBytes() []byte

func (*Transaction) GetId

func (transaction *Transaction) GetId() (result Id)

func (*Transaction) GetPayload

func (transaction *Transaction) GetPayload() payload.Payload

func (*Transaction) GetPayloadId

func (transaction *Transaction) GetPayloadId() (result payload.Id)

func (*Transaction) GetStorageKey

func (transaction *Transaction) GetStorageKey() []byte

func (*Transaction) GetTrunkTransactionId

func (transaction *Transaction) GetTrunkTransactionId() Id

func (*Transaction) MarshalBinary

func (transaction *Transaction) MarshalBinary() (result []byte, err error)

Since transactions are immutable and do not get changed after being created, we cache the result of the marshaling.

func (*Transaction) String

func (transaction *Transaction) String() string

func (*Transaction) UnmarshalBinary

func (transaction *Transaction) UnmarshalBinary(data []byte) (err error)

func (*Transaction) Update

func (transaction *Transaction) Update(other objectstorage.StorableObject)

func (*Transaction) VerifySignature

func (transaction *Transaction) VerifySignature() (result bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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