mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-29 13:34:44 +00:00
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
|
||||
}
|
||||
|
||||
// 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
|
||||
func (bc *Blockchain) GetConfig() config.ProtocolConfiguration {
|
||||
return bc.config
|
||||
|
|
|
@ -26,6 +26,7 @@ type Blockchainer interface {
|
|||
GetStorageItem(scripthash util.Uint160, key []byte) *StorageItem
|
||||
GetStorageItems(hash util.Uint160) (map[string]*StorageItem, error)
|
||||
GetTransaction(util.Uint256) (*transaction.Transaction, uint32, error)
|
||||
GetUnspentCoinState(util.Uint256) *UnspentCoinState
|
||||
References(t *transaction.Transaction) map[transaction.Input]*transaction.Output
|
||||
Feer // fee interface
|
||||
Verify(t *transaction.Transaction) error
|
||||
|
|
|
@ -91,6 +91,10 @@ func (chain testChain) GetTransaction(util.Uint256) (*transaction.Transaction, u
|
|||
panic("TODO")
|
||||
}
|
||||
|
||||
func (chain testChain) GetUnspentCoinState(util.Uint256) *core.UnspentCoinState {
|
||||
panic("TODO")
|
||||
}
|
||||
|
||||
func (chain testChain) GetMemPool() core.MemPool {
|
||||
panic("TODO")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue