forked from TrueCloudLab/neoneo-go
core: add GetUnspentCoinState() for future interops
This commit is contained in:
parent
bfddf9b3f6
commit
19fd7f844e
3 changed files with 14 additions and 0 deletions
|
@ -740,6 +740,15 @@ func (bc *Blockchain) GetAccountState(scriptHash util.Uint160) *AccountState {
|
||||||
return as
|
return as
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetUnspentCoinState returns unspent coin state for given tx hash.
|
||||||
|
func (bc *Blockchain) GetUnspentCoinState(hash util.Uint256) *UnspentCoinState {
|
||||||
|
ucs, err := getUnspentCoinStateFromStore(bc.memStore, hash)
|
||||||
|
if err != nil {
|
||||||
|
ucs, _ = getUnspentCoinStateFromStore(bc.Store, hash)
|
||||||
|
}
|
||||||
|
return ucs
|
||||||
|
}
|
||||||
|
|
||||||
// GetConfig returns the config stored in the blockchain
|
// GetConfig returns the config stored in the blockchain
|
||||||
func (bc *Blockchain) GetConfig() config.ProtocolConfiguration {
|
func (bc *Blockchain) GetConfig() config.ProtocolConfiguration {
|
||||||
return bc.config
|
return bc.config
|
||||||
|
|
|
@ -26,6 +26,7 @@ type Blockchainer interface {
|
||||||
GetStorageItem(scripthash util.Uint160, key []byte) *StorageItem
|
GetStorageItem(scripthash util.Uint160, key []byte) *StorageItem
|
||||||
GetStorageItems(hash util.Uint160) (map[string]*StorageItem, error)
|
GetStorageItems(hash util.Uint160) (map[string]*StorageItem, error)
|
||||||
GetTransaction(util.Uint256) (*transaction.Transaction, uint32, error)
|
GetTransaction(util.Uint256) (*transaction.Transaction, uint32, error)
|
||||||
|
GetUnspentCoinState(util.Uint256) *UnspentCoinState
|
||||||
References(t *transaction.Transaction) map[transaction.Input]*transaction.Output
|
References(t *transaction.Transaction) map[transaction.Input]*transaction.Output
|
||||||
Feer // fee interface
|
Feer // fee interface
|
||||||
Verify(t *transaction.Transaction) error
|
Verify(t *transaction.Transaction) error
|
||||||
|
|
|
@ -91,6 +91,10 @@ func (chain testChain) GetTransaction(util.Uint256) (*transaction.Transaction, u
|
||||||
panic("TODO")
|
panic("TODO")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (chain testChain) GetUnspentCoinState(util.Uint256) *core.UnspentCoinState {
|
||||||
|
panic("TODO")
|
||||||
|
}
|
||||||
|
|
||||||
func (chain testChain) GetMemPool() core.MemPool {
|
func (chain testChain) GetMemPool() core.MemPool {
|
||||||
panic("TODO")
|
panic("TODO")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue