transaction

package
v1.7.10 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// INFINITY ...
	INFINITY int = -1 // Any negative value would suit but -1 is our preferred choice
)

Variables

This section is empty.

Functions

func Checker

func Checker(item interface{}, value interface{}) bool

Checker is a function to be sent to concurrent.Slice.Check to compare transactions. `item` will be the original and `value` will be either the new transaction we're trying to compare or its ID as a `Hash`.

func RebuildTransactionID

func RebuildTransactionID(forTx Transaction) (txID model.Hash, err error)

RebuildTransactionID ...

Types

type Contract

type Contract struct {
	TransactionType Type            `json:"type"`
	Channel         channel.Channel `json:"channel,omitempty"`
	Features        Features        `json:"features,omitempty"`
	Signatures      Signatures      `json:"signatures"`
}

Contract ...

type Features

type Features struct {
	Start       uint64               `json:"start"`
	End         int                  `json:"end"`    // Possible INFINITY
	MaxUse      int                  `json:"maxUse"` // Possible INFINITY
	Frequency   Frequency            `json:"freq,omitempty"`
	Destination features.Destination `json:"dest"`
}

Features ...

func (Features) GetByteArrayValues

func (f Features) GetByteArrayValues() (values [][]byte)

GetByteArrayValues ...

func (Features) HasStaticFeatures

func (f Features) HasStaticFeatures() bool

HasStaticFeatures ...

type Frequency

type Frequency struct {
	FirstPeriodID   uint64 `json:"firstPeriodId"`
	CycleLength     uint64 `json:"cycleLength"`
	UsePerCycle     int    `json:"usePerCycle"` // Possible INFINITY
	CurrentPeriodID uint64 `json:"currentPeriodId"`
}

Frequency ...

type Signatures

type Signatures struct {
	Beneficiary model.Signature `json:"beneficiary,omitempty"`
	Emitter     model.Signature `json:"emitter,omitempty"`
}

Signatures ...

type Subchain

type Subchain struct {
	InitialTransactionID   model.Hash `json:"initialTransactionId"`
	LastStateTransactionID model.Hash `json:"lastStateTransactionId,omitempty"`
	FinalTransactionID     model.Hash `json:"finalTransactionId,omitempty"`
}

Subchain ...

type Transaction

type Transaction struct {
	TransactionID  model.Hash         `json:"transactionId"`
	LastBlockID    model.Hash         `json:"lastBlockId"`
	Subchain       Subchain           `json:"subchain,omitempty"`
	Timestamp      uint64             `json:"timestamp"`
	Contract       Contract           `json:"contract"`
	Identification ti.Identifications `json:"identification,omitempty"`
	Script         script.Script      `json:"script"`
	OblivionCode   string             `json:"oblivionCode,omitempty"` // NB: this is the encrypted oblivion code (or the final one)
}

Transaction ...

func (*Transaction) CreateTransactionID

func (tx *Transaction) CreateTransactionID() error

CreateTransactionID ...

func (Transaction) Dump

func (tx Transaction) Dump()

Dump ...

func (Transaction) DumpByte

func (tx Transaction) DumpByte() ([]byte, error)

DumpByte ...

func (Transaction) GetByteArrayValues

func (tx Transaction) GetByteArrayValues() (values [][]byte)

GetByteArrayValues ...

func (Transaction) GetLastBlockID added in v1.7.4

func (tx Transaction) GetLastBlockID() model.Hash

func (Transaction) GetTimestamp added in v1.7.4

func (tx Transaction) GetTimestamp() uint64

func (Transaction) GetTransactionID added in v1.7.4

func (tx Transaction) GetTransactionID() model.Hash

func (*Transaction) IsEmpty

func (tx *Transaction) IsEmpty() bool

IsEmpty returns `true` if all its fields are empty.

func (Transaction) IsFeeding

func (tx Transaction) IsFeeding() bool

IsFeeding ...

func (Transaction) IsOblivion added in v1.1.0

func (tx Transaction) IsOblivion() bool

IsOblivion ...

func (Transaction) IsOptOut

func (tx Transaction) IsOptOut() bool

IsOptOut ...

func (Transaction) IsSpending

func (tx Transaction) IsSpending() bool

IsSpending ...

func (Transaction) IsStatic

func (tx Transaction) IsStatic() bool

IsStatic ...

func (*Transaction) VerifyIdentification

func (tx *Transaction) VerifyIdentification(checker model.Ciphered, decompressedPublicKey model.Key) bool

VerifyIdentification helps verify that the transaction was correctly "signed". It takes the data to check as well as the stakeholder's decompressed public key and returns a boolean.

type Transactions

type Transactions []Transaction

Transactions ...

func (Transactions) Contains

func (t Transactions) Contains(item *Transaction) bool

Contains ...

func (*Transactions) Equals

func (t *Transactions) Equals(to *Transactions) bool

Equals ...

func (Transactions) Get added in v1.5.9

func (t Transactions) Get(id model.Hash) *Transaction

Get ...

func (Transactions) Len

func (t Transactions) Len() int

func (Transactions) Less

func (t Transactions) Less(i, j int) bool

func (Transactions) Swap

func (t Transactions) Swap(i, j int)

type Type added in v1.1.0

type Type string

Type ...

const (
	OBLIVION    Type = "oblivion"
	OBLIVION_AR Type = "oblivion-ar"
	OPT_IN      Type = "opt-in"
	OPT_OUT     Type = "opt-out"
	STATE       Type = "state"
)

func (Type) Bytes added in v1.4.2

func (t Type) Bytes() []byte

Bytes ...

func (Type) String added in v1.4.2

func (t Type) String() string

String ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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