2018-03-14 09:36:59 +00:00
|
|
|
package core
|
|
|
|
|
2018-11-26 21:12:33 +00:00
|
|
|
import (
|
2019-02-20 17:39:32 +00:00
|
|
|
"github.com/CityOfZion/neo-go/config"
|
2020-01-14 12:32:07 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/core/block"
|
2020-01-15 07:52:59 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/core/mempool"
|
2019-11-28 16:06:09 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/core/state"
|
2019-10-29 15:31:39 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/core/storage"
|
2019-02-20 17:39:32 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/core/transaction"
|
2019-11-11 15:25:28 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/crypto/keys"
|
2018-11-26 21:12:33 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/util"
|
2019-10-29 15:31:39 +00:00
|
|
|
"github.com/CityOfZion/neo-go/pkg/vm"
|
2018-11-26 21:12:33 +00:00
|
|
|
)
|
2018-03-14 09:36:59 +00:00
|
|
|
|
|
|
|
// Blockchainer is an interface that abstract the implementation
|
|
|
|
// of the blockchain.
|
|
|
|
type Blockchainer interface {
|
2020-02-18 17:16:38 +00:00
|
|
|
ApplyPolicyToTxSet([]mempool.TxWithFee) []mempool.TxWithFee
|
2019-02-20 17:39:32 +00:00
|
|
|
GetConfig() config.ProtocolConfiguration
|
2020-01-14 12:32:07 +00:00
|
|
|
AddHeaders(...*block.Header) error
|
|
|
|
AddBlock(*block.Block) error
|
2018-03-14 09:36:59 +00:00
|
|
|
BlockHeight() uint32
|
2019-11-07 17:47:48 +00:00
|
|
|
Close()
|
2018-03-14 09:36:59 +00:00
|
|
|
HeaderHeight() uint32
|
2020-01-14 12:32:07 +00:00
|
|
|
GetBlock(hash util.Uint256) (*block.Block, error)
|
2019-11-28 16:06:09 +00:00
|
|
|
GetContractState(hash util.Uint160) *state.Contract
|
2018-03-14 09:36:59 +00:00
|
|
|
GetHeaderHash(int) util.Uint256
|
2020-01-14 12:32:07 +00:00
|
|
|
GetHeader(hash util.Uint256) (*block.Header, error)
|
2018-03-14 09:36:59 +00:00
|
|
|
CurrentHeaderHash() util.Uint256
|
|
|
|
CurrentBlockHash() util.Uint256
|
|
|
|
HasBlock(util.Uint256) bool
|
|
|
|
HasTransaction(util.Uint256) bool
|
2019-11-28 16:06:09 +00:00
|
|
|
GetAssetState(util.Uint256) *state.Asset
|
|
|
|
GetAccountState(util.Uint160) *state.Account
|
2019-12-17 11:51:07 +00:00
|
|
|
GetValidators(txes ...*transaction.Transaction) ([]*keys.PublicKey, error)
|
2019-10-11 11:22:53 +00:00
|
|
|
GetScriptHashesForVerifying(*transaction.Transaction) ([]util.Uint160, error)
|
2019-11-28 16:06:09 +00:00
|
|
|
GetStorageItem(scripthash util.Uint160, key []byte) *state.StorageItem
|
|
|
|
GetStorageItems(hash util.Uint160) (map[string]*state.StorageItem, error)
|
2019-10-29 15:31:39 +00:00
|
|
|
GetTestVM() (*vm.VM, storage.Store)
|
2019-02-20 17:39:32 +00:00
|
|
|
GetTransaction(util.Uint256) (*transaction.Transaction, uint32, error)
|
2019-10-11 11:16:53 +00:00
|
|
|
GetUnspentCoinState(util.Uint256) *UnspentCoinState
|
2020-02-26 07:58:20 +00:00
|
|
|
References(t *transaction.Transaction) ([]transaction.InOut, error)
|
2020-01-15 07:52:59 +00:00
|
|
|
mempool.Feer // fee interface
|
2020-02-04 15:43:21 +00:00
|
|
|
PoolTx(*transaction.Transaction) error
|
2020-01-14 12:32:07 +00:00
|
|
|
VerifyTx(*transaction.Transaction, *block.Block) error
|
2020-02-04 14:36:11 +00:00
|
|
|
GetMemPool() *mempool.Pool
|
2018-03-14 09:36:59 +00:00
|
|
|
}
|