hornet

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionMetadataSolid       = 0
	TransactionMetadataConfirmed   = 1
	TransactionMetadataConflicting = 2
	TransactionMetadataIsHead      = 3
	TransactionMetadataIsTail      = 4
	TransactionMetadataIsValue     = 5
)
View Source
const (
	AddressTxIsValue = 1
)

Variables

View Source
var (

	// NullHashBytes is the binary hash of the genesis transaction.
	NullHashBytes = make(Hash, hashBytesSize)
)

Functions

This section is empty.

Types

type Address

type Address struct {
	objectstorage.StorableObjectFlags
	// contains filtered or unexported fields
}

func NewAddress

func NewAddress(address Hash, txHash Hash, isValue bool) *Address

func (*Address) GetAddress

func (a *Address) GetAddress() Hash

func (*Address) GetTxHash

func (a *Address) GetTxHash() Hash

func (*Address) IsValue

func (a *Address) IsValue() bool

func (*Address) ObjectStorageKey

func (a *Address) ObjectStorageKey() []byte

func (*Address) ObjectStorageValue

func (a *Address) ObjectStorageValue() (_ []byte)

func (*Address) Update

func (a *Address) Update(_ objectstorage.StorableObject)

type Approver

type Approver struct {
	objectstorage.StorableObjectFlags
	// contains filtered or unexported fields
}

func NewApprover

func NewApprover(txHash Hash, approverHash Hash) *Approver

func (*Approver) GetApproverHash

func (a *Approver) GetApproverHash() Hash

func (*Approver) GetTxHash

func (a *Approver) GetTxHash() Hash

func (*Approver) ObjectStorageKey

func (a *Approver) ObjectStorageKey() []byte

func (*Approver) ObjectStorageValue

func (a *Approver) ObjectStorageValue() (_ []byte)

func (*Approver) Update

func (a *Approver) Update(_ objectstorage.StorableObject)

type Hash

type Hash []byte

Hash is the binary representation of a trinary Hash.

func HashFromAddressTrytes added in v0.5.0

func HashFromAddressTrytes(trytes trinary.Trytes) Hash

HashFromAddressTrytes returns the binary representation of the given address trytes. It panics when trytes hash invalid length.

func HashFromHashTrytes added in v0.5.0

func HashFromHashTrytes(trytes trinary.Trytes) Hash

HashFromHashTrytes returns the binary representation of the given hash trytes. It panics when trytes hash invalid length.

func HashFromTagTrytes added in v0.5.0

func HashFromTagTrytes(trytes trinary.Trytes) Hash

HashFromTagTrytes returns the binary representation of the given tag trytes. It panics when trytes hash invalid length.

func (Hash) Trits added in v0.5.4

func (h Hash) Trits() trinary.Trits

Trits converts the binary Hash to its trit representation. It panics when the binary encoding is invalid.

func (Hash) Trytes

func (h Hash) Trytes() trinary.Trytes

Trytes converts the binary Hash to its tryte representation. It panics when the binary encoding is invalid.

type Hashes

type Hashes []Hash

Hashes is a slice of Hash.

func (Hashes) Trytes

func (h Hashes) Trytes() []trinary.Trytes

Trytes converts the binary Hashes to their trinary representation.

type SolidEntryPoints

type SolidEntryPoints struct {
	// contains filtered or unexported fields
}

func NewSolidEntryPoints

func NewSolidEntryPoints() *SolidEntryPoints

func SolidEntryPointsFromBytes

func SolidEntryPointsFromBytes(solidEntryPointsBytes []byte) (*SolidEntryPoints, error)

func (*SolidEntryPoints) Add

func (s *SolidEntryPoints) Add(txHash Hash, milestoneIndex milestone.Index)

func (*SolidEntryPoints) Clear

func (s *SolidEntryPoints) Clear()

func (*SolidEntryPoints) Contains

func (s *SolidEntryPoints) Contains(txHash Hash) bool

func (*SolidEntryPoints) GetBytes

func (s *SolidEntryPoints) GetBytes() []byte

func (*SolidEntryPoints) Hashes

func (s *SolidEntryPoints) Hashes() Hashes

func (*SolidEntryPoints) Index added in v0.4.1

func (s *SolidEntryPoints) Index(txHash Hash) (milestone.Index, bool)

func (*SolidEntryPoints) IsModified

func (s *SolidEntryPoints) IsModified() bool

func (*SolidEntryPoints) SetModified

func (s *SolidEntryPoints) SetModified(modified bool)

type SpentAddress

type SpentAddress struct {
	objectstorage.StorableObjectFlags
	// contains filtered or unexported fields
}

func NewSpentAddress

func NewSpentAddress(address Hash) *SpentAddress

func (*SpentAddress) GetAddress

func (sa *SpentAddress) GetAddress() Hash

func (*SpentAddress) ObjectStorageKey

func (sa *SpentAddress) ObjectStorageKey() []byte

func (*SpentAddress) ObjectStorageValue

func (sa *SpentAddress) ObjectStorageValue() (_ []byte)

func (*SpentAddress) Update

type Tag

type Tag struct {
	objectstorage.StorableObjectFlags
	// contains filtered or unexported fields
}

func NewTag

func NewTag(tag Hash, txHash Hash) *Tag

func (*Tag) GetTag

func (t *Tag) GetTag() Hash

func (*Tag) GetTxHash

func (t *Tag) GetTxHash() Hash

func (*Tag) ObjectStorageKey

func (t *Tag) ObjectStorageKey() []byte

func (*Tag) ObjectStorageValue

func (t *Tag) ObjectStorageValue() (_ []byte)

func (*Tag) Update

func (t *Tag) Update(_ objectstorage.StorableObject)

type Transaction

type Transaction struct {
	objectstorage.StorableObjectFlags

	// Decompressed iota.go Transaction containing Hash
	Tx *transaction.Transaction

	// Compressed bytes as received via gossip
	RawBytes []byte
	// contains filtered or unexported fields
}

func NewTransaction

func NewTransaction(txHash Hash) *Transaction

func NewTransactionFromTx

func NewTransactionFromTx(transaction *transaction.Transaction, transactionBytes []byte) *Transaction

func (*Transaction) GetAddress

func (tx *Transaction) GetAddress() Hash

func (*Transaction) GetBranchHash

func (tx *Transaction) GetBranchHash() Hash

func (*Transaction) GetBundleHash

func (tx *Transaction) GetBundleHash() Hash

func (*Transaction) GetTag

func (tx *Transaction) GetTag() Hash

func (*Transaction) GetTimestamp

func (tx *Transaction) GetTimestamp() int64

func (*Transaction) GetTrunkHash

func (tx *Transaction) GetTrunkHash() Hash

func (*Transaction) GetTxHash

func (tx *Transaction) GetTxHash() Hash

func (*Transaction) IsHead

func (tx *Transaction) IsHead() bool

func (*Transaction) IsTail

func (tx *Transaction) IsTail() bool

func (*Transaction) IsValue

func (tx *Transaction) IsValue() bool

func (*Transaction) ObjectStorageKey

func (tx *Transaction) ObjectStorageKey() []byte

func (*Transaction) ObjectStorageValue

func (tx *Transaction) ObjectStorageValue() (data []byte)

func (*Transaction) UnmarshalObjectStorageValue

func (tx *Transaction) UnmarshalObjectStorageValue(data []byte) (err error)

func (*Transaction) Update

type TransactionMetadata

type TransactionMetadata struct {
	objectstorage.StorableObjectFlags
	syncutils.RWMutex
	// contains filtered or unexported fields
}

func NewTransactionMetadata

func NewTransactionMetadata(txHash Hash) *TransactionMetadata

func (*TransactionMetadata) GetBranchHash added in v0.5.0

func (m *TransactionMetadata) GetBranchHash() Hash

func (*TransactionMetadata) GetBundleHash added in v0.5.0

func (m *TransactionMetadata) GetBundleHash() Hash

func (*TransactionMetadata) GetConfirmed

func (m *TransactionMetadata) GetConfirmed() (bool, milestone.Index)

func (*TransactionMetadata) GetMetadata

func (m *TransactionMetadata) GetMetadata() byte

func (*TransactionMetadata) GetRootSnapshotIndexes added in v0.5.0

func (m *TransactionMetadata) GetRootSnapshotIndexes() (yrtsi milestone.Index, ortsi milestone.Index, rtsci milestone.Index)

func (*TransactionMetadata) GetSolidificationTimestamp

func (m *TransactionMetadata) GetSolidificationTimestamp() int32

func (*TransactionMetadata) GetTrunkHash added in v0.5.0

func (m *TransactionMetadata) GetTrunkHash() Hash

func (*TransactionMetadata) GetTxHash

func (m *TransactionMetadata) GetTxHash() Hash

func (*TransactionMetadata) IsConfirmed

func (m *TransactionMetadata) IsConfirmed() bool

func (*TransactionMetadata) IsConflicting added in v0.5.0

func (m *TransactionMetadata) IsConflicting() bool

func (*TransactionMetadata) IsHead added in v0.5.0

func (m *TransactionMetadata) IsHead() bool

func (*TransactionMetadata) IsSolid

func (m *TransactionMetadata) IsSolid() bool

func (*TransactionMetadata) IsTail added in v0.5.0

func (m *TransactionMetadata) IsTail() bool

func (*TransactionMetadata) IsValue added in v0.5.0

func (m *TransactionMetadata) IsValue() bool

func (*TransactionMetadata) ObjectStorageKey

func (m *TransactionMetadata) ObjectStorageKey() []byte

func (*TransactionMetadata) ObjectStorageValue

func (m *TransactionMetadata) ObjectStorageValue() (data []byte)

func (*TransactionMetadata) SetAdditionalTxInfo added in v0.5.0

func (m *TransactionMetadata) SetAdditionalTxInfo(trunkHash Hash, branchHash Hash, bundleHash Hash, isHead bool, isTail bool, isValue bool)

func (*TransactionMetadata) SetConfirmed

func (m *TransactionMetadata) SetConfirmed(confirmed bool, confirmationIndex milestone.Index)

func (*TransactionMetadata) SetConflicting added in v0.5.0

func (m *TransactionMetadata) SetConflicting(conflicting bool)

func (*TransactionMetadata) SetRootSnapshotIndexes added in v0.5.0

func (m *TransactionMetadata) SetRootSnapshotIndexes(yrtsi milestone.Index, ortsi milestone.Index, rtsci milestone.Index)

func (*TransactionMetadata) SetSolid

func (m *TransactionMetadata) SetSolid(solid bool)

func (*TransactionMetadata) UnmarshalObjectStorageValue

func (m *TransactionMetadata) UnmarshalObjectStorageValue(data []byte) (err error)

func (*TransactionMetadata) Update

type UnconfirmedTx

type UnconfirmedTx struct {
	objectstorage.StorableObjectFlags
	// contains filtered or unexported fields
}

func NewUnconfirmedTx

func NewUnconfirmedTx(msIndex milestone.Index, txHash Hash) *UnconfirmedTx

func (*UnconfirmedTx) GetLatestMilestoneIndex

func (t *UnconfirmedTx) GetLatestMilestoneIndex() milestone.Index

func (*UnconfirmedTx) GetTxHash

func (t *UnconfirmedTx) GetTxHash() Hash

func (*UnconfirmedTx) ObjectStorageKey

func (t *UnconfirmedTx) ObjectStorageKey() []byte

func (*UnconfirmedTx) ObjectStorageValue

func (t *UnconfirmedTx) ObjectStorageValue() (_ []byte)

func (*UnconfirmedTx) Update

Jump to

Keyboard shortcuts

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