diff options
author | Meng-Ying Yang <garfield@dexon.org> | 2018-12-29 20:56:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-01-14 15:26:26 +0800 |
commit | a304f1d9c6bb09b866e40a910d1e67221b30503d (patch) | |
tree | 555eac8dad13c87f5f6f54b8a1004797fd51f396 | |
parent | 0b69d8a8a621ab76b1a35324a9a3467954b207f7 (diff) | |
download | dexon-a304f1d9c6bb09b866e40a910d1e67221b30503d.tar.gz dexon-a304f1d9c6bb09b866e40a910d1e67221b30503d.tar.zst dexon-a304f1d9c6bb09b866e40a910d1e67221b30503d.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 |