aboutsummaryrefslogtreecommitdiffstats
path: root/core/tx_pool_test.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-09-06 00:49:37 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-09-06 00:50:29 +0800
commitcc313e78b7dfbf44dec64ac0d22e4134ee44cc74 (patch)
treec456f03edea9d0b10119e1906fd2b15eeff148e1 /core/tx_pool_test.go
parent03d00361f5c91bedee27e7b5853523103750de3c (diff)
downloadgo-tangerine-cc313e78b7dfbf44dec64ac0d22e4134ee44cc74.tar.gz
go-tangerine-cc313e78b7dfbf44dec64ac0d22e4134ee44cc74.tar.zst
go-tangerine-cc313e78b7dfbf44dec64ac0d22e4134ee44cc74.zip
core: use blocks and avoid deep reorgs in txpool
Diffstat (limited to 'core/tx_pool_test.go')
-rw-r--r--core/tx_pool_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/tx_pool_test.go b/core/tx_pool_test.go
index cdd45b4b1..17d736877 100644
--- a/core/tx_pool_test.go
+++ b/core/tx_pool_test.go
@@ -50,24 +50,24 @@ type testBlockChain struct {
chainHeadFeed *event.Feed
}
-func (bc *testBlockChain) CurrentHeader() *types.Header {
- return &types.Header{
+func (bc *testBlockChain) CurrentBlock() *types.Block {
+ return types.NewBlock(&types.Header{
GasLimit: bc.gasLimit,
- }
-}
-
-func (bc *testBlockChain) SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription {
- return bc.chainHeadFeed.Subscribe(ch)
+ }, nil, nil, nil)
}
func (bc *testBlockChain) GetBlock(hash common.Hash, number uint64) *types.Block {
- return types.NewBlock(bc.CurrentHeader(), nil, nil, nil)
+ return bc.CurrentBlock()
}
func (bc *testBlockChain) StateAt(common.Hash) (*state.StateDB, error) {
return bc.statedb, nil
}
+func (bc *testBlockChain) SubscribeChainHeadEvent(ch chan<- ChainHeadEvent) event.Subscription {
+ return bc.chainHeadFeed.Subscribe(ch)
+}
+
func transaction(nonce uint64, gaslimit *big.Int, key *ecdsa.PrivateKey) *types.Transaction {
return pricedTransaction(nonce, gaslimit, big.NewInt(1), key)
}