Documentation ¶
Overview ¶
Package ownership - handles low-level access to the ownership data in storage pool
Index ¶
- func CreateAsset(trx storage.Transaction, issueTxId merkle.Digest, issueBlockNumber uint64, ...)
- func CreateBlock(trx storage.Transaction, issueTxId merkle.Digest, blockNumber uint64, ...)
- func CurrentlyOwns(trx storage.Transaction, owner *account.Account, txId merkle.Digest, ...) bool
- func Initialise(ownerList, ownerData storage.Handle)
- func OwnerOf(trx storage.Transaction, txId merkle.Digest) (uint64, *account.Account)
- func Share(trx storage.Transaction, previousTxId merkle.Digest, ...)
- func Transfer(trx storage.Transaction, previousTxId merkle.Digest, ...)
- type AssetOwnerData
- type BlockOwnerData
- type OwnedItem
- type OwnerData
- type Ownership
- type PackedOwnerData
- type Record
- type ShareOwnerData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAsset ¶
func CreateAsset( trx storage.Transaction, issueTxId merkle.Digest, issueBlockNumber uint64, assetId transactionrecord.AssetIdentifier, newOwner *account.Account, )
CreateAsset - create the ownership record for an asset
func CreateBlock ¶
func CreateBlock( trx storage.Transaction, issueTxId merkle.Digest, blockNumber uint64, newOwner *account.Account, )
CreateBlock - create the ownership record for a block
func CurrentlyOwns ¶
func CurrentlyOwns( trx storage.Transaction, owner *account.Account, txId merkle.Digest, pool storage.Handle, ) bool
CurrentlyOwns - check owner currently owns this transaction id
func Initialise ¶ added in v0.13.0
Initialise - initialise ownership
Types ¶
type AssetOwnerData ¶ added in v0.10.0
type AssetOwnerData struct {
// contains filtered or unexported fields
}
AssetOwnerData - owner data
func (AssetOwnerData) IssueBlockNumber ¶ added in v0.10.0
func (a AssetOwnerData) IssueBlockNumber() uint64
func (AssetOwnerData) IssueTxId ¶ added in v0.10.0
func (a AssetOwnerData) IssueTxId() merkle.Digest
accessors
func (AssetOwnerData) Pack ¶ added in v0.10.0
func (a AssetOwnerData) Pack() PackedOwnerData
Pack - pack asset owner data to byte slice
func (AssetOwnerData) TransferBlockNumber ¶ added in v0.10.0
func (a AssetOwnerData) TransferBlockNumber() uint64
type BlockOwnerData ¶ added in v0.10.0
type BlockOwnerData struct {
// contains filtered or unexported fields
}
BlockOwnerData - owner data
func (BlockOwnerData) IssueBlockNumber ¶ added in v0.10.0
func (b BlockOwnerData) IssueBlockNumber() uint64
func (BlockOwnerData) IssueTxId ¶ added in v0.10.0
func (b BlockOwnerData) IssueTxId() merkle.Digest
accessors
func (BlockOwnerData) Pack ¶ added in v0.10.0
func (b BlockOwnerData) Pack() PackedOwnerData
Pack - pack block owner data to byte slice
func (BlockOwnerData) TransferBlockNumber ¶ added in v0.10.0
func (b BlockOwnerData) TransferBlockNumber() uint64
type OwnedItem ¶
type OwnedItem byte
OwnedItem - the flag byte
func (OwnedItem) MarshalText ¶
MarshalText - convert item to text
func (*OwnedItem) UnmarshalText ¶ added in v0.10.0
UnmarshalText - convert test to Item
type OwnerData ¶ added in v0.10.0
type OwnerData interface { Pack() PackedOwnerData IssueTxId() merkle.Digest TransferBlockNumber() uint64 IssueBlockNumber() uint64 }
OwnerData - generic owner data methods
func GetOwnerData ¶ added in v0.10.0
func GetOwnerData(trx storage.Transaction, txId merkle.Digest, ownerDataHandle storage.Handle) (OwnerData, error)
GetOwnerData - fetch and unpack owner data
func GetOwnerDataB ¶ added in v0.10.0
func GetOwnerDataB(trx storage.Transaction, txId []byte, ownerDataHandle storage.Handle) (OwnerData, error)
GetOwnerDataB - fetch and unpack owner data
type PackedOwnerData ¶ added in v0.10.0
type PackedOwnerData []byte
PackedOwnerData - packed data to store in database
func (PackedOwnerData) Unpack ¶ added in v0.10.0
func (packed PackedOwnerData) Unpack() (OwnerData, error)
Unpack - unpack record into the appropriate type
type Record ¶ added in v0.13.0
type Record struct { N uint64 `json:"n,string"` TxId merkle.Digest `json:"txId"` IssueTxId merkle.Digest `json:"issue"` Item OwnedItem `json:"item"` AssetId *transactionrecord.AssetIdentifier `json:"assetId,omitempty"` BlockNumber *uint64 `json:"blockNumber,omitempty"` }
Record - type to represent an ownership record
type ShareOwnerData ¶ added in v0.10.0
type ShareOwnerData struct {
// contains filtered or unexported fields
}
ShareOwnerData - owner data
func (ShareOwnerData) IssueBlockNumber ¶ added in v0.10.0
func (a ShareOwnerData) IssueBlockNumber() uint64
func (ShareOwnerData) IssueTxId ¶ added in v0.10.0
func (a ShareOwnerData) IssueTxId() merkle.Digest
accessors
func (ShareOwnerData) Pack ¶ added in v0.10.0
func (a ShareOwnerData) Pack() PackedOwnerData
Pack - pack share owner data to byte slice
func (ShareOwnerData) TransferBlockNumber ¶ added in v0.10.0
func (a ShareOwnerData) TransferBlockNumber() uint64