aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/block_chain_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-17 20:07:52 +0800
committerobscuren <geffobscura@gmail.com>2014-05-17 20:07:52 +0800
commit8730dfdcc2e2b40410a57385e4864d15f2f0336b (patch)
treeeabf6400bc78b1796317fbb7cef642a7f2da2306 /ethchain/block_chain_test.go
parent88686cbed27ad2e7d5c111051e06c270b1b352a3 (diff)
downloaddexon-8730dfdcc2e2b40410a57385e4864d15f2f0336b.tar.gz
dexon-8730dfdcc2e2b40410a57385e4864d15f2f0336b.tar.zst
dexon-8730dfdcc2e2b40410a57385e4864d15f2f0336b.zip
Changed how changes are being applied to states
Diffstat (limited to 'ethchain/block_chain_test.go')
-rw-r--r--ethchain/block_chain_test.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/ethchain/block_chain_test.go b/ethchain/block_chain_test.go
index 30eb62266..4e4bb9dd4 100644
--- a/ethchain/block_chain_test.go
+++ b/ethchain/block_chain_test.go
@@ -18,6 +18,18 @@ type TestManager struct {
Blocks []*Block
}
+func (s *TestManager) IsListening() bool {
+ return false
+}
+
+func (s *TestManager) IsMining() bool {
+ return false
+}
+
+func (s *TestManager) PeerCount() int {
+ return 0
+}
+
func (s *TestManager) BlockChain() *BlockChain {
return s.blockChain
}
@@ -38,7 +50,7 @@ func (tm *TestManager) Broadcast(msgType ethwire.MsgType, data []interface{}) {
}
func NewTestManager() *TestManager {
- ethutil.ReadConfig(".ethtest")
+ ethutil.ReadConfig(".ethtest", ethutil.LogStd)
db, err := ethdb.NewMemDatabase()
if err != nil {
@@ -62,8 +74,7 @@ func NewTestManager() *TestManager {
func (tm *TestManager) AddFakeBlock(blk []byte) error {
block := NewBlockFromBytes(blk)
tm.Blocks = append(tm.Blocks, block)
- tm.StateManager().PrepareDefault(block)
- err := tm.StateManager().ProcessBlock(block, false)
+ err := tm.StateManager().ProcessBlock(tm.StateManager().CurrentState(), block, false)
return err
}
func (tm *TestManager) CreateChain1() error {