diff options
author | Meng-Ying Yang <garfield@dexon.org> | 2018-12-29 20:56:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:55 +0800 |
commit | 9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da (patch) | |
tree | 416ce96c05d8c2c4540018910188a18f586c85b5 | |
parent | 46a59106b73e122c6df984faee18a2f12591840e (diff) | |
download | dexon-9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da.tar dexon-9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da.tar.gz dexon-9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da.tar.bz2 dexon-9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da.tar.lz dexon-9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da.tar.xz dexon-9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da.tar.zst dexon-9440dfb1aae9d4fd068af8d4c11b5aba8d53c7da.zip |
indexer: ReadOnlyBlockChain returns related configs (#110)
For restoring mock componenets (such as: VM, Backend, ...etc),
blockchain related configs should be exposed.
-rw-r--r-- | indexer/blockchain.go (renamed from indexer/blockhain.go) | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/indexer/blockhain.go b/indexer/blockchain.go index bf9a180ce..a762ef67d 100644 --- a/indexer/blockhain.go +++ b/indexer/blockchain.go @@ -10,7 +10,9 @@ import ( "github.com/dexon-foundation/dexon/core" "github.com/dexon-foundation/dexon/core/state" "github.com/dexon-foundation/dexon/core/types" + "github.com/dexon-foundation/dexon/core/vm" "github.com/dexon-foundation/dexon/event" + "github.com/dexon-foundation/dexon/params" "github.com/dexon-foundation/dexon/rlp" ) @@ -18,6 +20,7 @@ import ( // methods of core.BlockChain struct. type ReadOnlyBlockChain interface { BadBlocks() []*types.Block + Config() *params.ChainConfig CurrentBlock() *types.Block CurrentFastBlock() *types.Block CurrentHeader() *types.Header @@ -54,6 +57,7 @@ type ReadOnlyBlockChain interface { GetTd(common.Hash, uint64) *big.Int GetTdByHash(common.Hash) *big.Int GetUnclesInChain(*types.Block, int) []*types.Header + GetVMConfig() *vm.Config HasBlock(common.Hash, uint64) bool HasBlockAndState(common.Hash, uint64) bool HasHeader(common.Hash, uint64) bool |