diff options
author | Meng-Ying Yang <garfield@dexon.org> | 2018-12-29 20:56:27 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | f0d9ddbfeb0235a0f228c86b5e2206b9a1240738 (patch) | |
tree | 608d1c5585ab568ab6c19a5aa87418e964a9b6d1 | |
parent | 1a489ca8099c2af7f0475737b9ecb8be3dc134aa (diff) | |
download | dexon-f0d9ddbfeb0235a0f228c86b5e2206b9a1240738.tar.gz dexon-f0d9ddbfeb0235a0f228c86b5e2206b9a1240738.tar.zst dexon-f0d9ddbfeb0235a0f228c86b5e2206b9a1240738.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 |