blockchain

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: MIT Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const IX_Unspent_UTXO = 0x91

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetInfo

type AssetInfo struct {
	types.Asset
	Height uint32
}

func (*AssetInfo) Deserialize

func (a *AssetInfo) Deserialize(r io.Reader) error

func (*AssetInfo) Serialize

func (a *AssetInfo) Serialize(w io.Writer) error

type Config

type Config struct {
	ChainParams *config.Params
	GetTxFee    func(tx *types.Transaction) Fixed64
}

type TokenChainStore

type TokenChainStore struct {
	*blockchain.ChainStore
	// contains filtered or unexported fields
}

func NewChainStore

func NewChainStore(genesisBlock *types.Block, assetID Uint256, dataPath string) (*TokenChainStore, error)

func (*TokenChainStore) GetAsset

func (c *TokenChainStore) GetAsset(hash Uint256) (*AssetInfo, error)

func (*TokenChainStore) GetAssets

func (c *TokenChainStore) GetAssets() map[Uint256]AssetInfo

func (*TokenChainStore) GetTxReference

func (c *TokenChainStore) GetTxReference(tx *types.Transaction) (map[*types.Input]*types.Output, error)

func (*TokenChainStore) GetUnspentElementFromProgramHash

func (c *TokenChainStore) GetUnspentElementFromProgramHash(programHash Uint168, assetid Uint256, height uint32) ([]*utxo, error)

func (*TokenChainStore) GetUnspents

func (c *TokenChainStore) GetUnspents(programHash Uint168) (map[Uint256][]*utxo, error)

func (*TokenChainStore) PersistAsset

func (c *TokenChainStore) PersistAsset(batch database.Batch, asset AssetInfo) error

func (*TokenChainStore) PersistUnspentWithProgramHash

func (c *TokenChainStore) PersistUnspentWithProgramHash(batch database.Batch, programHash Uint168, assetid Uint256, height uint32, unspents []*utxo) error

func (*TokenChainStore) RollbackAsset

func (c *TokenChainStore) RollbackAsset(batch database.Batch, assetID Uint256) error

Jump to

Keyboard shortcuts

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