Bläddra i källkod

Merge ethereum/poc-9 into accounts-integration

Conflicts:
	cmd/utils/cmd.go
	cmd/utils/flags.go
	core/manager.go
	eth/backend.go
	rpc/http/server.go
	xeth/xeth.go
Felix Lange 10 år sedan
förälder
incheckning
9bf513e993
84 ändrade filer med 11205 tillägg och 5058 borttagningar
  1. 4 0
      .gitignore
  2. 2 2
      Godeps/Godeps.json
  3. 0 2
      Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go
  4. 0 106
      accounts/abi/profile.cov
  5. 2 1
      blockpool/blockpool.go
  6. 31 23
      blockpool/peers.go
  7. 6 2
      cmd/blocktest/main.go
  8. 3 3
      cmd/ethereum/js.go
  9. 6 5
      cmd/ethereum/main.go
  10. 567 136
      cmd/mist/assets/ext/ethereum.js/dist/ethereum.js
  11. 1 1
      cmd/mist/assets/qml/main.qml
  12. 1 1
      cmd/mist/bindings.go
  13. 0 117
      cmd/mist/ext_app.go
  14. 1 1
      cmd/mist/gui.go
  15. 1 1
      cmd/mist/main.go
  16. 1 19
      cmd/mist/ui_lib.go
  17. 1 1
      cmd/utils/cmd.go
  18. 19 7
      cmd/utils/flags.go
  19. 5 4
      core/block_processor_test.go
  20. 1 1
      core/chain_makers.go
  21. 80 47
      core/chain_manager.go
  22. 5 5
      core/chain_manager_test.go
  23. 16 0
      core/error.go
  24. 10 0
      core/events.go
  25. 5 3
      core/execution.go
  26. 2 1
      core/manager.go
  27. 9 3
      core/state_transition.go
  28. 21 9
      eth/backend.go
  29. 1 2
      eth/protocol.go
  30. 1 0
      eth/protocol_test.go
  31. 65 0
      ethutil/natspec/natspec.go
  32. 3517 0
      ethutil/natspec/natspec.js
  33. 51 0
      ethutil/natspec/natspec_test.go
  34. 5 0
      miner/miner.go
  35. 3 3
      miner/worker.go
  36. 1 14
      rpc/api.go
  37. 11 1
      rpc/http.go
  38. 1 1
      state/state_object.go
  39. 9 0
      state/statedb.go
  40. 3 3
      tests/files/BasicTests/genesishashestest.json
  41. 108 0
      tests/files/BlockTests/bcBlockChainTest.json
  42. 624 0
      tests/files/BlockTests/bcInvalidHeaderTest.json
  43. 97 0
      tests/files/BlockTests/bcUncleTest.json
  44. 92 0
      tests/files/BlockTests/bcValidBlockTest.json
  45. 0 85
      tests/files/BlockTests/blForkBlocks.json
  46. 0 523
      tests/files/BlockTests/blInvalidHeaderTest.json
  47. 0 546
      tests/files/BlockTests/blInvalidTransactionRLP.json
  48. 0 514
      tests/files/BlockTests/blValidBlockTest.json
  49. 329 1560
      tests/files/BlockchainTests/basicBlockChain.json
  50. 13 0
      tests/files/PoWTests/ethash_tests.json
  51. 36 18
      tests/files/StateTests/stBlockHashTest.json
  52. 13 6
      tests/files/StateTests/stExample.json
  53. 163 67
      tests/files/StateTests/stInitCodeTest.json
  54. 312 113
      tests/files/StateTests/stLogTests.json
  55. 0 2
      tests/files/StateTests/stMemoryStressTest.json
  56. 12 48
      tests/files/StateTests/stMemoryTest.json
  57. 8 41
      tests/files/StateTests/stPreCompiledContracts.json
  58. 494 0
      tests/files/StateTests/stQuadraticComplexityTest.json
  59. 0 1
      tests/files/StateTests/stRecursiveCreate.json
  60. 458 104
      tests/files/StateTests/stRefundTest.json
  61. 61 96
      tests/files/StateTests/stSolidityTest.json
  62. 13 8
      tests/files/StateTests/stSpecialTest.json
  63. 334 101
      tests/files/StateTests/stSystemOperationsTest.json
  64. 427 104
      tests/files/StateTests/stTransactionTest.json
  65. 114 0
      tests/files/TransactionTests/ttTransactionTest.json
  66. 14 0
      tests/files/TrieTests/hex_encoded_securetrie_test.json
  67. 46 0
      tests/files/VMTests/RandomTests/randomTest.json
  68. 465 57
      tests/files/VMTests/vmArithmeticTest.json
  69. 374 70
      tests/files/VMTests/vmBitwiseLogicOperationTest.json
  70. 129 32
      tests/files/VMTests/vmBlockInfoTest.json
  71. 344 80
      tests/files/VMTests/vmEnvironmentalInfoTest.json
  72. 278 86
      tests/files/VMTests/vmIOandFlowOperationsTest.json
  73. 122 122
      tests/files/VMTests/vmLogTest.json
  74. 220 0
      tests/files/VMTests/vmPerformanceTest.json
  75. 455 55
      tests/files/VMTests/vmPushDupSwapTest.json
  76. 406 14
      tests/files/VMTests/vmSha3Test.json
  77. 121 46
      tests/files/VMTests/vmSystemOperationsTest.json
  78. 10 10
      tests/files/VMTests/vmtests.json
  79. 8 4
      tests/vm/gh_test.go
  80. 4 14
      ui/frontend.go
  81. 3 0
      vm/common.go
  82. 13 3
      vm/vm.go
  83. 1 1
      xeth/state.go
  84. 16 2
      xeth/xeth.go

+ 4 - 0
.gitignore

@@ -11,6 +11,8 @@
 .DS_Store
 */**/.DS_Store
 .ethtest
+*/**/*tx_database*
+*/**/*dapps*
 
 #*
 .#*
@@ -21,3 +23,5 @@
 
 cmd/ethereum/ethereum
 cmd/mist/mist
+deploy/osx/Mist.app
+deploy/osx/Mist\ Installer.dmg

+ 2 - 2
Godeps/Godeps.json

@@ -22,8 +22,8 @@
 		},
 		{
 			"ImportPath": "github.com/ethereum/ethash",
-			"Comment": "v17-63-gbca024b",
-			"Rev": "bca024b0b30d83ec6798a5d4fa8c5fc6f937009a"
+			"Comment": "v17-64-ga323708",
+			"Rev": "a323708b8c4d253b8567bf6c72727d1aec302225"
 		},
 		{
 			"ImportPath": "github.com/ethereum/serpent-go",

+ 0 - 2
Godeps/_workspace/src/github.com/ethereum/ethash/ethash.go

@@ -11,7 +11,6 @@ import "C"
 import (
 	"bytes"
 	"encoding/binary"
-	"fmt"
 	"io/ioutil"
 	"log"
 	"math/big"
@@ -293,7 +292,6 @@ func (pow *Ethash) Verify(block pow.Block) bool {
 }
 
 func (pow *Ethash) verify(hash []byte, mixDigest []byte, difficulty *big.Int, blockNum uint64, nonce uint64) bool {
-	fmt.Printf("%x\n%d\n%x\n%x\n", hash, nonce, mixDigest, difficulty.Bytes())
 	// First check: make sure header, mixDigest, nonce are correct without hitting the DAG
 	// This is to prevent DOS attacks
 	chash := (*C.uint8_t)(unsafe.Pointer(&hash[0]))

+ 0 - 106
accounts/abi/profile.cov

@@ -1,106 +0,0 @@
-mode: set
-github.com/ethereum/go-ethereum/abi/abi.go:27.39,31.32 4 1
-github.com/ethereum/go-ethereum/abi/abi.go:35.2,37.8 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:31.32,34.3 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:40.29,42.2 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:51.53,57.16 3 1
-github.com/ethereum/go-ethereum/abi/abi.go:61.2,62.16 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:65.2,67.12 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:57.16,59.3 1 0
-github.com/ethereum/go-ethereum/abi/abi.go:62.16,64.3 1 0
-github.com/ethereum/go-ethereum/abi/abi.go:79.71,83.25 3 1
-github.com/ethereum/go-ethereum/abi/abi.go:94.2,94.17 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:83.25,87.17 3 1
-github.com/ethereum/go-ethereum/abi/abi.go:90.3,90.31 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:87.17,89.4 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:102.71,104.12 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:109.2,109.36 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:113.2,114.16 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:119.2,122.20 3 1
-github.com/ethereum/go-ethereum/abi/abi.go:104.12,106.3 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:109.36,111.3 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:114.16,116.3 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:125.50,127.55 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:131.2,132.33 2 1
-github.com/ethereum/go-ethereum/abi/abi.go:136.2,136.12 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:127.55,129.3 1 0
-github.com/ethereum/go-ethereum/abi/abi.go:132.33,134.3 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:139.42,143.41 3 1
-github.com/ethereum/go-ethereum/abi/abi.go:147.2,147.17 1 1
-github.com/ethereum/go-ethereum/abi/abi.go:143.41,145.3 1 0
-github.com/ethereum/go-ethereum/abi/numbers.go:39.30,41.2 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:43.30,46.32 3 1
-github.com/ethereum/go-ethereum/abi/numbers.go:56.2,56.12 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:46.32,47.25 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:47.25,48.14 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:52.4,52.9 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:48.14,50.13 2 1
-github.com/ethereum/go-ethereum/abi/numbers.go:59.30,61.2 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:63.29,65.2 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:67.51,68.36 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:91.2,91.12 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:69.2,70.19 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:75.2,76.19 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:81.2,83.19 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:70.19,72.4 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:72.4,74.4 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:76.19,78.4 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:78.4,80.4 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:83.19,85.4 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:85.4,87.4 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:94.37,95.18 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:101.2,101.14 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:96.2,97.14 1 1
-github.com/ethereum/go-ethereum/abi/numbers.go:98.2,99.14 1 1
-github.com/ethereum/go-ethereum/abi/type.go:32.46,35.16 2 1
-github.com/ethereum/go-ethereum/abi/type.go:38.2,43.9 3 1
-github.com/ethereum/go-ethereum/abi/type.go:55.2,56.16 2 1
-github.com/ethereum/go-ethereum/abi/type.go:60.2,64.55 4 1
-github.com/ethereum/go-ethereum/abi/type.go:69.2,69.13 1 1
-github.com/ethereum/go-ethereum/abi/type.go:111.2,113.8 2 1
-github.com/ethereum/go-ethereum/abi/type.go:35.16,37.3 1 0
-github.com/ethereum/go-ethereum/abi/type.go:44.2,47.17 2 1
-github.com/ethereum/go-ethereum/abi/type.go:48.2,50.12 2 1
-github.com/ethereum/go-ethereum/abi/type.go:51.2,52.60 1 0
-github.com/ethereum/go-ethereum/abi/type.go:56.16,58.3 1 0
-github.com/ethereum/go-ethereum/abi/type.go:64.55,67.3 2 1
-github.com/ethereum/go-ethereum/abi/type.go:69.13,72.16 3 1
-github.com/ethereum/go-ethereum/abi/type.go:73.3,74.21 1 0
-github.com/ethereum/go-ethereum/abi/type.go:75.3,76.22 1 1
-github.com/ethereum/go-ethereum/abi/type.go:77.3,78.66 1 0
-github.com/ethereum/go-ethereum/abi/type.go:80.3,81.16 1 1
-github.com/ethereum/go-ethereum/abi/type.go:82.3,86.17 4 0
-github.com/ethereum/go-ethereum/abi/type.go:87.3,91.18 4 1
-github.com/ethereum/go-ethereum/abi/type.go:92.3,93.27 1 1
-github.com/ethereum/go-ethereum/abi/type.go:94.3,95.30 1 0
-github.com/ethereum/go-ethereum/abi/type.go:96.3,100.21 4 1
-github.com/ethereum/go-ethereum/abi/type.go:101.3,104.17 3 1
-github.com/ethereum/go-ethereum/abi/type.go:107.3,108.60 1 0
-github.com/ethereum/go-ethereum/abi/type.go:104.17,106.5 1 1
-github.com/ethereum/go-ethereum/abi/type.go:116.37,118.2 1 1
-github.com/ethereum/go-ethereum/abi/type.go:126.51,128.36 2 1
-github.com/ethereum/go-ethereum/abi/type.go:179.2,179.20 1 0
-github.com/ethereum/go-ethereum/abi/type.go:129.2,130.23 1 1
-github.com/ethereum/go-ethereum/abi/type.go:133.3,133.34 1 1
-github.com/ethereum/go-ethereum/abi/type.go:134.2,135.23 1 1
-github.com/ethereum/go-ethereum/abi/type.go:138.3,138.34 1 1
-github.com/ethereum/go-ethereum/abi/type.go:139.2,142.49 1 1
-github.com/ethereum/go-ethereum/abi/type.go:145.3,145.34 1 1
-github.com/ethereum/go-ethereum/abi/type.go:146.2,147.42 1 1
-github.com/ethereum/go-ethereum/abi/type.go:150.3,150.60 1 1
-github.com/ethereum/go-ethereum/abi/type.go:151.2,152.42 1 1
-github.com/ethereum/go-ethereum/abi/type.go:157.3,157.23 1 1
-github.com/ethereum/go-ethereum/abi/type.go:162.3,162.78 1 1
-github.com/ethereum/go-ethereum/abi/type.go:166.3,167.36 2 1
-github.com/ethereum/go-ethereum/abi/type.go:170.3,170.21 1 1
-github.com/ethereum/go-ethereum/abi/type.go:171.2,172.19 1 1
-github.com/ethereum/go-ethereum/abi/type.go:130.23,132.4 1 0
-github.com/ethereum/go-ethereum/abi/type.go:135.23,137.4 1 0
-github.com/ethereum/go-ethereum/abi/type.go:142.49,144.4 1 1
-github.com/ethereum/go-ethereum/abi/type.go:147.42,149.4 1 1
-github.com/ethereum/go-ethereum/abi/type.go:152.42,154.4 1 1
-github.com/ethereum/go-ethereum/abi/type.go:157.23,159.4 1 1
-github.com/ethereum/go-ethereum/abi/type.go:162.78,164.4 1 0
-github.com/ethereum/go-ethereum/abi/type.go:167.36,169.4 1 1
-github.com/ethereum/go-ethereum/abi/type.go:172.19,174.4 1 1
-github.com/ethereum/go-ethereum/abi/type.go:174.4,176.4 1 0

+ 2 - 1
blockpool/blockpool.go

@@ -33,7 +33,7 @@ var (
 	// timeout interval: max time allowed for peer without sending a block
 	blocksTimeout = 60 * time.Second
 	//
-	idleBestPeerTimeout = 60 * time.Second
+	idleBestPeerTimeout = 120 * time.Second
 )
 
 // config embedded in components, by default fall back to constants
@@ -568,6 +568,7 @@ func (self *BlockPool) AddBlock(block *types.Block, peerId string) {
 			// sender.currentBlockC <- block
 
 			self.status.lock.Lock()
+			self.status.values.BlockHashes++
 			self.status.values.Blocks++
 			self.status.values.BlocksInPool++
 			self.status.lock.Unlock()

+ 31 - 23
blockpool/peers.go

@@ -41,8 +41,7 @@ type peer struct {
 	idleC   chan bool
 	switchC chan bool
 
-	quit chan bool
-	bp   *BlockPool
+	bp *BlockPool
 
 	// timers for head section process
 	blockHashesRequestTimer <-chan time.Time
@@ -360,6 +359,7 @@ func (self *peers) getPeer(id string) (p *peer, best bool) {
 func (self *peer) handleSection(sec *section) {
 	self.lock.Lock()
 	defer self.lock.Unlock()
+	plog.DebugDetailf("HeadSection: <%s> (head: %s) head section received [%s]-[%s]", self.id, hex(self.currentBlockHash), sectionhex(self.headSection), sectionhex(sec))
 
 	self.headSection = sec
 	self.blockHashesRequestTimer = nil
@@ -379,7 +379,7 @@ func (self *peer) handleSection(sec *section) {
 			self.idle = true
 			self.bp.wg.Done()
 		}
-		plog.DebugDetailf("HeadSection: <%s> head section [%s] created", self.id, sectionhex(sec))
+		plog.DebugDetailf("HeadSection: <%s> (head: %s) head section [%s] created", self.id, hex(self.currentBlockHash), sectionhex(sec))
 		self.suicideC = time.After(self.bp.Config.IdleBestPeerTimeout)
 	}
 }
@@ -408,7 +408,7 @@ func (self *peer) getCurrentBlock(currentBlock *types.Block) {
 	defer self.lock.Unlock()
 	self.currentBlock = currentBlock
 	self.parentHash = currentBlock.ParentHash()
-	plog.DebugDetailf("HeadSection: <%s> head block %s found (parent: [%s])... requesting  hashes", self.id, hex(self.currentBlockHash), hex(self.parentHash))
+	plog.DebugDetailf("HeadSection: <%s> head block %s found (parent: %s)... requesting  hashes", self.id, hex(self.currentBlockHash), hex(self.parentHash))
 	self.blockHashesRequestTimer = time.After(0)
 	self.blocksRequestTimer = nil
 }
@@ -418,13 +418,25 @@ func (self *peer) getBlockHashes() {
 	if self.bp.hasBlock(self.parentHash) {
 		plog.DebugDetailf("HeadSection: <%s> parent block %s found in blockchain", self.id, hex(self.parentHash))
 		err := self.bp.insertChain(types.Blocks([]*types.Block{self.currentBlock}))
+
+		self.bp.status.lock.Lock()
+		self.bp.status.badPeers[self.id]++
+		self.bp.status.values.BlocksInChain++
+		self.bp.status.values.BlocksInPool--
 		if err != nil {
 			self.addError(ErrInvalidBlock, "%v", err)
-
-			self.bp.status.lock.Lock()
 			self.bp.status.badPeers[self.id]++
-			self.bp.status.lock.Unlock()
+		} else {
+			headKey := string(self.parentHash)
+			height := self.bp.status.chain[headKey] + 1
+			self.bp.status.chain[string(self.currentBlockHash)] = height
+			if height > self.bp.status.values.LongestChain {
+				self.bp.status.values.LongestChain = height
+			}
+			delete(self.bp.status.chain, headKey)
 		}
+		self.bp.status.lock.Unlock()
+
 	} else {
 		if parent := self.bp.get(self.parentHash); parent != nil {
 			if self.bp.get(self.currentBlockHash) == nil {
@@ -450,7 +462,7 @@ func (self *peer) getBlockHashes() {
 	self.blockHashesRequestTimer = nil
 	if !self.idle {
 		self.idle = true
-		self.suicideC = time.After(self.bp.Config.IdleBestPeerTimeout)
+		self.suicideC = nil
 		self.bp.wg.Done()
 	}
 }
@@ -460,7 +472,6 @@ func (self *peer) run() {
 
 	self.lock.RLock()
 	switchC := self.switchC
-	currentBlockHash := self.currentBlockHash
 	self.lock.RUnlock()
 
 	self.blockHashesRequestTimer = nil
@@ -468,7 +479,7 @@ func (self *peer) run() {
 	self.blocksRequestTimer = time.After(0)
 	self.suicideC = time.After(self.bp.Config.BlockHashesTimeout)
 
-	var quit chan bool
+	var quit <-chan time.Time
 
 	var ping = time.NewTicker(5 * time.Second)
 
@@ -479,25 +490,16 @@ LOOP:
 		case <-ping.C:
 			plog.Debugf("HeadSection: <%s> section with head %s, idle: %v", self.id, hex(self.currentBlockHash), self.idle)
 
-		// idle timer started when process goes idle
-		case <-self.idleC:
-			if self.idle {
-				self.peerError(self.bp.peers.errors.New(ErrIdleTooLong, "timed out without providing new blocks...quitting", currentBlockHash))
-
-				self.bp.status.lock.Lock()
-				self.bp.status.badPeers[self.id]++
-				self.bp.status.lock.Unlock()
-			}
-
 		// signal from AddBlockHashes that head section for current best peer is created
 		// if sec == nil, it signals that chain info has updated (new block message)
 		case sec := <-self.headSectionC:
 			self.handleSection(sec)
-			// local var quit channel is linked to sections suicide channel so that
 			if sec == nil {
+				plog.Debugf("HeadSection: <%s> (headsection [%s], received: [%s]) quit channel set to nil, catchup happening", self.id, sectionhex(self.headSection), sectionhex(sec))
 				quit = nil
 			} else {
-				quit = sec.suicideC
+				plog.Debugf("HeadSection: <%s> (headsection [%s], received: [%s]) quit channel set to go off in IdleBestPeerTimeout", self.id, sectionhex(self.headSection), sectionhex(sec))
+				quit = time.After(self.bp.Config.IdleBestPeerTimeout)
 			}
 
 		// periodic check for block hashes or parent block/section
@@ -514,7 +516,7 @@ LOOP:
 
 		// quitting on timeout
 		case <-self.suicideC:
-			self.peerError(self.bp.peers.errors.New(ErrInsufficientChainInfo, "timed out without providing block hashes or head block %x", currentBlockHash))
+			self.peerError(self.bp.peers.errors.New(ErrInsufficientChainInfo, "timed out without providing block hashes or head block (td: %v, head: %s)", self.td, hex(self.currentBlockHash)))
 
 			self.bp.status.lock.Lock()
 			self.bp.status.badPeers[self.id]++
@@ -537,6 +539,12 @@ LOOP:
 
 		// quit
 		case <-quit:
+			self.peerError(self.bp.peers.errors.New(ErrIdleTooLong, "timed out without providing new blocks (td: %v, head: %s)...quitting", self.td, self.currentBlockHash))
+
+			self.bp.status.lock.Lock()
+			self.bp.status.badPeers[self.id]++
+			self.bp.status.lock.Unlock()
+			plog.Debugf("HeadSection: <%s> (headsection [%s]) quit channel closed : timed out without providing new blocks...quitting", self.id, sectionhex(self.headSection))
 			break LOOP
 		}
 	}

+ 6 - 2
cmd/blocktest/main.go

@@ -125,11 +125,15 @@ func main() {
 }
 
 func memchain() *core.ChainManager {
-	db, err := ethdb.NewMemDatabase()
+	blockdb, err := ethdb.NewMemDatabase()
 	if err != nil {
 		utils.Fatalf("Could not create in-memory database: %v", err)
 	}
-	return core.NewChainManager(db, new(event.TypeMux))
+	statedb, err := ethdb.NewMemDatabase()
+	if err != nil {
+		utils.Fatalf("Could not create in-memory database: %v", err)
+	}
+	return core.NewChainManager(blockdb, statedb, new(event.TypeMux))
 }
 
 func loadBlocksFromTestFile(filePath string) (blocks types.Blocks, err error) {

+ 3 - 3
cmd/ethereum/js.go

@@ -46,7 +46,7 @@ func execJsFile(ethereum *eth.Ethereum, filename string) {
 	if err != nil {
 		utils.Fatalf("%v", err)
 	}
-	re := javascript.NewJSRE(xeth.New(ethereum))
+	re := javascript.NewJSRE(xeth.New(ethereum, nil))
 	if _, err := re.Run(string(content)); err != nil {
 		utils.Fatalf("Javascript Error: %v", err)
 	}
@@ -61,7 +61,7 @@ type repl struct {
 }
 
 func runREPL(ethereum *eth.Ethereum) {
-	xeth := xeth.New(ethereum)
+	xeth := xeth.New(ethereum, nil)
 	repl := &repl{
 		re:       javascript.NewJSRE(xeth),
 		xeth:     xeth,
@@ -229,7 +229,7 @@ func (self *repl) dump(call otto.FunctionCall) otto.Value {
 		block = self.ethereum.ChainManager().CurrentBlock()
 	}
 
-	statedb := state.New(block.Root(), self.ethereum.Db())
+	statedb := state.New(block.Root(), self.ethereum.StateDb())
 
 	v, _ := self.re.Vm.ToValue(statedb.RawDump())
 

+ 6 - 5
cmd/ethereum/main.go

@@ -40,7 +40,7 @@ import (
 
 const (
 	ClientIdentifier = "Ethereum(G)"
-	Version          = "0.8.6"
+	Version          = "0.9.0"
 )
 
 var (
@@ -121,7 +121,8 @@ runtime will execute the file and exit.
 		utils.RPCEnabledFlag,
 		utils.RPCListenAddrFlag,
 		utils.RPCPortFlag,
-		utils.VMTypeFlag,
+		utils.VMDebugFlag,
+		//utils.VMTypeFlag,
 	}
 
 	// missing:
@@ -212,7 +213,7 @@ func importchain(ctx *cli.Context) {
 	if len(ctx.Args()) != 1 {
 		utils.Fatalf("This command requires an argument.")
 	}
-	chain, _ := utils.GetChain(ctx)
+	chain, _, _ := utils.GetChain(ctx)
 	start := time.Now()
 	err := utils.ImportChain(chain, ctx.Args().First())
 	if err != nil {
@@ -223,7 +224,7 @@ func importchain(ctx *cli.Context) {
 }
 
 func dump(ctx *cli.Context) {
-	chain, db := utils.GetChain(ctx)
+	chain, _, stateDb := utils.GetChain(ctx)
 	for _, arg := range ctx.Args() {
 		var block *types.Block
 		if hashish(arg) {
@@ -236,7 +237,7 @@ func dump(ctx *cli.Context) {
 			fmt.Println("{}")
 			utils.Fatalf("block not found")
 		} else {
-			statedb := state.New(block.Root(), db)
+			statedb := state.New(block.Root(), stateDb)
 			fmt.Printf("%s\n", statedb.Dump())
 			// fmt.Println(block)
 		}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 567 - 136
cmd/mist/assets/ext/ethereum.js/dist/ethereum.js


+ 1 - 1
cmd/mist/assets/qml/main.qml

@@ -986,7 +986,7 @@ ApplicationWindow {
                  anchors.top: parent.top
                  anchors.topMargin: 30
                  font.pointSize: 12
-                 text: "<h2>Mist (0.8.6)</h2><br><h3>Development</h3>Jeffrey Wilcke<br>Viktor Trón<br>Felix Lange<br>Taylor Gerring<br>Daniel Nagy<br>Gustav Simonsson<br><h3>UX/UI</h3>Alex van de Sande<br>Fabian Vogelsteller"
+                 text: "<h2>Mist (0.9.0)</h2><br><h3>Development</h3>Jeffrey Wilcke<br>Viktor Trón<br>Felix Lange<br>Taylor Gerring<br>Daniel Nagy<br>Gustav Simonsson<br><h3>UX/UI</h3>Alex van de Sande<br>Fabian Vogelsteller"
              }
          }
 

+ 1 - 1
cmd/mist/bindings.go

@@ -84,7 +84,7 @@ func (self *Gui) DumpState(hash, path string) {
 			return
 		}
 
-		stateDump = state.New(block.Root(), self.eth.Db()).Dump()
+		stateDump = state.New(block.Root(), self.eth.StateDb()).Dump()
 	}
 
 	file, err := os.OpenFile(path[7:], os.O_CREATE|os.O_RDWR, os.ModePerm)

+ 0 - 117
cmd/mist/ext_app.go

@@ -1,117 +0,0 @@
-/*
-	This file is part of go-ethereum
-
-	go-ethereum is free software: you can redistribute it and/or modify
-	it under the terms of the GNU General Public License as published by
-	the Free Software Foundation, either version 3 of the License, or
-	(at your option) any later version.
-
-	go-ethereum is distributed in the hope that it will be useful,
-	but WITHOUT ANY WARRANTY; without even the implied warranty of
-	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-	GNU General Public License for more details.
-
-	You should have received a copy of the GNU General Public License
-	along with go-ethereum.  If not, see <http://www.gnu.org/licenses/>.
-*/
-/**
- * @authors
- * 	Jeffrey Wilcke <i@jev.io>
- */
-package main
-
-import (
-	"github.com/ethereum/go-ethereum/core"
-	"github.com/ethereum/go-ethereum/core/types"
-	"github.com/ethereum/go-ethereum/event"
-	"github.com/ethereum/go-ethereum/xeth"
-	"github.com/obscuren/qml"
-)
-
-type AppContainer interface {
-	Create() error
-	Destroy()
-
-	Window() *qml.Window
-	Engine() *qml.Engine
-
-	NewBlock(*types.Block)
-	NewWatcher(chan bool)
-	Post(string, int)
-}
-
-type ExtApplication struct {
-	*xeth.XEth
-	eth core.Backend
-
-	events          event.Subscription
-	watcherQuitChan chan bool
-
-	filters map[string]*core.Filter
-
-	container AppContainer
-	lib       *UiLib
-}
-
-func NewExtApplication(container AppContainer, lib *UiLib) *ExtApplication {
-	return &ExtApplication{
-		XEth:            xeth.New(lib.eth),
-		eth:             lib.eth,
-		watcherQuitChan: make(chan bool),
-		filters:         make(map[string]*core.Filter),
-		container:       container,
-		lib:             lib,
-	}
-}
-
-func (app *ExtApplication) run() {
-	// Set the "eth" api on to the containers context
-	context := app.container.Engine().Context()
-	context.SetVar("eth", app)
-	context.SetVar("ui", app.lib)
-
-	err := app.container.Create()
-	if err != nil {
-		guilogger.Errorln(err)
-		return
-	}
-
-	// Call the main loop
-	go app.mainLoop()
-
-	app.container.NewWatcher(app.watcherQuitChan)
-
-	win := app.container.Window()
-	win.Show()
-	win.Wait()
-
-	app.stop()
-}
-
-func (app *ExtApplication) stop() {
-	app.events.Unsubscribe()
-
-	// Kill the main loop
-	app.watcherQuitChan <- true
-
-	app.container.Destroy()
-}
-
-func (app *ExtApplication) mainLoop() {
-	for ev := range app.events.Chan() {
-		switch ev := ev.(type) {
-		case core.NewBlockEvent:
-			app.container.NewBlock(ev.Block)
-
-			/* TODO remove
-			case state.Messages:
-				for id, filter := range app.filters {
-					msgs := filter.FilterMessages(ev)
-					if len(msgs) > 0 {
-						app.container.Messages(msgs, id)
-					}
-				}
-			*/
-		}
-	}
-}

+ 1 - 1
cmd/mist/gui.go

@@ -85,7 +85,7 @@ func NewWindow(ethereum *eth.Ethereum) *Gui {
 		panic(err)
 	}
 
-	xeth := xeth.New(ethereum)
+	xeth := xeth.New(ethereum, nil)
 	gui := &Gui{eth: ethereum,
 		txDb:          db,
 		xeth:          xeth,

+ 1 - 1
cmd/mist/main.go

@@ -36,7 +36,7 @@ import (
 
 const (
 	ClientIdentifier = "Mist"
-	Version          = "0.8.6"
+	Version          = "0.9.0"
 )
 
 var (

+ 1 - 19
cmd/mist/ui_lib.go

@@ -58,7 +58,7 @@ type UiLib struct {
 }
 
 func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib {
-	x := xeth.New(eth)
+	x := xeth.New(eth, nil)
 	lib := &UiLib{XEth: x, engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(x), filterCallbacks: make(map[int][]int)} //, filters: make(map[int]*xeth.JSFilter)}
 	lib.filterManager = filter.NewFilterManager(eth.EventMux())
 	go lib.filterManager.Start()
@@ -91,24 +91,6 @@ func (self *UiLib) EvalJavascriptString(str string) string {
 	return fmt.Sprintf("%v", value)
 }
 
-func (ui *UiLib) OpenQml(path string) {
-	container := NewQmlApplication(path[7:], ui)
-	app := NewExtApplication(container, ui)
-
-	go app.run()
-}
-
-func (ui *UiLib) OpenHtml(path string) {
-	container := NewHtmlApplication(path, ui)
-	app := NewExtApplication(container, ui)
-
-	go app.run()
-}
-
-func (ui *UiLib) OpenBrowser() {
-	ui.OpenHtml("file://" + ui.AssetPath("ext/home.html"))
-}
-
 func (ui *UiLib) Muted(content string) {
 	component, err := ui.engine.LoadFile(ui.AssetPath("qml/muted.qml"))
 	if err != nil {

+ 1 - 1
cmd/utils/cmd.go

@@ -145,7 +145,7 @@ func BlockDo(ethereum *eth.Ethereum, hash []byte) error {
 
 	parent := ethereum.ChainManager().GetBlock(block.ParentHash())
 
-	statedb := state.New(parent.Root(), ethereum.Db())
+	statedb := state.New(parent.Root(), ethereum.StateDb())
 	_, err := ethereum.BlockProcessor().TransitionState(statedb, parent, block, true)
 	if err != nil {
 		return err

+ 19 - 7
cmd/utils/flags.go

@@ -45,9 +45,15 @@ func NewApp(version, usage string) *cli.App {
 
 var (
 	// General settings
-	VMTypeFlag = cli.IntFlag{
-		Name:  "vm",
-		Usage: "Virtual Machine type: 0 is standard VM, 1 is debug VM",
+	/*
+		VMTypeFlag = cli.IntFlag{
+			Name:  "vm",
+			Usage: "Virtual Machine type: 0 is standard VM, 1 is debug VM",
+		}
+	*/
+	VMDebugFlag = cli.BoolFlag{
+		Name:  "vmdebug",
+		Usage: "Virtual Machine debug output",
 	}
 	DataDirFlag = cli.StringFlag{
 		Name:  "datadir",
@@ -161,6 +167,7 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum {
 		LogFormat:      ctx.GlobalString(LogFormatFlag.Name),
 		MinerThreads:   ctx.GlobalInt(MinerThreadsFlag.Name),
 		AccountManager: GetAccountManager(ctx),
+		VmDebug:        ctx.GlobalBool(VMDebugFlag.Name),
 		MaxPeers:       ctx.GlobalInt(MaxPeersFlag.Name),
 		Port:           ctx.GlobalString(ListenPortFlag.Name),
 		NAT:            GetNAT(ctx),
@@ -175,13 +182,18 @@ func GetEthereum(clientID, version string, ctx *cli.Context) *eth.Ethereum {
 	return ethereum
 }
 
-func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database) {
+func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database, ethutil.Database) {
 	dataDir := ctx.GlobalString(DataDirFlag.Name)
-	db, err := ethdb.NewLDBDatabase(path.Join(dataDir, "blockchain"))
+	blockDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "blockchain"))
+	if err != nil {
+		Fatalf("Could not open database: %v", err)
+	}
+
+	stateDb, err := ethdb.NewLDBDatabase(path.Join(dataDir, "state"))
 	if err != nil {
 		Fatalf("Could not open database: %v", err)
 	}
-	return core.NewChainManager(db, new(event.TypeMux)), db
+	return core.NewChainManager(blockDb, stateDb, new(event.TypeMux)), blockDb, stateDb
 }
 
 func GetAccountManager(ctx *cli.Context) *accounts.Manager {
@@ -199,5 +211,5 @@ func StartRPC(eth *eth.Ethereum, ctx *cli.Context) {
 	if err != nil {
 		Fatalf("Can't listen on %s:%d: %v", addr, port, err)
 	}
-	go http.Serve(l, rpc.JSONRPC(xeth.New(eth), dataDir))
+	go http.Serve(l, rpc.JSONRPC(xeth.New(eth, nil), dataDir))
 }

+ 5 - 4
core/block_processor_test.go

@@ -6,14 +6,15 @@ import (
 
 	"github.com/ethereum/go-ethereum/ethdb"
 	"github.com/ethereum/go-ethereum/event"
+	"github.com/ethereum/go-ethereum/pow/ezp"
 )
 
 func proc() (*BlockProcessor, *ChainManager) {
 	db, _ := ethdb.NewMemDatabase()
 	var mux event.TypeMux
 
-	chainMan := NewChainManager(db, &mux)
-	return NewBlockProcessor(db, nil, chainMan, &mux), chainMan
+	chainMan := NewChainManager(db, db, &mux)
+	return NewBlockProcessor(db, ezp.New(), nil, chainMan, &mux), chainMan
 }
 
 func TestNumber(t *testing.T) {
@@ -21,13 +22,13 @@ func TestNumber(t *testing.T) {
 	block1 := chain.NewBlock(nil)
 	block1.Header().Number = big.NewInt(3)
 
-	err := bp.ValidateBlock(block1, chain.Genesis())
+	err := bp.ValidateHeader(block1.Header(), chain.Genesis().Header())
 	if err != BlockNumberErr {
 		t.Errorf("expected block number error")
 	}
 
 	block1 = chain.NewBlock(nil)
-	err = bp.ValidateBlock(block1, chain.Genesis())
+	err = bp.ValidateHeader(block1.Header(), chain.Genesis().Header())
 	if err == BlockNumberErr {
 		t.Errorf("didn't expect block number error")
 	}

+ 1 - 1
core/chain_makers.go

@@ -108,7 +108,7 @@ func makeChain(bman *BlockProcessor, parent *types.Block, max int, db ethutil.Da
 // Create a new chain manager starting from given block
 // Effectively a fork factory
 func newChainManager(block *types.Block, eventMux *event.TypeMux, db ethutil.Database) *ChainManager {
-	bc := &ChainManager{db: db, genesisBlock: GenesisBlock(db), eventMux: eventMux}
+	bc := &ChainManager{blockDb: db, stateDb: db, genesisBlock: GenesisBlock(db), eventMux: eventMux}
 	if block == nil {
 		bc.Reset()
 	} else {

+ 80 - 47
core/chain_manager.go

@@ -19,11 +19,6 @@ var (
 	jsonlogger  = logger.NewJsonLogger()
 )
 
-type ChainEvent struct {
-	Block *types.Block
-	Td    *big.Int
-}
-
 type StateQuery interface {
 	GetAccount(addr []byte) *state.StateObject
 }
@@ -66,7 +61,6 @@ func CalcGasLimit(parent, block *types.Block) *big.Int {
 	}
 
 	// ((1024-1) * parent.gasLimit + (gasUsed * 6 / 5)) / 1024
-
 	previous := new(big.Int).Mul(big.NewInt(1024-1), parent.GasLimit())
 	current := new(big.Rat).Mul(new(big.Rat).SetInt(parent.GasUsed()), big.NewRat(6, 5))
 	curInt := new(big.Int).Div(current.Num(), current.Denom())
@@ -81,7 +75,8 @@ func CalcGasLimit(parent, block *types.Block) *big.Int {
 
 type ChainManager struct {
 	//eth          EthManager
-	db           ethutil.Database
+	blockDb      ethutil.Database
+	stateDb      ethutil.Database
 	processor    types.BlockProcessor
 	eventMux     *event.TypeMux
 	genesisBlock *types.Block
@@ -94,13 +89,16 @@ type ChainManager struct {
 
 	transState *state.StateDB
 	txState    *state.StateDB
+
+	quit chan struct{}
 }
 
-func NewChainManager(db ethutil.Database, mux *event.TypeMux) *ChainManager {
-	bc := &ChainManager{db: db, genesisBlock: GenesisBlock(db), eventMux: mux}
+func NewChainManager(blockDb, stateDb ethutil.Database, mux *event.TypeMux) *ChainManager {
+	bc := &ChainManager{blockDb: blockDb, stateDb: stateDb, genesisBlock: GenesisBlock(stateDb), eventMux: mux, quit: make(chan struct{})}
 	bc.setLastBlock()
 	bc.transState = bc.State().Copy()
 	bc.txState = bc.State().Copy()
+	go bc.update()
 
 	return bc
 }
@@ -138,7 +136,7 @@ func (self *ChainManager) SetProcessor(proc types.BlockProcessor) {
 }
 
 func (self *ChainManager) State() *state.StateDB {
-	return state.New(self.CurrentBlock().Root(), self.db)
+	return state.New(self.CurrentBlock().Root(), self.stateDb)
 }
 
 func (self *ChainManager) TransState() *state.StateDB {
@@ -166,7 +164,7 @@ func (self *ChainManager) setTransState(statedb *state.StateDB) {
 }
 
 func (bc *ChainManager) setLastBlock() {
-	data, _ := bc.db.Get([]byte("LastBlock"))
+	data, _ := bc.blockDb.Get([]byte("LastBlock"))
 	if len(data) != 0 {
 		var block types.Block
 		rlp.Decode(bytes.NewReader(data), &block)
@@ -174,7 +172,7 @@ func (bc *ChainManager) setLastBlock() {
 		bc.lastBlockHash = block.Hash()
 
 		// Set the last know difficulty (might be 0x0 as initial value, Genesis)
-		bc.td = ethutil.BigD(bc.db.LastKnownTD())
+		bc.td = ethutil.BigD(bc.blockDb.LastKnownTD())
 	} else {
 		bc.Reset()
 	}
@@ -223,7 +221,7 @@ func (bc *ChainManager) Reset() {
 	defer bc.mu.Unlock()
 
 	for block := bc.currentBlock; block != nil; block = bc.GetBlock(block.Header().ParentHash) {
-		bc.db.Delete(block.Hash())
+		bc.blockDb.Delete(block.Hash())
 	}
 
 	// Prepare the genesis block
@@ -239,7 +237,7 @@ func (bc *ChainManager) ResetWithGenesisBlock(gb *types.Block) {
 	defer bc.mu.Unlock()
 
 	for block := bc.currentBlock; block != nil; block = bc.GetBlock(block.Header().ParentHash) {
-		bc.db.Delete(block.Hash())
+		bc.blockDb.Delete(block.Hash())
 	}
 
 	// Prepare the genesis block
@@ -265,14 +263,14 @@ func (self *ChainManager) Export() []byte {
 
 func (bc *ChainManager) insert(block *types.Block) {
 	encodedBlock := ethutil.Encode(block)
-	bc.db.Put([]byte("LastBlock"), encodedBlock)
+	bc.blockDb.Put([]byte("LastBlock"), encodedBlock)
 	bc.currentBlock = block
 	bc.lastBlockHash = block.Hash()
 }
 
 func (bc *ChainManager) write(block *types.Block) {
 	encodedBlock := ethutil.Encode(block.RlpDataForStorage())
-	bc.db.Put(block.Hash(), encodedBlock)
+	bc.blockDb.Put(block.Hash(), encodedBlock)
 }
 
 // Accessors
@@ -282,7 +280,7 @@ func (bc *ChainManager) Genesis() *types.Block {
 
 // Block fetching methods
 func (bc *ChainManager) HasBlock(hash []byte) bool {
-	data, _ := bc.db.Get(hash)
+	data, _ := bc.blockDb.Get(hash)
 	return len(data) != 0
 }
 
@@ -291,7 +289,6 @@ func (self *ChainManager) GetBlockHashesFromHash(hash []byte, max uint64) (chain
 	if block == nil {
 		return
 	}
-
 	// XXX Could be optimised by using a different database which only holds hashes (i.e., linked list)
 	for i := uint64(0); i < max; i++ {
 		parentHash := block.Header().ParentHash
@@ -311,7 +308,7 @@ func (self *ChainManager) GetBlockHashesFromHash(hash []byte, max uint64) (chain
 }
 
 func (self *ChainManager) GetBlock(hash []byte) *types.Block {
-	data, _ := self.db.Get(hash)
+	data, _ := self.blockDb.Get(hash)
 	if len(data) == 0 {
 		return nil
 	}
@@ -365,7 +362,7 @@ func (self *ChainManager) GetBlockByNumber(num uint64) *types.Block {
 }
 
 func (bc *ChainManager) setTotalDifficulty(td *big.Int) {
-	bc.db.Put([]byte("LTD"), td.Bytes())
+	bc.blockDb.Put([]byte("LTD"), td.Bytes())
 	bc.td = td
 }
 
@@ -390,19 +387,24 @@ func (self *ChainManager) CalcTotalDiff(block *types.Block) (*big.Int, error) {
 }
 
 func (bc *ChainManager) Stop() {
-	if bc.CurrentBlock != nil {
-		chainlogger.Infoln("Stopped")
-	}
+	close(bc.quit)
 }
 
-func (self *ChainManager) InsertChain(chain types.Blocks) error {
-	println("insert chain start")
-	self.tsmu.Lock()
-	defer self.tsmu.Unlock()
+type queueEvent struct {
+	queue          []interface{}
+	canonicalCount int
+	sideCount      int
+	splitCount     int
+}
 
-	defer println("insert chain end")
+func (self *ChainManager) InsertChain(chain types.Blocks) error {
+	//self.tsmu.Lock()
+	//defer self.tsmu.Unlock()
 
-	for _, block := range chain {
+	// A queued approach to delivering events. This is generally faster than direct delivery and requires much less mutex acquiring.
+	var queue = make([]interface{}, len(chain))
+	var queueEvent = queueEvent{queue: queue}
+	for i, block := range chain {
 		// Call in to the block processor and check for errors. It's likely that if one block fails
 		// all others will fail too (unless a known block is returned).
 		td, err := self.processor.Process(block)
@@ -419,7 +421,6 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
 		}
 		block.Td = td
 
-		var canonical, split bool
 		self.mu.Lock()
 		cblock := self.currentBlock
 		{
@@ -431,41 +432,73 @@ func (self *ChainManager) InsertChain(chain types.Blocks) error {
 			if td.Cmp(self.td) > 0 {
 				if block.Header().Number.Cmp(new(big.Int).Add(cblock.Header().Number, ethutil.Big1)) < 0 {
 					chainlogger.Infof("Split detected. New head #%v (%x) TD=%v, was #%v (%x) TD=%v\n", block.Header().Number, block.Hash()[:4], td, cblock.Header().Number, cblock.Hash()[:4], self.td)
-					split = true
+
+					queue[i] = ChainSplitEvent{block}
+					queueEvent.splitCount++
 				}
 
 				self.setTotalDifficulty(td)
 				self.insert(block)
 
-				canonical = true
-			}
-		}
-		self.mu.Unlock()
-
-		if canonical {
-			/*
 				jsonlogger.LogJson(&logger.EthChainNewHead{
 					BlockHash:     ethutil.Bytes2Hex(block.Hash()),
 					BlockNumber:   block.Number(),
 					ChainHeadHash: ethutil.Bytes2Hex(cblock.Hash()),
 					BlockPrevHash: ethutil.Bytes2Hex(block.ParentHash()),
 				})
-			*/
-			self.setTransState(state.New(block.Root(), self.db))
-			self.eventMux.Post(ChainEvent{block, td})
-		} else {
-			//self.eventMux.
-		}
 
-		if split {
-			self.setTxState(state.New(block.Root(), self.db))
-			self.eventMux.Post(ChainSplitEvent{block})
+				self.setTransState(state.New(block.Root(), self.stateDb))
+				queue[i] = ChainEvent{block}
+				queueEvent.canonicalCount++
+			} else {
+				queue[i] = ChainSideEvent{block}
+				queueEvent.sideCount++
+			}
 		}
+		self.mu.Unlock()
+
 	}
 
+	// XXX put this in a goroutine?
+	go self.eventMux.Post(queueEvent)
+
 	return nil
 }
 
+func (self *ChainManager) update() {
+	events := self.eventMux.Subscribe(queueEvent{})
+
+out:
+	for {
+		select {
+		case ev := <-events.Chan():
+			switch ev := ev.(type) {
+			case queueEvent:
+				for i, event := range ev.queue {
+					switch event := event.(type) {
+					case ChainEvent:
+						// We need some control over the mining operation. Acquiring locks and waiting for the miner to create new block takes too long
+						// and in most cases isn't even necessary.
+						if i == ev.canonicalCount {
+							self.eventMux.Post(ChainHeadEvent{event.Block})
+						}
+					case ChainSplitEvent:
+						// On chain splits we need to reset the transaction state. We can't be sure whether the actual
+						// state of the accounts are still valid.
+						if i == ev.splitCount {
+							self.setTxState(state.New(event.Block.Root(), self.stateDb))
+						}
+					}
+
+					self.eventMux.Post(event)
+				}
+			}
+		case <-self.quit:
+			break out
+		}
+	}
+}
+
 // Satisfy state query interface
 func (self *ChainManager) GetAccount(addr []byte) *state.StateObject {
 	return self.State().GetAccount(addr)

+ 5 - 5
core/chain_manager_test.go

@@ -257,9 +257,9 @@ func TestChainInsertions(t *testing.T) {
 	}
 
 	var eventMux event.TypeMux
-	chainMan := NewChainManager(db, &eventMux)
+	chainMan := NewChainManager(db, db, &eventMux)
 	txPool := NewTxPool(&eventMux)
-	blockMan := NewBlockProcessor(db, txPool, chainMan, &eventMux)
+	blockMan := NewBlockProcessor(db, nil, txPool, chainMan, &eventMux)
 	chainMan.SetProcessor(blockMan)
 
 	const max = 2
@@ -303,9 +303,9 @@ func TestChainMultipleInsertions(t *testing.T) {
 		}
 	}
 	var eventMux event.TypeMux
-	chainMan := NewChainManager(db, &eventMux)
+	chainMan := NewChainManager(db, db, &eventMux)
 	txPool := NewTxPool(&eventMux)
-	blockMan := NewBlockProcessor(db, txPool, chainMan, &eventMux)
+	blockMan := NewBlockProcessor(db, nil, txPool, chainMan, &eventMux)
 	chainMan.SetProcessor(blockMan)
 	done := make(chan bool, max)
 	for i, chain := range chains {
@@ -332,7 +332,7 @@ func TestGetAncestors(t *testing.T) {
 
 	db, _ := ethdb.NewMemDatabase()
 	var eventMux event.TypeMux
-	chainMan := NewChainManager(db, &eventMux)
+	chainMan := NewChainManager(db, db, &eventMux)
 	chain, err := loadChain("valid1", t)
 	if err != nil {
 		fmt.Println(err)

+ 16 - 0
core/error.go

@@ -146,3 +146,19 @@ func IsKnownBlockErr(e error) bool {
 	_, ok := e.(*KnownBlockError)
 	return ok
 }
+
+type ValueTransferError struct {
+	message string
+}
+
+func ValueTransferErr(str string, v ...interface{}) *ValueTransferError {
+	return &ValueTransferError{fmt.Sprintf(str, v...)}
+}
+
+func (self *ValueTransferError) Error() string {
+	return self.message
+}
+func IsValueTransferErr(e error) bool {
+	_, ok := e.(*ValueTransferError)
+	return ok
+}

+ 10 - 0
core/events.go

@@ -16,3 +16,13 @@ type NewMinedBlockEvent struct{ Block *types.Block }
 
 // ChainSplit is posted when a new head is detected
 type ChainSplitEvent struct{ Block *types.Block }
+
+type ChainEvent struct{ Block *types.Block }
+
+type ChainSideEvent struct{ Block *types.Block }
+
+type ChainHeadEvent struct{ Block *types.Block }
+
+// Mining operation events
+type StartMining struct{}
+type TopMining struct{}

+ 5 - 3
core/execution.go

@@ -1,7 +1,6 @@
 package core
 
 import (
-	"fmt"
 	"math/big"
 	"time"
 
@@ -26,7 +25,10 @@ func (self *Execution) Addr() []byte {
 
 func (self *Execution) Call(codeAddr []byte, caller vm.ContextRef) ([]byte, error) {
 	// Retrieve the executing code
-	code := self.env.State().GetCode(codeAddr)
+	var code []byte
+	if self.env.State().GetStateObject(codeAddr) != nil {
+		code = self.env.State().GetCode(codeAddr)
+	}
 
 	return self.exec(code, codeAddr, caller)
 }
@@ -55,7 +57,7 @@ func (self *Execution) exec(code, contextAddr []byte, caller vm.ContextRef) (ret
 
 		caller.ReturnGas(self.Gas, self.price)
 
-		return nil, fmt.Errorf("insufficient funds to transfer value. Req %v, has %v", self.value, from.Balance())
+		return nil, ValueTransferErr("insufficient funds to transfer value. Req %v, has %v", self.value, from.Balance())
 	}
 
 	snapshot := env.State().Copy()

+ 2 - 1
core/manager.go

@@ -13,6 +13,7 @@ type Backend interface {
 	PeerCount() int
 	IsListening() bool
 	Peers() []*p2p.Peer
-	Db() ethutil.Database
+	BlockDb() ethutil.Database
+	StateDb() ethutil.Database
 	EventMux() *event.TypeMux
 }

+ 9 - 3
core/state_transition.go

@@ -184,7 +184,7 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
 		}
 	}
 	if err = self.UseGas(big.NewInt(dgas)); err != nil {
-		return
+		return nil, InvalidTxError(err)
 	}
 
 	//stateCopy := self.env.State().Copy()
@@ -230,10 +230,16 @@ func (self *StateTransition) TransitionState() (ret []byte, err error) {
 		*/
 	}
 
-	if err != nil {
-		self.UseGas(self.gas)
+	if err != nil && IsValueTransferErr(err) {
+		return nil, InvalidTxError(err)
 	}
 
+	/*
+		if err != nil {
+			self.UseGas(self.gas)
+		}
+	*/
+
 	return
 }
 

+ 21 - 9
eth/backend.go

@@ -20,6 +20,7 @@ import (
 	"github.com/ethereum/go-ethereum/p2p"
 	"github.com/ethereum/go-ethereum/p2p/discover"
 	"github.com/ethereum/go-ethereum/p2p/nat"
+	"github.com/ethereum/go-ethereum/vm"
 	"github.com/ethereum/go-ethereum/whisper"
 )
 
@@ -41,6 +42,7 @@ type Config struct {
 	LogFile   string
 	LogLevel  int
 	LogFormat string
+	VmDebug   bool
 
 	MaxPeers int
 	Port     string
@@ -106,7 +108,8 @@ type Ethereum struct {
 	shutdownChan chan bool
 
 	// DB interface
-	db ethutil.Database
+	blockDb ethutil.Database
+	stateDb ethutil.Database
 
 	//*** SERVICES ***
 	// State manager for processing new blocks and managing the over all states
@@ -133,25 +136,30 @@ func New(config *Config) (*Ethereum, error) {
 	// Boostrap database
 	ethlogger := logger.New(config.DataDir, config.LogFile, config.LogLevel, config.LogFormat)
 
-	db, err := ethdb.NewLDBDatabase(path.Join(config.DataDir, "blockchain"))
+	blockDb, err := ethdb.NewLDBDatabase(path.Join(config.DataDir, "blockchain"))
+	if err != nil {
+		return nil, err
+	}
+	stateDb, err := ethdb.NewLDBDatabase(path.Join(config.DataDir, "state"))
 	if err != nil {
 		return nil, err
 	}
 
 	// Perform database sanity checks
-	d, _ := db.Get([]byte("ProtocolVersion"))
+	d, _ := blockDb.Get([]byte("ProtocolVersion"))
 	protov := ethutil.NewValue(d).Uint()
 	if protov != ProtocolVersion && protov != 0 {
 		path := path.Join(config.DataDir, "blockchain")
 		return nil, fmt.Errorf("Database version mismatch. Protocol(%d / %d). `rm -rf %s`", protov, ProtocolVersion, path)
 	}
 
-	saveProtocolVersion(db)
+	saveProtocolVersion(blockDb)
 	//ethutil.Config.Db = db
 
 	eth := &Ethereum{
 		shutdownChan:   make(chan bool),
-		db:             db,
+		blockDb:        blockDb,
+		stateDb:        stateDb,
 		eventMux:       &event.TypeMux{},
 		logger:         ethlogger,
 		accountManager: config.AccountManager,
@@ -163,10 +171,10 @@ func New(config *Config) (*Ethereum, error) {
 		return nil, fmt.Errorf("no coinbase: %v", err)
 	}
 
-	eth.chainManager = core.NewChainManager(db, eth.EventMux())
+	eth.chainManager = core.NewChainManager(blockDb, stateDb, eth.EventMux())
 	pow := ethash.New(eth.chainManager)
 	eth.txPool = core.NewTxPool(eth.EventMux())
-	eth.blockProcessor = core.NewBlockProcessor(db, pow, eth.txPool, eth.chainManager, eth.EventMux())
+	eth.blockProcessor = core.NewBlockProcessor(stateDb, pow, eth.txPool, eth.chainManager, eth.EventMux())
 	eth.chainManager.SetProcessor(eth.blockProcessor)
 	eth.whisper = whisper.New()
 	eth.miner = miner.New(cb, eth, pow, config.MinerThreads)
@@ -198,6 +206,8 @@ func New(config *Config) (*Ethereum, error) {
 		eth.net.ListenAddr = ":" + config.Port
 	}
 
+	vm.Debug = config.VmDebug
+
 	return eth, nil
 }
 
@@ -210,7 +220,8 @@ func (s *Ethereum) TxPool() *core.TxPool                 { return s.txPool }
 func (s *Ethereum) BlockPool() *blockpool.BlockPool      { return s.blockPool }
 func (s *Ethereum) Whisper() *whisper.Whisper            { return s.whisper }
 func (s *Ethereum) EventMux() *event.TypeMux             { return s.eventMux }
-func (s *Ethereum) Db() ethutil.Database                 { return s.db }
+func (s *Ethereum) BlockDb() ethutil.Database            { return s.blockDb }
+func (s *Ethereum) StateDb() ethutil.Database            { return s.stateDb }
 func (s *Ethereum) Miner() *miner.Miner                  { return s.miner }
 func (s *Ethereum) IsListening() bool                    { return true } // Always listening
 func (s *Ethereum) PeerCount() int                       { return s.net.PeerCount() }
@@ -260,7 +271,8 @@ func (self *Ethereum) SuggestPeer(nodeURL string) error {
 
 func (s *Ethereum) Stop() {
 	// Close the database
-	defer s.db.Close()
+	defer s.blockDb.Close()
+	defer s.stateDb.Close()
 
 	s.txSub.Unsubscribe()    // quits txBroadcastLoop
 	s.blockSub.Unsubscribe() // quits blockBroadcastLoop

+ 1 - 2
eth/protocol.go

@@ -253,10 +253,9 @@ func (self *ethProtocol) handle() error {
 	case NewBlockMsg:
 		var request newBlockMsgData
 		if err := msg.Decode(&request); err != nil {
-			return self.protoError(ErrDecode, "msg %v: %v", msg, err)
+			return self.protoError(ErrDecode, "%v: %v", msg, err)
 		}
 		hash := request.Block.Hash()
-		fmt.Printf("received block: %x\n", hash)
 		_, chainHead, _ := self.chainManager.Status()
 
 		jsonlogger.LogJson(&logger.EthChainReceivedNewBlock{

+ 1 - 0
eth/protocol_test.go

@@ -13,6 +13,7 @@ import (
 	"github.com/ethereum/go-ethereum/crypto"
 	"github.com/ethereum/go-ethereum/errs"
 	"github.com/ethereum/go-ethereum/ethutil"
+	ethlogger "github.com/ethereum/go-ethereum/logger"
 	"github.com/ethereum/go-ethereum/p2p"
 	"github.com/ethereum/go-ethereum/p2p/discover"
 )

+ 65 - 0
ethutil/natspec/natspec.go

@@ -0,0 +1,65 @@
+package natspec
+
+import (
+	"github.com/obscuren/otto"
+	"io/ioutil"
+)
+
+type NatSpec struct {
+	jsvm *otto.Otto
+}
+
+func NewNATSpec(transaction string) (self *NatSpec, err error) {
+
+	self = new(NatSpec)
+	self.jsvm = otto.New()
+	code, err := ioutil.ReadFile("natspec.js")
+	if err != nil {
+		return
+	}
+
+	_, err = self.jsvm.Run(string(code))
+	if err != nil {
+		return
+	}
+	_, err = self.jsvm.Run("var natspec = require('natspec');")
+	if err != nil {
+		return
+	}
+
+	self.jsvm.Run("var transaction = " + transaction + ";")
+
+	return
+}
+
+func (self *NatSpec) SetDescription(desc string) (err error) {
+
+	_, err = self.jsvm.Run("var expression = \"" + desc + "\";")
+	return
+
+}
+
+func (self *NatSpec) SetABI(abi string) (err error) {
+
+	_, err = self.jsvm.Run("var abi = " + abi + ";")
+	return
+
+}
+
+func (self *NatSpec) SetMethod(method string) (err error) {
+
+	_, err = self.jsvm.Run("var method = '" + method + "';")
+	return
+
+}
+
+func (self *NatSpec) Parse() string {
+
+	self.jsvm.Run("var call = {method: method,abi: abi,transaction: transaction};")
+	value, err := self.jsvm.Run("natspec.evaluateExpression(expression, call);")
+	if err != nil {
+		return err.Error()
+	}
+	return value.String()
+
+}

+ 3517 - 0
ethutil/natspec/natspec.js

@@ -0,0 +1,3517 @@
+require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
+
+},{}],2:[function(require,module,exports){
+// shim for using process in browser
+
+var process = module.exports = {};
+var queue = [];
+var draining = false;
+
+function drainQueue() {
+    if (draining) {
+        return;
+    }
+    draining = true;
+    var currentQueue;
+    var len = queue.length;
+    while(len) {
+        currentQueue = queue;
+        queue = [];
+        var i = -1;
+        while (++i < len) {
+            currentQueue[i]();
+        }
+        len = queue.length;
+    }
+    draining = false;
+}
+process.nextTick = function (fun) {
+    queue.push(fun);
+    if (!draining) {
+        setTimeout(drainQueue, 0);
+    }
+};
+
+process.title = 'browser';
+process.browser = true;
+process.env = {};
+process.argv = [];
+process.version = ''; // empty string to avoid regexp issues
+
+function noop() {}
+
+process.on = noop;
+process.addListener = noop;
+process.once = noop;
+process.off = noop;
+process.removeListener = noop;
+process.removeAllListeners = noop;
+process.emit = noop;
+
+process.binding = function (name) {
+    throw new Error('process.binding is not supported');
+};
+
+// TODO(shtylman)
+process.cwd = function () { return '/' };
+process.chdir = function (dir) {
+    throw new Error('process.chdir is not supported');
+};
+process.umask = function() { return 0; };
+
+},{}],3:[function(require,module,exports){
+/*
+    This file is part of ethereum.js.
+
+    ethereum.js is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    ethereum.js is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with ethereum.js.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file abi.js
+ * @authors:
+ *   Marek Kotewicz <marek@ethdev.com>
+ *   Gav Wood <g@ethdev.com>
+ * @date 2014
+ */
+
+var utils = require('./utils');
+var types = require('./types');
+var c = require('./const');
+var f = require('./formatters');
+
+var displayTypeError = function (type) {
+    console.error('parser does not support type: ' + type);
+};
+
+/// This method should be called if we want to check if givent type is an array type
+/// @returns true if it is, otherwise false
+var arrayType = function (type) {
+    return type.slice(-2) === '[]';
+};
+
+var dynamicTypeBytes = function (type, value) {
+    // TODO: decide what to do with array of strings
+    if (arrayType(type) || type === 'string')    // only string itself that is dynamic; stringX is static length.
+        return f.formatInputInt(value.length);
+    return "";
+};
+
+var inputTypes = types.inputTypes();
+
+/// Formats input params to bytes
+/// @param abi contract method inputs
+/// @param array of params that will be formatted to bytes
+/// @returns bytes representation of input params
+var formatInput = function (inputs, params) {
+    var bytes = "";
+    var toAppendConstant = "";
+    var toAppendArrayContent = "";
+
+    /// first we iterate in search for dynamic
+    inputs.forEach(function (input, index) {
+        bytes += dynamicTypeBytes(input.type, params[index]);
+    });
+
+    inputs.forEach(function (input, i) {
+        /*jshint maxcomplexity:5 */
+        var typeMatch = false;
+        for (var j = 0; j < inputTypes.length && !typeMatch; j++) {
+            typeMatch = inputTypes[j].type(inputs[i].type, params[i]);
+        }
+        if (!typeMatch) {
+            displayTypeError(inputs[i].type);
+        }
+
+        var formatter = inputTypes[j - 1].format;
+
+        if (arrayType(inputs[i].type))
+            toAppendArrayContent += params[i].reduce(function (acc, curr) {
+                return acc + formatter(curr);
+            }, "");
+        else if (inputs[i].type === 'string')
+            toAppendArrayContent += formatter(params[i]);
+        else
+            toAppendConstant += formatter(params[i]);
+    });
+
+    bytes += toAppendConstant + toAppendArrayContent;
+
+    return bytes;
+};
+
+var dynamicBytesLength = function (type) {
+    if (arrayType(type) || type === 'string')   // only string itself that is dynamic; stringX is static length.
+        return c.ETH_PADDING * 2;
+    return 0;
+};
+
+var outputTypes = types.outputTypes();
+
+/// Formats output bytes back to param list
+/// @param contract abi method outputs
+/// @param bytes representtion of output
+/// @returns array of output params
+var formatOutput = function (outs, output) {
+
+    output = output.slice(2);
+    var result = [];
+    var padding = c.ETH_PADDING * 2;
+
+    var dynamicPartLength = outs.reduce(function (acc, curr) {
+        return acc + dynamicBytesLength(curr.type);
+    }, 0);
+
+    var dynamicPart = output.slice(0, dynamicPartLength);
+    output = output.slice(dynamicPartLength);
+
+    outs.forEach(function (out, i) {
+        /*jshint maxcomplexity:6 */
+        var typeMatch = false;
+        for (var j = 0; j < outputTypes.length && !typeMatch; j++) {
+            typeMatch = outputTypes[j].type(outs[i].type);
+        }
+
+        if (!typeMatch) {
+            displayTypeError(outs[i].type);
+        }
+
+        var formatter = outputTypes[j - 1].format;
+        if (arrayType(outs[i].type)) {
+            var size = f.formatOutputUInt(dynamicPart.slice(0, padding));
+            dynamicPart = dynamicPart.slice(padding);
+            var array = [];
+            for (var k = 0; k < size; k++) {
+                array.push(formatter(output.slice(0, padding)));
+                output = output.slice(padding);
+            }
+            result.push(array);
+        }
+        else if (types.prefixedType('string')(outs[i].type)) {
+            dynamicPart = dynamicPart.slice(padding);
+            result.push(formatter(output.slice(0, padding)));
+            output = output.slice(padding);
+        } else {
+            result.push(formatter(output.slice(0, padding)));
+            output = output.slice(padding);
+        }
+    });
+
+    return result;
+};
+
+/// @param json abi for contract
+/// @returns input parser object for given json abi
+/// TODO: refactor creating the parser, do not double logic from contract
+var inputParser = function (json) {
+    var parser = {};
+    json.forEach(function (method) {
+        var displayName = utils.extractDisplayName(method.name);
+        var typeName = utils.extractTypeName(method.name);
+
+        var impl = function () {
+            var params = Array.prototype.slice.call(arguments);
+            return formatInput(method.inputs, params);
+        };
+
+        if (parser[displayName] === undefined) {
+            parser[displayName] = impl;
+        }
+
+        parser[displayName][typeName] = impl;
+    });
+
+    return parser;
+};
+
+/// @param json abi for contract
+/// @returns output parser for given json abi
+var outputParser = function (json) {
+    var parser = {};
+    json.forEach(function (method) {
+
+        var displayName = utils.extractDisplayName(method.name);
+        var typeName = utils.extractTypeName(method.name);
+
+        var impl = function (output) {
+            return formatOutput(method.outputs, output);
+        };
+
+        if (parser[displayName] === undefined) {
+            parser[displayName] = impl;
+        }
+
+        parser[displayName][typeName] = impl;
+    });
+
+    return parser;
+};
+
+module.exports = {
+    inputParser: inputParser,
+    outputParser: outputParser,
+    formatInput: formatInput,
+    formatOutput: formatOutput
+};
+
+},{"./const":4,"./formatters":5,"./types":6,"./utils":7}],4:[function(require,module,exports){
+(function (process){
+/*
+    This file is part of ethereum.js.
+
+    ethereum.js is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    ethereum.js is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with ethereum.js.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file const.js
+ * @authors:
+ *   Marek Kotewicz <marek@ethdev.com>
+ * @date 2015
+ */
+
+/// required to define ETH_BIGNUMBER_ROUNDING_MODE
+if (process.env.NODE_ENV !== 'build') {
+    var BigNumber = require('bignumber.js'); // jshint ignore:line
+}
+
+var ETH_UNITS = [ 
+    'wei', 
+    'Kwei', 
+    'Mwei', 
+    'Gwei', 
+    'szabo', 
+    'finney', 
+    'ether', 
+    'grand', 
+    'Mether', 
+    'Gether', 
+    'Tether', 
+    'Pether', 
+    'Eether', 
+    'Zether', 
+    'Yether', 
+    'Nether', 
+    'Dether', 
+    'Vether', 
+    'Uether' 
+];
+
+module.exports = {
+    ETH_PADDING: 32,
+    ETH_SIGNATURE_LENGTH: 4,
+    ETH_UNITS: ETH_UNITS,
+    ETH_BIGNUMBER_ROUNDING_MODE: { ROUNDING_MODE: BigNumber.ROUND_DOWN },
+    ETH_POLLING_TIMEOUT: 1000
+};
+
+
+}).call(this,require('_process'))
+},{"_process":2,"bignumber.js":8}],5:[function(require,module,exports){
+(function (process){
+/*
+    This file is part of ethereum.js.
+
+    ethereum.js is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    ethereum.js is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with ethereum.js.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file formatters.js
+ * @authors:
+ *   Marek Kotewicz <marek@ethdev.com>
+ * @date 2015
+ */
+
+if (process.env.NODE_ENV !== 'build') {
+    var BigNumber = require('bignumber.js'); // jshint ignore:line
+}
+
+var utils = require('./utils');
+var c = require('./const');
+
+/// @param string string to be padded
+/// @param number of characters that result string should have
+/// @param sign, by default 0
+/// @returns right aligned string
+var padLeft = function (string, chars, sign) {
+    return new Array(chars - string.length + 1).join(sign ? sign : "0") + string;
+};
+
+/// Formats input value to byte representation of int
+/// If value is negative, return it's two's complement
+/// If the value is floating point, round it down
+/// @returns right-aligned byte representation of int
+var formatInputInt = function (value) {
+    /*jshint maxcomplexity:7 */
+    var padding = c.ETH_PADDING * 2;
+    if (value instanceof BigNumber || typeof value === 'number') {
+        if (typeof value === 'number')
+            value = new BigNumber(value);
+        BigNumber.config(c.ETH_BIGNUMBER_ROUNDING_MODE);
+        value = value.round();
+
+        if (value.lessThan(0)) 
+            value = new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16).plus(value).plus(1);
+        value = value.toString(16);
+    }
+    else if (value.indexOf('0x') === 0)
+        value = value.substr(2);
+    else if (typeof value === 'string')
+        value = formatInputInt(new BigNumber(value));
+    else
+        value = (+value).toString(16);
+    return padLeft(value, padding);
+};
+
+/// Formats input value to byte representation of string
+/// @returns left-algined byte representation of string
+var formatInputString = function (value) {
+    return utils.fromAscii(value, c.ETH_PADDING).substr(2);
+};
+
+/// Formats input value to byte representation of bool
+/// @returns right-aligned byte representation bool
+var formatInputBool = function (value) {
+    return '000000000000000000000000000000000000000000000000000000000000000' + (value ?  '1' : '0');
+};
+
+/// Formats input value to byte representation of real
+/// Values are multiplied by 2^m and encoded as integers
+/// @returns byte representation of real
+var formatInputReal = function (value) {
+    return formatInputInt(new BigNumber(value).times(new BigNumber(2).pow(128))); 
+};
+
+
+/// Check if input value is negative
+/// @param value is hex format
+/// @returns true if it is negative, otherwise false
+var signedIsNegative = function (value) {
+    return (new BigNumber(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';
+};
+
+/// Formats input right-aligned input bytes to int
+/// @returns right-aligned input bytes formatted to int
+var formatOutputInt = function (value) {
+    value = value || "0";
+    // check if it's negative number
+    // it it is, return two's complement
+    if (signedIsNegative(value)) {
+        return new BigNumber(value, 16).minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)).minus(1);
+    }
+    return new BigNumber(value, 16);
+};
+
+/// Formats big right-aligned input bytes to uint
+/// @returns right-aligned input bytes formatted to uint
+var formatOutputUInt = function (value) {
+    value = value || "0";
+    return new BigNumber(value, 16);
+};
+
+/// @returns input bytes formatted to real
+var formatOutputReal = function (value) {
+    return formatOutputInt(value).dividedBy(new BigNumber(2).pow(128)); 
+};
+
+/// @returns input bytes formatted to ureal
+var formatOutputUReal = function (value) {
+    return formatOutputUInt(value).dividedBy(new BigNumber(2).pow(128)); 
+};
+
+/// @returns right-aligned input bytes formatted to hex
+var formatOutputHash = function (value) {
+    return "0x" + value;
+};
+
+/// @returns right-aligned input bytes formatted to bool
+var formatOutputBool = function (value) {
+    return value === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false;
+};
+
+/// @returns left-aligned input bytes formatted to ascii string
+var formatOutputString = function (value) {
+    return utils.toAscii(value);
+};
+
+/// @returns right-aligned input bytes formatted to address
+var formatOutputAddress = function (value) {
+    return "0x" + value.slice(value.length - 40, value.length);
+};
+
+
+module.exports = {
+    formatInputInt: formatInputInt,
+    formatInputString: formatInputString,
+    formatInputBool: formatInputBool,
+    formatInputReal: formatInputReal,
+    formatOutputInt: formatOutputInt,
+    formatOutputUInt: formatOutputUInt,
+    formatOutputReal: formatOutputReal,
+    formatOutputUReal: formatOutputUReal,
+    formatOutputHash: formatOutputHash,
+    formatOutputBool: formatOutputBool,
+    formatOutputString: formatOutputString,
+    formatOutputAddress: formatOutputAddress
+};
+
+
+}).call(this,require('_process'))
+},{"./const":4,"./utils":7,"_process":2,"bignumber.js":8}],6:[function(require,module,exports){
+/*
+    This file is part of ethereum.js.
+
+    ethereum.js is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    ethereum.js is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with ethereum.js.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file types.js
+ * @authors:
+ *   Marek Kotewicz <marek@ethdev.com>
+ * @date 2015
+ */
+
+var f = require('./formatters');
+
+/// @param expected type prefix (string)
+/// @returns function which checks if type has matching prefix. if yes, returns true, otherwise false
+var prefixedType = function (prefix) {
+    return function (type) {
+        return type.indexOf(prefix) === 0;
+    };
+};
+
+/// @param expected type name (string)
+/// @returns function which checks if type is matching expected one. if yes, returns true, otherwise false
+var namedType = function (name) {
+    return function (type) {
+        return name === type;
+    };
+};
+
+/// Setups input formatters for solidity types
+/// @returns an array of input formatters 
+var inputTypes = function () {
+    
+    return [
+        { type: prefixedType('uint'), format: f.formatInputInt },
+        { type: prefixedType('int'), format: f.formatInputInt },
+        { type: prefixedType('hash'), format: f.formatInputInt },
+        { type: prefixedType('string'), format: f.formatInputString }, 
+        { type: prefixedType('real'), format: f.formatInputReal },
+        { type: prefixedType('ureal'), format: f.formatInputReal },
+        { type: namedType('address'), format: f.formatInputInt },
+        { type: namedType('bool'), format: f.formatInputBool }
+    ];
+};
+
+/// Setups output formaters for solidity types
+/// @returns an array of output formatters
+var outputTypes = function () {
+
+    return [
+        { type: prefixedType('uint'), format: f.formatOutputUInt },
+        { type: prefixedType('int'), format: f.formatOutputInt },
+        { type: prefixedType('hash'), format: f.formatOutputHash },
+        { type: prefixedType('string'), format: f.formatOutputString },
+        { type: prefixedType('real'), format: f.formatOutputReal },
+        { type: prefixedType('ureal'), format: f.formatOutputUReal },
+        { type: namedType('address'), format: f.formatOutputAddress },
+        { type: namedType('bool'), format: f.formatOutputBool }
+    ];
+};
+
+module.exports = {
+    prefixedType: prefixedType,
+    namedType: namedType,
+    inputTypes: inputTypes,
+    outputTypes: outputTypes
+};
+
+
+},{"./formatters":5}],7:[function(require,module,exports){
+/*
+    This file is part of ethereum.js.
+
+    ethereum.js is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    ethereum.js is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with ethereum.js.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file utils.js
+ * @authors:
+ *   Marek Kotewicz <marek@ethdev.com>
+ * @date 2015
+ */
+
+var c = require('./const');
+
+/// Finds first index of array element matching pattern
+/// @param array
+/// @param callback pattern
+/// @returns index of element
+var findIndex = function (array, callback) {
+    var end = false;
+    var i = 0;
+    for (; i < array.length && !end; i++) {
+        end = callback(array[i]);
+    }
+    return end ? i - 1 : -1;
+};
+
+/// @returns ascii string representation of hex value prefixed with 0x
+var toAscii = function(hex) {
+// Find termination
+    var str = "";
+    var i = 0, l = hex.length;
+    if (hex.substring(0, 2) === '0x') {
+        i = 2;
+    }
+    for (; i < l; i+=2) {
+        var code = parseInt(hex.substr(i, 2), 16);
+        if (code === 0) {
+            break;
+        }
+
+        str += String.fromCharCode(code);
+    }
+
+    return str;
+};
+    
+var toHex = function(str) {
+    var hex = "";
+    for(var i = 0; i < str.length; i++) {
+        var n = str.charCodeAt(i).toString(16);
+        hex += n.length < 2 ? '0' + n : n;
+    }
+
+    return hex;
+};
+
+/// @returns hex representation (prefixed by 0x) of ascii string
+var fromAscii = function(str, pad) {
+    pad = pad === undefined ? 0 : pad;
+    var hex = toHex(str);
+    while (hex.length < pad*2)
+        hex += "00";
+    return "0x" + hex;
+};
+
+/// @returns display name for function/event eg. multiply(uint256) -> multiply
+var extractDisplayName = function (name) {
+    var length = name.indexOf('('); 
+    return length !== -1 ? name.substr(0, length) : name;
+};
+
+/// @returns overloaded part of function/event name
+var extractTypeName = function (name) {
+    /// TODO: make it invulnerable
+    var length = name.indexOf('(');
+    return length !== -1 ? name.substr(length + 1, name.length - 1 - (length + 1)).replace(' ', '') : "";
+};
+
+/// Filters all function from input abi
+/// @returns abi array with filtered objects of type 'function'
+var filterFunctions = function (json) {
+    return json.filter(function (current) {
+        return current.type === 'function'; 
+    }); 
+};
+
+/// Filters all events form input abi
+/// @returns abi array with filtered objects of type 'event'
+var filterEvents = function (json) {
+    return json.filter(function (current) {
+        return current.type === 'event';
+    });
+};
+
+/// used to transform value/string to eth string
+/// TODO: use BigNumber.js to parse int
+/// TODO: add tests for it!
+var toEth = function (str) {
+     /*jshint maxcomplexity:7 */
+    var val = typeof str === "string" ? str.indexOf('0x') === 0 ? parseInt(str.substr(2), 16) : parseInt(str) : str;
+    var unit = 0;
+    var units = c.ETH_UNITS;
+    while (val > 3000 && unit < units.length - 1)
+    {
+        val /= 1000;
+        unit++;
+    }
+    var s = val.toString().length < val.toFixed(2).length ? val.toString() : val.toFixed(2);
+    var replaceFunction = function($0, $1, $2) {
+        return $1 + ',' + $2;
+    };
+
+    while (true) {
+        var o = s;
+        s = s.replace(/(\d)(\d\d\d[\.\,])/, replaceFunction);
+        if (o === s)
+            break;
+    }
+    return s + ' ' + units[unit];
+};
+
+module.exports = {
+    findIndex: findIndex,
+    toAscii: toAscii,
+    fromAscii: fromAscii,
+    extractDisplayName: extractDisplayName,
+    extractTypeName: extractTypeName,
+    filterFunctions: filterFunctions,
+    filterEvents: filterEvents,
+    toEth: toEth
+};
+
+
+},{"./const":4}],8:[function(require,module,exports){
+/*! bignumber.js v2.0.3 https://github.com/MikeMcl/bignumber.js/LICENCE */
+
+;(function (global) {
+    'use strict';
+
+    /*
+      bignumber.js v2.0.3
+      A JavaScript library for arbitrary-precision arithmetic.
+      https://github.com/MikeMcl/bignumber.js
+      Copyright (c) 2015 Michael Mclaughlin <M8ch88l@gmail.com>
+      MIT Expat Licence
+    */
+
+
+    var BigNumber, crypto, parseNumeric,
+        isNumeric = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,
+        mathceil = Math.ceil,
+        mathfloor = Math.floor,
+        notBool = ' not a boolean or binary digit',
+        roundingMode = 'rounding mode',
+        tooManyDigits = 'number type has more than 15 significant digits',
+        ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_',
+        BASE = 1e14,
+        LOG_BASE = 14,
+        MAX_SAFE_INTEGER = 0x1fffffffffffff,         // 2^53 - 1
+        // MAX_INT32 = 0x7fffffff,                   // 2^31 - 1
+        POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],
+        SQRT_BASE = 1e7,
+
+        /*
+         * The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and
+         * the arguments to toExponential, toFixed, toFormat, and toPrecision, beyond which an
+         * exception is thrown (if ERRORS is true).
+         */
+        MAX = 1E9;                                   // 0 to MAX_INT32
+
+
+    /*
+     * Create and return a BigNumber constructor.
+     */
+    function another(configObj) {
+        var div,
+
+            // id tracks the caller function, so its name can be included in error messages.
+            id = 0,
+            P = BigNumber.prototype,
+            ONE = new BigNumber(1),
+
+
+            /********************************* EDITABLE DEFAULTS **********************************/
+
+
+            /*
+             * The default values below must be integers within the inclusive ranges stated.
+             * The values can also be changed at run-time using BigNumber.config.
+             */
+
+            // The maximum number of decimal places for operations involving division.
+            DECIMAL_PLACES = 20,                     // 0 to MAX
+
+            /*
+             * The rounding mode used when rounding to the above decimal places, and when using
+             * toExponential, toFixed, toFormat and toPrecision, and round (default value).
+             * UP         0 Away from zero.
+             * DOWN       1 Towards zero.
+             * CEIL       2 Towards +Infinity.
+             * FLOOR      3 Towards -Infinity.
+             * HALF_UP    4 Towards nearest neighbour. If equidistant, up.
+             * HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.
+             * HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.
+             * HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.
+             * HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
+             */
+            ROUNDING_MODE = 4,                       // 0 to 8
+
+            // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]
+
+            // The exponent value at and beneath which toString returns exponential notation.
+            // Number type: -7
+            TO_EXP_NEG = -7,                         // 0 to -MAX
+
+            // The exponent value at and above which toString returns exponential notation.
+            // Number type: 21
+            TO_EXP_POS = 21,                         // 0 to MAX
+
+            // RANGE : [MIN_EXP, MAX_EXP]
+
+            // The minimum exponent value, beneath which underflow to zero occurs.
+            // Number type: -324  (5e-324)
+            MIN_EXP = -1e7,                          // -1 to -MAX
+
+            // The maximum exponent value, above which overflow to Infinity occurs.
+            // Number type:  308  (1.7976931348623157e+308)
+            // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.
+            MAX_EXP = 1e7,                           // 1 to MAX
+
+            // Whether BigNumber Errors are ever thrown.
+            ERRORS = true,                           // true or false
+
+            // Change to intValidatorNoErrors if ERRORS is false.
+            isValidInt = intValidatorWithErrors,     // intValidatorWithErrors/intValidatorNoErrors
+
+            // Whether to use cryptographically-secure random number generation, if available.
+            CRYPTO = false,                          // true or false
+
+            /*
+             * The modulo mode used when calculating the modulus: a mod n.
+             * The quotient (q = a / n) is calculated according to the corresponding rounding mode.
+             * The remainder (r) is calculated as: r = a - n * q.
+             *
+             * UP        0 The remainder is positive if the dividend is negative, else is negative.
+             * DOWN      1 The remainder has the same sign as the dividend.
+             *             This modulo mode is commonly known as 'truncated division' and is
+             *             equivalent to (a % n) in JavaScript.
+             * FLOOR     3 The remainder has the same sign as the divisor (Python %).
+             * HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.
+             * EUCLID    9 Euclidian division. q = sign(n) * floor(a / abs(n)).
+             *             The remainder is always positive.
+             *
+             * The truncated division, floored division, Euclidian division and IEEE 754 remainder
+             * modes are commonly used for the modulus operation.
+             * Although the other rounding modes can also be used, they may not give useful results.
+             */
+            MODULO_MODE = 1,                         // 0 to 9
+
+            // The maximum number of significant digits of the result of the toPower operation.
+            // If POW_PRECISION is 0, there will be unlimited significant digits.
+            POW_PRECISION = 100,                     // 0 to MAX
+
+            // The format specification used by the BigNumber.prototype.toFormat method.
+            FORMAT = {
+                decimalSeparator: '.',
+                groupSeparator: ',',
+                groupSize: 3,
+                secondaryGroupSize: 0,
+                fractionGroupSeparator: '\xA0',      // non-breaking space
+                fractionGroupSize: 0
+            };
+
+
+        /******************************************************************************************/
+
+
+        // CONSTRUCTOR
+
+
+        /*
+         * The BigNumber constructor and exported function.
+         * Create and return a new instance of a BigNumber object.
+         *
+         * n {number|string|BigNumber} A numeric value.
+         * [b] {number} The base of n. Integer, 2 to 64 inclusive.
+         */
+        function BigNumber( n, b ) {
+            var c, e, i, num, len, str,
+                x = this;
+
+            // Enable constructor usage without new.
+            if ( !( x instanceof BigNumber ) ) {
+
+                // 'BigNumber() constructor call without new: {n}'
+                if (ERRORS) raise( 26, 'constructor call without new', n );
+                return new BigNumber( n, b );
+            }
+
+            // 'new BigNumber() base not an integer: {b}'
+            // 'new BigNumber() base out of range: {b}'
+            if ( b == null || !isValidInt( b, 2, 64, id, 'base' ) ) {
+
+                // Duplicate.
+                if ( n instanceof BigNumber ) {
+                    x.s = n.s;
+                    x.e = n.e;
+                    x.c = ( n = n.c ) ? n.slice() : n;
+                    id = 0;
+                    return;
+                }
+
+                if ( ( num = typeof n == 'number' ) && n * 0 == 0 ) {
+                    x.s = 1 / n < 0 ? ( n = -n, -1 ) : 1;
+
+                    // Fast path for integers.
+                    if ( n === ~~n ) {
+                        for ( e = 0, i = n; i >= 10; i /= 10, e++ );
+                        x.e = e;
+                        x.c = [n];
+                        id = 0;
+                        return;
+                    }
+
+                    str = n + '';
+                } else {
+                    if ( !isNumeric.test( str = n + '' ) ) return parseNumeric( x, str, num );
+                    x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;
+                }
+            } else {
+                b = b | 0;
+                str = n + '';
+
+                // Ensure return value is rounded to DECIMAL_PLACES as with other bases.
+                // Allow exponential notation to be used with base 10 argument.
+                if ( b == 10 ) {
+                    x = new BigNumber( n instanceof BigNumber ? n : str );
+                    return round( x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE );
+                }
+
+                // Avoid potential interpretation of Infinity and NaN as base 44+ values.
+                // Any number in exponential form will fail due to the [Ee][+-].
+                if ( ( num = typeof n == 'number' ) && n * 0 != 0 ||
+                  !( new RegExp( '^-?' + ( c = '[' + ALPHABET.slice( 0, b ) + ']+' ) +
+                    '(?:\\.' + c + ')?$',b < 37 ? 'i' : '' ) ).test(str) ) {
+                    return parseNumeric( x, str, num, b );
+                }
+
+                if (num) {
+                    x.s = 1 / n < 0 ? ( str = str.slice(1), -1 ) : 1;
+
+                    if ( ERRORS && str.replace( /^0\.0*|\./, '' ).length > 15 ) {
+
+                        // 'new BigNumber() number type has more than 15 significant digits: {n}'
+                        raise( id, tooManyDigits, n );
+                    }
+
+                    // Prevent later check for length on converted number.
+                    num = false;
+                } else {
+                    x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;
+                }
+
+                str = convertBase( str, 10, b, x.s );
+            }
+
+            // Decimal point?
+            if ( ( e = str.indexOf('.') ) > -1 ) str = str.replace( '.', '' );
+
+            // Exponential form?
+            if ( ( i = str.search( /e/i ) ) > 0 ) {
+
+                // Determine exponent.
+                if ( e < 0 ) e = i;
+                e += +str.slice( i + 1 );
+                str = str.substring( 0, i );
+            } else if ( e < 0 ) {
+
+                // Integer.
+                e = str.length;
+            }
+
+            // Determine leading zeros.
+            for ( i = 0; str.charCodeAt(i) === 48; i++ );
+
+            // Determine trailing zeros.
+            for ( len = str.length; str.charCodeAt(--len) === 48; );
+            str = str.slice( i, len + 1 );
+
+            if (str) {
+                len = str.length;
+
+                // Disallow numbers with over 15 significant digits if number type.
+                // 'new BigNumber() number type has more than 15 significant digits: {n}'
+                if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n );
+
+                e = e - i - 1;
+
+                 // Overflow?
+                if ( e > MAX_EXP ) {
+
+                    // Infinity.
+                    x.c = x.e = null;
+
+                // Underflow?
+                } else if ( e < MIN_EXP ) {
+
+                    // Zero.
+                    x.c = [ x.e = 0 ];
+                } else {
+                    x.e = e;
+                    x.c = [];
+
+                    // Transform base
+
+                    // e is the base 10 exponent.
+                    // i is where to slice str to get the first element of the coefficient array.
+                    i = ( e + 1 ) % LOG_BASE;
+                    if ( e < 0 ) i += LOG_BASE;
+
+                    if ( i < len ) {
+                        if (i) x.c.push( +str.slice( 0, i ) );
+
+                        for ( len -= LOG_BASE; i < len; ) {
+                            x.c.push( +str.slice( i, i += LOG_BASE ) );
+                        }
+
+                        str = str.slice(i);
+                        i = LOG_BASE - str.length;
+                    } else {
+                        i -= len;
+                    }
+
+                    for ( ; i--; str += '0' );
+                    x.c.push( +str );
+                }
+            } else {
+
+                // Zero.
+                x.c = [ x.e = 0 ];
+            }
+
+            id = 0;
+        }
+
+
+        // CONSTRUCTOR PROPERTIES
+
+
+        BigNumber.another = another;
+
+        BigNumber.ROUND_UP = 0;
+        BigNumber.ROUND_DOWN = 1;
+        BigNumber.ROUND_CEIL = 2;
+        BigNumber.ROUND_FLOOR = 3;
+        BigNumber.ROUND_HALF_UP = 4;
+        BigNumber.ROUND_HALF_DOWN = 5;
+        BigNumber.ROUND_HALF_EVEN = 6;
+        BigNumber.ROUND_HALF_CEIL = 7;
+        BigNumber.ROUND_HALF_FLOOR = 8;
+        BigNumber.EUCLID = 9;
+
+
+        /*
+         * Configure infrequently-changing library-wide settings.
+         *
+         * Accept an object or an argument list, with one or many of the following properties or
+         * parameters respectively:
+         *
+         *   DECIMAL_PLACES  {number}  Integer, 0 to MAX inclusive
+         *   ROUNDING_MODE   {number}  Integer, 0 to 8 inclusive
+         *   EXPONENTIAL_AT  {number|number[]}  Integer, -MAX to MAX inclusive or
+         *                                      [integer -MAX to 0 incl., 0 to MAX incl.]
+         *   RANGE           {number|number[]}  Non-zero integer, -MAX to MAX inclusive or
+         *                                      [integer -MAX to -1 incl., integer 1 to MAX incl.]
+         *   ERRORS          {boolean|number}   true, false, 1 or 0
+         *   CRYPTO          {boolean|number}   true, false, 1 or 0
+         *   MODULO_MODE     {number}           0 to 9 inclusive
+         *   POW_PRECISION   {number}           0 to MAX inclusive
+         *   FORMAT          {object}           See BigNumber.prototype.toFormat
+         *      decimalSeparator       {string}
+         *      groupSeparator         {string}
+         *      groupSize              {number}
+         *      secondaryGroupSize     {number}
+         *      fractionGroupSeparator {string}
+         *      fractionGroupSize      {number}
+         *
+         * (The values assigned to the above FORMAT object properties are not checked for validity.)
+         *
+         * E.g.
+         * BigNumber.config(20, 4) is equivalent to
+         * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })
+         *
+         * Ignore properties/parameters set to null or undefined.
+         * Return an object with the properties current values.
+         */
+        BigNumber.config = function () {
+            var v, p,
+                i = 0,
+                r = {},
+                a = arguments,
+                o = a[0],
+                has = o && typeof o == 'object'
+                  ? function () { if ( o.hasOwnProperty(p) ) return ( v = o[p] ) != null; }
+                  : function () { if ( a.length > i ) return ( v = a[i++] ) != null; };
+
+            // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.
+            // 'config() DECIMAL_PLACES not an integer: {v}'
+            // 'config() DECIMAL_PLACES out of range: {v}'
+            if ( has( p = 'DECIMAL_PLACES' ) && isValidInt( v, 0, MAX, 2, p ) ) {
+                DECIMAL_PLACES = v | 0;
+            }
+            r[p] = DECIMAL_PLACES;
+
+            // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.
+            // 'config() ROUNDING_MODE not an integer: {v}'
+            // 'config() ROUNDING_MODE out of range: {v}'
+            if ( has( p = 'ROUNDING_MODE' ) && isValidInt( v, 0, 8, 2, p ) ) {
+                ROUNDING_MODE = v | 0;
+            }
+            r[p] = ROUNDING_MODE;
+
+            // EXPONENTIAL_AT {number|number[]}
+            // Integer, -MAX to MAX inclusive or [integer -MAX to 0 inclusive, 0 to MAX inclusive].
+            // 'config() EXPONENTIAL_AT not an integer: {v}'
+            // 'config() EXPONENTIAL_AT out of range: {v}'
+            if ( has( p = 'EXPONENTIAL_AT' ) ) {
+
+                if ( isArray(v) ) {
+                    if ( isValidInt( v[0], -MAX, 0, 2, p ) && isValidInt( v[1], 0, MAX, 2, p ) ) {
+                        TO_EXP_NEG = v[0] | 0;
+                        TO_EXP_POS = v[1] | 0;
+                    }
+                } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {
+                    TO_EXP_NEG = -( TO_EXP_POS = ( v < 0 ? -v : v ) | 0 );
+                }
+            }
+            r[p] = [ TO_EXP_NEG, TO_EXP_POS ];
+
+            // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or
+            // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].
+            // 'config() RANGE not an integer: {v}'
+            // 'config() RANGE cannot be zero: {v}'
+            // 'config() RANGE out of range: {v}'
+            if ( has( p = 'RANGE' ) ) {
+
+                if ( isArray(v) ) {
+                    if ( isValidInt( v[0], -MAX, -1, 2, p ) && isValidInt( v[1], 1, MAX, 2, p ) ) {
+                        MIN_EXP = v[0] | 0;
+                        MAX_EXP = v[1] | 0;
+                    }
+                } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {
+                    if ( v | 0 ) MIN_EXP = -( MAX_EXP = ( v < 0 ? -v : v ) | 0 );
+                    else if (ERRORS) raise( 2, p + ' cannot be zero', v );
+                }
+            }
+            r[p] = [ MIN_EXP, MAX_EXP ];
+
+            // ERRORS {boolean|number} true, false, 1 or 0.
+            // 'config() ERRORS not a boolean or binary digit: {v}'
+            if ( has( p = 'ERRORS' ) ) {
+
+                if ( v === !!v || v === 1 || v === 0 ) {
+                    id = 0;
+                    isValidInt = ( ERRORS = !!v ) ? intValidatorWithErrors : intValidatorNoErrors;
+                } else if (ERRORS) {
+                    raise( 2, p + notBool, v );
+                }
+            }
+            r[p] = ERRORS;
+
+            // CRYPTO {boolean|number} true, false, 1 or 0.
+            // 'config() CRYPTO not a boolean or binary digit: {v}'
+            // 'config() crypto unavailable: {crypto}'
+            if ( has( p = 'CRYPTO' ) ) {
+
+                if ( v === !!v || v === 1 || v === 0 ) {
+                    CRYPTO = !!( v && crypto && typeof crypto == 'object' );
+                    if ( v && !CRYPTO && ERRORS ) raise( 2, 'crypto unavailable', crypto );
+                } else if (ERRORS) {
+                    raise( 2, p + notBool, v );
+                }
+            }
+            r[p] = CRYPTO;
+
+            // MODULO_MODE {number} Integer, 0 to 9 inclusive.
+            // 'config() MODULO_MODE not an integer: {v}'
+            // 'config() MODULO_MODE out of range: {v}'
+            if ( has( p = 'MODULO_MODE' ) && isValidInt( v, 0, 9, 2, p ) ) {
+                MODULO_MODE = v | 0;
+            }
+            r[p] = MODULO_MODE;
+
+            // POW_PRECISION {number} Integer, 0 to MAX inclusive.
+            // 'config() POW_PRECISION not an integer: {v}'
+            // 'config() POW_PRECISION out of range: {v}'
+            if ( has( p = 'POW_PRECISION' ) && isValidInt( v, 0, MAX, 2, p ) ) {
+                POW_PRECISION = v | 0;
+            }
+            r[p] = POW_PRECISION;
+
+            // FORMAT {object}
+            // 'config() FORMAT not an object: {v}'
+            if ( has( p = 'FORMAT' ) ) {
+
+                if ( typeof v == 'object' ) {
+                    FORMAT = v;
+                } else if (ERRORS) {
+                    raise( 2, p + ' not an object', v );
+                }
+            }
+            r[p] = FORMAT;
+
+            return r;
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the maximum of the arguments.
+         *
+         * arguments {number|string|BigNumber}
+         */
+        BigNumber.max = function () { return maxOrMin( arguments, P.lt ); };
+
+
+        /*
+         * Return a new BigNumber whose value is the minimum of the arguments.
+         *
+         * arguments {number|string|BigNumber}
+         */
+        BigNumber.min = function () { return maxOrMin( arguments, P.gt ); };
+
+
+        /*
+         * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,
+         * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing
+         * zeros are produced).
+         *
+         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+         *
+         * 'random() decimal places not an integer: {dp}'
+         * 'random() decimal places out of range: {dp}'
+         * 'random() crypto unavailable: {crypto}'
+         */
+        BigNumber.random = (function () {
+            var pow2_53 = 0x20000000000000;
+
+            // Return a 53 bit integer n, where 0 <= n < 9007199254740992.
+            // Check if Math.random() produces more than 32 bits of randomness.
+            // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.
+            // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.
+            var random53bitInt = (Math.random() * pow2_53) & 0x1fffff
+              ? function () { return mathfloor( Math.random() * pow2_53 ); }
+              : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +
+                  (Math.random() * 0x800000 | 0); };
+
+            return function (dp) {
+                var a, b, e, k, v,
+                    i = 0,
+                    c = [],
+                    rand = new BigNumber(ONE);
+
+                dp = dp == null || !isValidInt( dp, 0, MAX, 14 ) ? DECIMAL_PLACES : dp | 0;
+                k = mathceil( dp / LOG_BASE );
+
+                if (CRYPTO) {
+
+                    // Browsers supporting crypto.getRandomValues.
+                    if ( crypto && crypto.getRandomValues ) {
+
+                        a = crypto.getRandomValues( new Uint32Array( k *= 2 ) );
+
+                        for ( ; i < k; ) {
+
+                            // 53 bits:
+                            // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)
+                            // 11111 11111111 11111111 11111111 11100000 00000000 00000000
+                            // ((Math.pow(2, 32) - 1) >>> 11).toString(2)
+                            //                                     11111 11111111 11111111
+                            // 0x20000 is 2^21.
+                            v = a[i] * 0x20000 + (a[i + 1] >>> 11);
+
+                            // Rejection sampling:
+                            // 0 <= v < 9007199254740992
+                            // Probability that v >= 9e15, is
+                            // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251
+                            if ( v >= 9e15 ) {
+                                b = crypto.getRandomValues( new Uint32Array(2) );
+                                a[i] = b[0];
+                                a[i + 1] = b[1];
+                            } else {
+
+                                // 0 <= v <= 8999999999999999
+                                // 0 <= (v % 1e14) <= 99999999999999
+                                c.push( v % 1e14 );
+                                i += 2;
+                            }
+                        }
+                        i = k / 2;
+
+                    // Node.js supporting crypto.randomBytes.
+                    } else if ( crypto && crypto.randomBytes ) {
+
+                        // buffer
+                        a = crypto.randomBytes( k *= 7 );
+
+                        for ( ; i < k; ) {
+
+                            // 0x1000000000000 is 2^48, 0x10000000000 is 2^40
+                            // 0x100000000 is 2^32, 0x1000000 is 2^24
+                            // 11111 11111111 11111111 11111111 11111111 11111111 11111111
+                            // 0 <= v < 9007199254740992
+                            v = ( ( a[i] & 31 ) * 0x1000000000000 ) + ( a[i + 1] * 0x10000000000 ) +
+                                  ( a[i + 2] * 0x100000000 ) + ( a[i + 3] * 0x1000000 ) +
+                                  ( a[i + 4] << 16 ) + ( a[i + 5] << 8 ) + a[i + 6];
+
+                            if ( v >= 9e15 ) {
+                                crypto.randomBytes(7).copy( a, i );
+                            } else {
+
+                                // 0 <= (v % 1e14) <= 99999999999999
+                                c.push( v % 1e14 );
+                                i += 7;
+                            }
+                        }
+                        i = k / 7;
+                    } else if (ERRORS) {
+                        raise( 14, 'crypto unavailable', crypto );
+                    }
+                }
+
+                // Use Math.random: CRYPTO is false or crypto is unavailable and ERRORS is false.
+                if (!i) {
+
+                    for ( ; i < k; ) {
+                        v = random53bitInt();
+                        if ( v < 9e15 ) c[i++] = v % 1e14;
+                    }
+                }
+
+                k = c[--i];
+                dp %= LOG_BASE;
+
+                // Convert trailing digits to zeros according to dp.
+                if ( k && dp ) {
+                    v = POWS_TEN[LOG_BASE - dp];
+                    c[i] = mathfloor( k / v ) * v;
+                }
+
+                // Remove trailing elements which are zero.
+                for ( ; c[i] === 0; c.pop(), i-- );
+
+                // Zero?
+                if ( i < 0 ) {
+                    c = [ e = 0 ];
+                } else {
+
+                    // Remove leading elements which are zero and adjust exponent accordingly.
+                    for ( e = -1 ; c[0] === 0; c.shift(), e -= LOG_BASE);
+
+                    // Count the digits of the first element of c to determine leading zeros, and...
+                    for ( i = 1, v = c[0]; v >= 10; v /= 10, i++);
+
+                    // adjust the exponent accordingly.
+                    if ( i < LOG_BASE ) e -= LOG_BASE - i;
+                }
+
+                rand.e = e;
+                rand.c = c;
+                return rand;
+            };
+        })();
+
+
+        // PRIVATE FUNCTIONS
+
+
+        // Convert a numeric string of baseIn to a numeric string of baseOut.
+        function convertBase( str, baseOut, baseIn, sign ) {
+            var d, e, k, r, x, xc, y,
+                i = str.indexOf( '.' ),
+                dp = DECIMAL_PLACES,
+                rm = ROUNDING_MODE;
+
+            if ( baseIn < 37 ) str = str.toLowerCase();
+
+            // Non-integer.
+            if ( i >= 0 ) {
+                k = POW_PRECISION;
+
+                // Unlimited precision.
+                POW_PRECISION = 0;
+                str = str.replace( '.', '' );
+                y = new BigNumber(baseIn);
+                x = y.pow( str.length - i );
+                POW_PRECISION = k;
+
+                // Convert str as if an integer, then restore the fraction part by dividing the
+                // result by its base raised to a power.
+                y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );
+                y.e = y.c.length;
+            }
+
+            // Convert the number as integer.
+            xc = toBaseOut( str, baseIn, baseOut );
+            e = k = xc.length;
+
+            // Remove trailing zeros.
+            for ( ; xc[--k] == 0; xc.pop() );
+            if ( !xc[0] ) return '0';
+
+            if ( i < 0 ) {
+                --e;
+            } else {
+                x.c = xc;
+                x.e = e;
+
+                // sign is needed for correct rounding.
+                x.s = sign;
+                x = div( x, y, dp, rm, baseOut );
+                xc = x.c;
+                r = x.r;
+                e = x.e;
+            }
+
+            d = e + dp + 1;
+
+            // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.
+            i = xc[d];
+            k = baseOut / 2;
+            r = r || d < 0 || xc[d + 1] != null;
+
+            r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )
+                       : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||
+                         rm == ( x.s < 0 ? 8 : 7 ) );
+
+            if ( d < 1 || !xc[0] ) {
+
+                // 1^-dp or 0.
+                str = r ? toFixedPoint( '1', -dp ) : '0';
+            } else {
+                xc.length = d;
+
+                if (r) {
+
+                    // Rounding up may mean the previous digit has to be rounded up and so on.
+                    for ( --baseOut; ++xc[--d] > baseOut; ) {
+                        xc[d] = 0;
+
+                        if ( !d ) {
+                            ++e;
+                            xc.unshift(1);
+                        }
+                    }
+                }
+
+                // Determine trailing zeros.
+                for ( k = xc.length; !xc[--k]; );
+
+                // E.g. [4, 11, 15] becomes 4bf.
+                for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );
+                str = toFixedPoint( str, e );
+            }
+
+            // The caller will add the sign.
+            return str;
+        }
+
+
+        // Perform division in the specified base. Called by div and convertBase.
+        div = (function () {
+
+            // Assume non-zero x and k.
+            function multiply( x, k, base ) {
+                var m, temp, xlo, xhi,
+                    carry = 0,
+                    i = x.length,
+                    klo = k % SQRT_BASE,
+                    khi = k / SQRT_BASE | 0;
+
+                for ( x = x.slice(); i--; ) {
+                    xlo = x[i] % SQRT_BASE;
+                    xhi = x[i] / SQRT_BASE | 0;
+                    m = khi * xlo + xhi * klo;
+                    temp = klo * xlo + ( ( m % SQRT_BASE ) * SQRT_BASE ) + carry;
+                    carry = ( temp / base | 0 ) + ( m / SQRT_BASE | 0 ) + khi * xhi;
+                    x[i] = temp % base;
+                }
+
+                if (carry) x.unshift(carry);
+
+                return x;
+            }
+
+            function compare( a, b, aL, bL ) {
+                var i, cmp;
+
+                if ( aL != bL ) {
+                    cmp = aL > bL ? 1 : -1;
+                } else {
+
+                    for ( i = cmp = 0; i < aL; i++ ) {
+
+                        if ( a[i] != b[i] ) {
+                            cmp = a[i] > b[i] ? 1 : -1;
+                            break;
+                        }
+                    }
+                }
+                return cmp;
+            }
+
+            function subtract( a, b, aL, base ) {
+                var i = 0;
+
+                // Subtract b from a.
+                for ( ; aL--; ) {
+                    a[aL] -= i;
+                    i = a[aL] < b[aL] ? 1 : 0;
+                    a[aL] = i * base + a[aL] - b[aL];
+                }
+
+                // Remove leading zeros.
+                for ( ; !a[0] && a.length > 1; a.shift() );
+            }
+
+            // x: dividend, y: divisor.
+            return function ( x, y, dp, rm, base ) {
+                var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,
+                    yL, yz,
+                    s = x.s == y.s ? 1 : -1,
+                    xc = x.c,
+                    yc = y.c;
+
+                // Either NaN, Infinity or 0?
+                if ( !xc || !xc[0] || !yc || !yc[0] ) {
+
+                    return new BigNumber(
+
+                      // Return NaN if either NaN, or both Infinity or 0.
+                      !x.s || !y.s || ( xc ? yc && xc[0] == yc[0] : !yc ) ? NaN :
+
+                        // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
+                        xc && xc[0] == 0 || !yc ? s * 0 : s / 0
+                    );
+                }
+
+                q = new BigNumber(s);
+                qc = q.c = [];
+                e = x.e - y.e;
+                s = dp + e + 1;
+
+                if ( !base ) {
+                    base = BASE;
+                    e = bitFloor( x.e / LOG_BASE ) - bitFloor( y.e / LOG_BASE );
+                    s = s / LOG_BASE | 0;
+                }
+
+                // Result exponent may be one less then the current value of e.
+                // The coefficients of the BigNumbers from convertBase may have trailing zeros.
+                for ( i = 0; yc[i] == ( xc[i] || 0 ); i++ );
+                if ( yc[i] > ( xc[i] || 0 ) ) e--;
+
+                if ( s < 0 ) {
+                    qc.push(1);
+                    more = true;
+                } else {
+                    xL = xc.length;
+                    yL = yc.length;
+                    i = 0;
+                    s += 2;
+
+                    // Normalise xc and yc so highest order digit of yc is >= base/2
+
+                    n = mathfloor( base / ( yc[0] + 1 ) );
+
+                    if ( n > 1 ) {
+                        yc = multiply( yc, n, base );
+                        xc = multiply( xc, n, base );
+                        yL = yc.length;
+                        xL = xc.length;
+                    }
+
+                    xi = yL;
+                    rem = xc.slice( 0, yL );
+                    remL = rem.length;
+
+                    // Add zeros to make remainder as long as divisor.
+                    for ( ; remL < yL; rem[remL++] = 0 );
+                    yz = yc.slice();
+                    yz.unshift(0);
+                    yc0 = yc[0];
+                    if ( yc[1] >= base / 2 ) yc0++;
+
+                    do {
+                        n = 0;
+
+                        // Compare divisor and remainder.
+                        cmp = compare( yc, rem, yL, remL );
+
+                        // If divisor < remainder.
+                        if ( cmp < 0 ) {
+
+                            // Calculate trial digit, n.
+
+                            rem0 = rem[0];
+                            if ( yL != remL ) rem0 = rem0 * base + ( rem[1] || 0 );
+
+                            // n is how many times the divisor goes into the current remainder.
+                            n = mathfloor( rem0 / yc0 );
+
+                            //  Algorithm:
+                            //  1. product = divisor * trial digit (n)
+                            //  2. if product > remainder: product -= divisor, n--
+                            //  3. remainder -= product
+                            //  4. if product was < remainder at 2:
+                            //    5. compare new remainder and divisor
+                            //    6. If remainder > divisor: remainder -= divisor, n++
+
+                            if ( n > 1 ) {
+                                if ( n >= base ) n = base - 1;
+
+                                // product = divisor * trial digit.
+                                prod = multiply( yc, n, base );
+                                prodL = prod.length;
+                                remL = rem.length;
+
+                                // Compare product and remainder.
+                                cmp = compare( prod, rem, prodL, remL );
+
+                                // product > remainder.
+                                if ( cmp == 1 ) {
+                                    n--;
+
+                                    // Subtract divisor from product.
+                                    subtract( prod, yL < prodL ? yz : yc, prodL, base );
+                                }
+                            } else {
+
+                                // cmp is -1.
+                                // If n is 0, there is no need to compare yc and rem again
+                                // below, so change cmp to 1 to avoid it.
+                                // If n is 1, compare yc and rem again below.
+                                if ( n == 0 ) cmp = n = 1;
+                                prod = yc.slice();
+                            }
+
+                            prodL = prod.length;
+                            if ( prodL < remL ) prod.unshift(0);
+
+                            // Subtract product from remainder.
+                            subtract( rem, prod, remL, base );
+
+                            // If product was < previous remainder.
+                            if ( cmp == -1 ) {
+                                remL = rem.length;
+
+                                // Compare divisor and new remainder.
+                                cmp = compare( yc, rem, yL, remL );
+
+                                // If divisor < new remainder, subtract divisor from remainder.
+                                if ( cmp < 1 ) {
+                                    n++;
+
+                                    // Subtract divisor from remainder.
+                                    subtract( rem, yL < remL ? yz : yc, remL, base );
+                                }
+                            }
+                            remL = rem.length;
+                        } else if ( cmp === 0 ) {
+                            n++;
+                            rem = [0];
+                        }
+                        // if cmp === 1, n will be 0
+
+                        // Add the next digit, n, to the result array.
+                        qc[i++] = n;
+
+                        // Update the remainder.
+                        if ( cmp && rem[0] ) {
+                            rem[remL++] = xc[xi] || 0;
+                        } else {
+                            rem = [ xc[xi] ];
+                            remL = 1;
+                        }
+                    } while ( ( xi++ < xL || rem[0] != null ) && s-- );
+
+                    more = rem[0] != null;
+
+                    // Leading zero?
+                    if ( !qc[0] ) qc.shift();
+                }
+
+                if ( base == BASE ) {
+
+                    // To calculate q.e, first get the number of digits of qc[0].
+                    for ( i = 1, s = qc[0]; s >= 10; s /= 10, i++ );
+                    round( q, dp + ( q.e = i + e * LOG_BASE - 1 ) + 1, rm, more );
+
+                // Caller is convertBase.
+                } else {
+                    q.e = e;
+                    q.r = +more;
+                }
+
+                return q;
+            };
+        })();
+
+
+        /*
+         * Return a string representing the value of BigNumber n in fixed-point or exponential
+         * notation rounded to the specified decimal places or significant digits.
+         *
+         * n is a BigNumber.
+         * i is the index of the last digit required (i.e. the digit that may be rounded up).
+         * rm is the rounding mode.
+         * caller is caller id: toExponential 19, toFixed 20, toFormat 21, toPrecision 24.
+         */
+        function format( n, i, rm, caller ) {
+            var c0, e, ne, len, str;
+
+            rm = rm != null && isValidInt( rm, 0, 8, caller, roundingMode )
+              ? rm | 0 : ROUNDING_MODE;
+
+            if ( !n.c ) return n.toString();
+            c0 = n.c[0];
+            ne = n.e;
+
+            if ( i == null ) {
+                str = coeffToString( n.c );
+                str = caller == 19 || caller == 24 && ne <= TO_EXP_NEG
+                  ? toExponential( str, ne )
+                  : toFixedPoint( str, ne );
+            } else {
+                n = round( new BigNumber(n), i, rm );
+
+                // n.e may have changed if the value was rounded up.
+                e = n.e;
+
+                str = coeffToString( n.c );
+                len = str.length;
+
+                // toPrecision returns exponential notation if the number of significant digits
+                // specified is less than the number of digits necessary to represent the integer
+                // part of the value in fixed-point notation.
+
+                // Exponential notation.
+                if ( caller == 19 || caller == 24 && ( i <= e || e <= TO_EXP_NEG ) ) {
+
+                    // Append zeros?
+                    for ( ; len < i; str += '0', len++ );
+                    str = toExponential( str, e );
+
+                // Fixed-point notation.
+                } else {
+                    i -= ne;
+                    str = toFixedPoint( str, e );
+
+                    // Append zeros?
+                    if ( e + 1 > len ) {
+                        if ( --i > 0 ) for ( str += '.'; i--; str += '0' );
+                    } else {
+                        i += e - len;
+                        if ( i > 0 ) {
+                            if ( e + 1 == len ) str += '.';
+                            for ( ; i--; str += '0' );
+                        }
+                    }
+                }
+            }
+
+            return n.s < 0 && c0 ? '-' + str : str;
+        }
+
+
+        // Handle BigNumber.max and BigNumber.min.
+        function maxOrMin( args, method ) {
+            var m, n,
+                i = 0;
+
+            if ( isArray( args[0] ) ) args = args[0];
+            m = new BigNumber( args[0] );
+
+            for ( ; ++i < args.length; ) {
+                n = new BigNumber( args[i] );
+
+                // If any number is NaN, return NaN.
+                if ( !n.s ) {
+                    m = n;
+                    break;
+                } else if ( method.call( m, n ) ) {
+                    m = n;
+                }
+            }
+
+            return m;
+        }
+
+
+        /*
+         * Return true if n is an integer in range, otherwise throw.
+         * Use for argument validation when ERRORS is true.
+         */
+        function intValidatorWithErrors( n, min, max, caller, name ) {
+            if ( n < min || n > max || n != truncate(n) ) {
+                raise( caller, ( name || 'decimal places' ) +
+                  ( n < min || n > max ? ' out of range' : ' not an integer' ), n );
+            }
+
+            return true;
+        }
+
+
+        /*
+         * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.
+         * Called by minus, plus and times.
+         */
+        function normalise( n, c, e ) {
+            var i = 1,
+                j = c.length;
+
+             // Remove trailing zeros.
+            for ( ; !c[--j]; c.pop() );
+
+            // Calculate the base 10 exponent. First get the number of digits of c[0].
+            for ( j = c[0]; j >= 10; j /= 10, i++ );
+
+            // Overflow?
+            if ( ( e = i + e * LOG_BASE - 1 ) > MAX_EXP ) {
+
+                // Infinity.
+                n.c = n.e = null;
+
+            // Underflow?
+            } else if ( e < MIN_EXP ) {
+
+                // Zero.
+                n.c = [ n.e = 0 ];
+            } else {
+                n.e = e;
+                n.c = c;
+            }
+
+            return n;
+        }
+
+
+        // Handle values that fail the validity test in BigNumber.
+        parseNumeric = (function () {
+//            var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i,
+            var basePrefix = /^(-?)0([xbo])/i,
+                dotAfter = /^([^.]+)\.$/,
+                dotBefore = /^\.([^.]+)$/,
+                isInfinityOrNaN = /^-?(Infinity|NaN)$/,
+//                whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
+                whitespaceOrPlus = /^\s*\+[\w.]|^\s+|\s+$/g;
+
+            return function ( x, str, num, b ) {
+                var base,
+                    s = num ? str : str.replace( whitespaceOrPlus, '' );
+
+                // No exception on ±Infinity or NaN.
+                if ( isInfinityOrNaN.test(s) ) {
+                    x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
+                } else {
+                    if ( !num ) {
+
+                        // basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i
+                        s = s.replace( basePrefix, function ( m, p1, p2 ) {
+                            base = ( p2 = p2.toLowerCase() ) == 'x' ? 16 : p2 == 'b' ? 2 : 8;
+                            return !b || b == base ? p1 : m;
+                        });
+
+                        if (b) {
+                            base = b;
+
+                            // E.g. '1.' to '1', '.1' to '0.1'
+                            s = s.replace( dotAfter, '$1' ).replace( dotBefore, '0.$1' );
+                        }
+
+                        if ( str != s ) return new BigNumber( s, base );
+                    }
+
+                    // 'new BigNumber() not a number: {n}'
+                    // 'new BigNumber() not a base {b} number: {n}'
+                    if (ERRORS) raise( id, 'not a' + ( b ? ' base ' + b : '' ) + ' number', str );
+                    x.s = null;
+                }
+
+                x.c = x.e = null;
+                id = 0;
+            }
+        })();
+
+
+        // Throw a BigNumber Error.
+        function raise( caller, msg, val ) {
+            var error = new Error( [
+                'new BigNumber',     // 0
+                'cmp',               // 1
+                'config',            // 2
+                'div',               // 3
+                'divToInt',          // 4
+                'eq',                // 5
+                'gt',                // 6
+                'gte',               // 7
+                'lt',                // 8
+                'lte',               // 9
+                'minus',             // 10
+                'mod',               // 11
+                'plus',              // 12
+                'precision',         // 13
+                'random',            // 14
+                'round',             // 15
+                'shift',             // 16
+                'times',             // 17
+                'toDigits',          // 18
+                'toExponential',     // 19
+                'toFixed',           // 20
+                'toFormat',          // 21
+                'toFraction',        // 22
+                'pow',               // 23
+                'toPrecision',       // 24
+                'toString',          // 25
+                'BigNumber'          // 26
+            ][caller] + '() ' + msg + ': ' + val );
+
+            error.name = 'BigNumber Error';
+            id = 0;
+            throw error;
+        }
+
+
+        /*
+         * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.
+         * If r is truthy, it is known that there are more digits after the rounding digit.
+         */
+        function round( x, sd, rm, r ) {
+            var d, i, j, k, n, ni, rd,
+                xc = x.c,
+                pows10 = POWS_TEN;
+
+            // if x is not Infinity or NaN...
+            if (xc) {
+
+                // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.
+                // n is a base 1e14 number, the value of the element of array x.c containing rd.
+                // ni is the index of n within x.c.
+                // d is the number of digits of n.
+                // i is the index of rd within n including leading zeros.
+                // j is the actual index of rd within n (if < 0, rd is a leading zero).
+                out: {
+
+                    // Get the number of digits of the first element of xc.
+                    for ( d = 1, k = xc[0]; k >= 10; k /= 10, d++ );
+                    i = sd - d;
+
+                    // If the rounding digit is in the first element of xc...
+                    if ( i < 0 ) {
+                        i += LOG_BASE;
+                        j = sd;
+                        n = xc[ ni = 0 ];
+
+                        // Get the rounding digit at index j of n.
+                        rd = n / pows10[ d - j - 1 ] % 10 | 0;
+                    } else {
+                        ni = mathceil( ( i + 1 ) / LOG_BASE );
+
+                        if ( ni >= xc.length ) {
+
+                            if (r) {
+
+                                // Needed by sqrt.
+                                for ( ; xc.length <= ni; xc.push(0) );
+                                n = rd = 0;
+                                d = 1;
+                                i %= LOG_BASE;
+                                j = i - LOG_BASE + 1;
+                            } else {
+                                break out;
+                            }
+                        } else {
+                            n = k = xc[ni];
+
+                            // Get the number of digits of n.
+                            for ( d = 1; k >= 10; k /= 10, d++ );
+
+                            // Get the index of rd within n.
+                            i %= LOG_BASE;
+
+                            // Get the index of rd within n, adjusted for leading zeros.
+                            // The number of leading zeros of n is given by LOG_BASE - d.
+                            j = i - LOG_BASE + d;
+
+                            // Get the rounding digit at index j of n.
+                            rd = j < 0 ? 0 : n / pows10[ d - j - 1 ] % 10 | 0;
+                        }
+                    }
+
+                    r = r || sd < 0 ||
+
+                    // Are there any non-zero digits after the rounding digit?
+                    // The expression  n % pows10[ d - j - 1 ]  returns all digits of n to the right
+                    // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
+                      xc[ni + 1] != null || ( j < 0 ? n : n % pows10[ d - j - 1 ] );
+
+                    r = rm < 4
+                      ? ( rd || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )
+                      : rd > 5 || rd == 5 && ( rm == 4 || r || rm == 6 &&
+
+                        // Check whether the digit to the left of the rounding digit is odd.
+                        ( ( i > 0 ? j > 0 ? n / pows10[ d - j ] : 0 : xc[ni - 1] ) % 10 ) & 1 ||
+                          rm == ( x.s < 0 ? 8 : 7 ) );
+
+                    if ( sd < 1 || !xc[0] ) {
+                        xc.length = 0;
+
+                        if (r) {
+
+                            // Convert sd to decimal places.
+                            sd -= x.e + 1;
+
+                            // 1, 0.1, 0.01, 0.001, 0.0001 etc.
+                            xc[0] = pows10[ sd % LOG_BASE ];
+                            x.e = -sd || 0;
+                        } else {
+
+                            // Zero.
+                            xc[0] = x.e = 0;
+                        }
+
+                        return x;
+                    }
+
+                    // Remove excess digits.
+                    if ( i == 0 ) {
+                        xc.length = ni;
+                        k = 1;
+                        ni--;
+                    } else {
+                        xc.length = ni + 1;
+                        k = pows10[ LOG_BASE - i ];
+
+                        // E.g. 56700 becomes 56000 if 7 is the rounding digit.
+                        // j > 0 means i > number of leading zeros of n.
+                        xc[ni] = j > 0 ? mathfloor( n / pows10[ d - j ] % pows10[j] ) * k : 0;
+                    }
+
+                    // Round up?
+                    if (r) {
+
+                        for ( ; ; ) {
+
+                            // If the digit to be rounded up is in the first element of xc...
+                            if ( ni == 0 ) {
+
+                                // i will be the length of xc[0] before k is added.
+                                for ( i = 1, j = xc[0]; j >= 10; j /= 10, i++ );
+                                j = xc[0] += k;
+                                for ( k = 1; j >= 10; j /= 10, k++ );
+
+                                // if i != k the length has increased.
+                                if ( i != k ) {
+                                    x.e++;
+                                    if ( xc[0] == BASE ) xc[0] = 1;
+                                }
+
+                                break;
+                            } else {
+                                xc[ni] += k;
+                                if ( xc[ni] != BASE ) break;
+                                xc[ni--] = 0;
+                                k = 1;
+                            }
+                        }
+                    }
+
+                    // Remove trailing zeros.
+                    for ( i = xc.length; xc[--i] === 0; xc.pop() );
+                }
+
+                // Overflow? Infinity.
+                if ( x.e > MAX_EXP ) {
+                    x.c = x.e = null;
+
+                // Underflow? Zero.
+                } else if ( x.e < MIN_EXP ) {
+                    x.c = [ x.e = 0 ];
+                }
+            }
+
+            return x;
+        }
+
+
+        // PROTOTYPE/INSTANCE METHODS
+
+
+        /*
+         * Return a new BigNumber whose value is the absolute value of this BigNumber.
+         */
+        P.absoluteValue = P.abs = function () {
+            var x = new BigNumber(this);
+            if ( x.s < 0 ) x.s = 1;
+            return x;
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole
+         * number in the direction of Infinity.
+         */
+        P.ceil = function () {
+            return round( new BigNumber(this), this.e + 1, 2 );
+        };
+
+
+        /*
+         * Return
+         * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),
+         * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),
+         * 0 if they have the same value,
+         * or null if the value of either is NaN.
+         */
+        P.comparedTo = P.cmp = function ( y, b ) {
+            id = 1;
+            return compare( this, new BigNumber( y, b ) );
+        };
+
+
+        /*
+         * Return the number of decimal places of the value of this BigNumber, or null if the value
+         * of this BigNumber is ±Infinity or NaN.
+         */
+        P.decimalPlaces = P.dp = function () {
+            var n, v,
+                c = this.c;
+
+            if ( !c ) return null;
+            n = ( ( v = c.length - 1 ) - bitFloor( this.e / LOG_BASE ) ) * LOG_BASE;
+
+            // Subtract the number of trailing zeros of the last number.
+            if ( v = c[v] ) for ( ; v % 10 == 0; v /= 10, n-- );
+            if ( n < 0 ) n = 0;
+
+            return n;
+        };
+
+
+        /*
+         *  n / 0 = I
+         *  n / N = N
+         *  n / I = 0
+         *  0 / n = 0
+         *  0 / 0 = N
+         *  0 / N = N
+         *  0 / I = 0
+         *  N / n = N
+         *  N / 0 = N
+         *  N / N = N
+         *  N / I = N
+         *  I / n = I
+         *  I / 0 = I
+         *  I / N = N
+         *  I / I = N
+         *
+         * Return a new BigNumber whose value is the value of this BigNumber divided by the value of
+         * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.
+         */
+        P.dividedBy = P.div = function ( y, b ) {
+            id = 3;
+            return div( this, new BigNumber( y, b ), DECIMAL_PLACES, ROUNDING_MODE );
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the integer part of dividing the value of this
+         * BigNumber by the value of BigNumber(y, b).
+         */
+        P.dividedToIntegerBy = P.divToInt = function ( y, b ) {
+            id = 4;
+            return div( this, new BigNumber( y, b ), 0, 1 );
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),
+         * otherwise returns false.
+         */
+        P.equals = P.eq = function ( y, b ) {
+            id = 5;
+            return compare( this, new BigNumber( y, b ) ) === 0;
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole
+         * number in the direction of -Infinity.
+         */
+        P.floor = function () {
+            return round( new BigNumber(this), this.e + 1, 3 );
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),
+         * otherwise returns false.
+         */
+        P.greaterThan = P.gt = function ( y, b ) {
+            id = 6;
+            return compare( this, new BigNumber( y, b ) ) > 0;
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is greater than or equal to the value of
+         * BigNumber(y, b), otherwise returns false.
+         */
+        P.greaterThanOrEqualTo = P.gte = function ( y, b ) {
+            id = 7;
+            return ( b = compare( this, new BigNumber( y, b ) ) ) === 1 || b === 0;
+
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is a finite number, otherwise returns false.
+         */
+        P.isFinite = function () {
+            return !!this.c;
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is an integer, otherwise return false.
+         */
+        P.isInteger = P.isInt = function () {
+            return !!this.c && bitFloor( this.e / LOG_BASE ) > this.c.length - 2;
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is NaN, otherwise returns false.
+         */
+        P.isNaN = function () {
+            return !this.s;
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is negative, otherwise returns false.
+         */
+        P.isNegative = P.isNeg = function () {
+            return this.s < 0;
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is 0 or -0, otherwise returns false.
+         */
+        P.isZero = function () {
+            return !!this.c && this.c[0] == 0;
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),
+         * otherwise returns false.
+         */
+        P.lessThan = P.lt = function ( y, b ) {
+            id = 8;
+            return compare( this, new BigNumber( y, b ) ) < 0;
+        };
+
+
+        /*
+         * Return true if the value of this BigNumber is less than or equal to the value of
+         * BigNumber(y, b), otherwise returns false.
+         */
+        P.lessThanOrEqualTo = P.lte = function ( y, b ) {
+            id = 9;
+            return ( b = compare( this, new BigNumber( y, b ) ) ) === -1 || b === 0;
+        };
+
+
+        /*
+         *  n - 0 = n
+         *  n - N = N
+         *  n - I = -I
+         *  0 - n = -n
+         *  0 - 0 = 0
+         *  0 - N = N
+         *  0 - I = -I
+         *  N - n = N
+         *  N - 0 = N
+         *  N - N = N
+         *  N - I = N
+         *  I - n = I
+         *  I - 0 = I
+         *  I - N = N
+         *  I - I = N
+         *
+         * Return a new BigNumber whose value is the value of this BigNumber minus the value of
+         * BigNumber(y, b).
+         */
+        P.minus = P.sub = function ( y, b ) {
+            var i, j, t, xLTy,
+                x = this,
+                a = x.s;
+
+            id = 10;
+            y = new BigNumber( y, b );
+            b = y.s;
+
+            // Either NaN?
+            if ( !a || !b ) return new BigNumber(NaN);
+
+            // Signs differ?
+            if ( a != b ) {
+                y.s = -b;
+                return x.plus(y);
+            }
+
+            var xe = x.e / LOG_BASE,
+                ye = y.e / LOG_BASE,
+                xc = x.c,
+                yc = y.c;
+
+            if ( !xe || !ye ) {
+
+                // Either Infinity?
+                if ( !xc || !yc ) return xc ? ( y.s = -b, y ) : new BigNumber( yc ? x : NaN );
+
+                // Either zero?
+                if ( !xc[0] || !yc[0] ) {
+
+                    // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
+                    return yc[0] ? ( y.s = -b, y ) : new BigNumber( xc[0] ? x :
+
+                      // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
+                      ROUNDING_MODE == 3 ? -0 : 0 );
+                }
+            }
+
+            xe = bitFloor(xe);
+            ye = bitFloor(ye);
+            xc = xc.slice();
+
+            // Determine which is the bigger number.
+            if ( a = xe - ye ) {
+
+                if ( xLTy = a < 0 ) {
+                    a = -a;
+                    t = xc;
+                } else {
+                    ye = xe;
+                    t = yc;
+                }
+
+                t.reverse();
+
+                // Prepend zeros to equalise exponents.
+                for ( b = a; b--; t.push(0) );
+                t.reverse();
+            } else {
+
+                // Exponents equal. Check digit by digit.
+                j = ( xLTy = ( a = xc.length ) < ( b = yc.length ) ) ? a : b;
+
+                for ( a = b = 0; b < j; b++ ) {
+
+                    if ( xc[b] != yc[b] ) {
+                        xLTy = xc[b] < yc[b];
+                        break;
+                    }
+                }
+            }
+
+            // x < y? Point xc to the array of the bigger number.
+            if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;
+
+            b = ( j = yc.length ) - ( i = xc.length );
+
+            // Append zeros to xc if shorter.
+            // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.
+            if ( b > 0 ) for ( ; b--; xc[i++] = 0 );
+            b = BASE - 1;
+
+            // Subtract yc from xc.
+            for ( ; j > a; ) {
+
+                if ( xc[--j] < yc[j] ) {
+                    for ( i = j; i && !xc[--i]; xc[i] = b );
+                    --xc[i];
+                    xc[j] += BASE;
+                }
+
+                xc[j] -= yc[j];
+            }
+
+            // Remove leading zeros and adjust exponent accordingly.
+            for ( ; xc[0] == 0; xc.shift(), --ye );
+
+            // Zero?
+            if ( !xc[0] ) {
+
+                // Following IEEE 754 (2008) 6.3,
+                // n - n = +0  but  n - n = -0  when rounding towards -Infinity.
+                y.s = ROUNDING_MODE == 3 ? -1 : 1;
+                y.c = [ y.e = 0 ];
+                return y;
+            }
+
+            // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity
+            // for finite x and y.
+            return normalise( y, xc, ye );
+        };
+
+
+        /*
+         *   n % 0 =  N
+         *   n % N =  N
+         *   n % I =  n
+         *   0 % n =  0
+         *  -0 % n = -0
+         *   0 % 0 =  N
+         *   0 % N =  N
+         *   0 % I =  0
+         *   N % n =  N
+         *   N % 0 =  N
+         *   N % N =  N
+         *   N % I =  N
+         *   I % n =  N
+         *   I % 0 =  N
+         *   I % N =  N
+         *   I % I =  N
+         *
+         * Return a new BigNumber whose value is the value of this BigNumber modulo the value of
+         * BigNumber(y, b). The result depends on the value of MODULO_MODE.
+         */
+        P.modulo = P.mod = function ( y, b ) {
+            var q, s,
+                x = this;
+
+            id = 11;
+            y = new BigNumber( y, b );
+
+            // Return NaN if x is Infinity or NaN, or y is NaN or zero.
+            if ( !x.c || !y.s || y.c && !y.c[0] ) {
+                return new BigNumber(NaN);
+
+            // Return x if y is Infinity or x is zero.
+            } else if ( !y.c || x.c && !x.c[0] ) {
+                return new BigNumber(x);
+            }
+
+            if ( MODULO_MODE == 9 ) {
+
+                // Euclidian division: q = sign(y) * floor(x / abs(y))
+                // r = x - qy    where  0 <= r < abs(y)
+                s = y.s;
+                y.s = 1;
+                q = div( x, y, 0, 3 );
+                y.s = s;
+                q.s *= s;
+            } else {
+                q = div( x, y, 0, MODULO_MODE );
+            }
+
+            return x.minus( q.times(y) );
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the value of this BigNumber negated,
+         * i.e. multiplied by -1.
+         */
+        P.negated = P.neg = function () {
+            var x = new BigNumber(this);
+            x.s = -x.s || null;
+            return x;
+        };
+
+
+        /*
+         *  n + 0 = n
+         *  n + N = N
+         *  n + I = I
+         *  0 + n = n
+         *  0 + 0 = 0
+         *  0 + N = N
+         *  0 + I = I
+         *  N + n = N
+         *  N + 0 = N
+         *  N + N = N
+         *  N + I = N
+         *  I + n = I
+         *  I + 0 = I
+         *  I + N = N
+         *  I + I = I
+         *
+         * Return a new BigNumber whose value is the value of this BigNumber plus the value of
+         * BigNumber(y, b).
+         */
+        P.plus = P.add = function ( y, b ) {
+            var t,
+                x = this,
+                a = x.s;
+
+            id = 12;
+            y = new BigNumber( y, b );
+            b = y.s;
+
+            // Either NaN?
+            if ( !a || !b ) return new BigNumber(NaN);
+
+            // Signs differ?
+             if ( a != b ) {
+                y.s = -b;
+                return x.minus(y);
+            }
+
+            var xe = x.e / LOG_BASE,
+                ye = y.e / LOG_BASE,
+                xc = x.c,
+                yc = y.c;
+
+            if ( !xe || !ye ) {
+
+                // Return ±Infinity if either ±Infinity.
+                if ( !xc || !yc ) return new BigNumber( a / 0 );
+
+                // Either zero?
+                // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.
+                if ( !xc[0] || !yc[0] ) return yc[0] ? y : new BigNumber( xc[0] ? x : a * 0 );
+            }
+
+            xe = bitFloor(xe);
+            ye = bitFloor(ye);
+            xc = xc.slice();
+
+            // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.
+            if ( a = xe - ye ) {
+                if ( a > 0 ) {
+                    ye = xe;
+                    t = yc;
+                } else {
+                    a = -a;
+                    t = xc;
+                }
+
+                t.reverse();
+                for ( ; a--; t.push(0) );
+                t.reverse();
+            }
+
+            a = xc.length;
+            b = yc.length;
+
+            // Point xc to the longer array, and b to the shorter length.
+            if ( a - b < 0 ) t = yc, yc = xc, xc = t, b = a;
+
+            // Only start adding at yc.length - 1 as the further digits of xc can be ignored.
+            for ( a = 0; b; ) {
+                a = ( xc[--b] = xc[b] + yc[b] + a ) / BASE | 0;
+                xc[b] %= BASE;
+            }
+
+            if (a) {
+                xc.unshift(a);
+                ++ye;
+            }
+
+            // No need to check for zero, as +x + +y != 0 && -x + -y != 0
+            // ye = MAX_EXP + 1 possible
+            return normalise( y, xc, ye );
+        };
+
+
+        /*
+         * Return the number of significant digits of the value of this BigNumber.
+         *
+         * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.
+         */
+        P.precision = P.sd = function (z) {
+            var n, v,
+                x = this,
+                c = x.c;
+
+            // 'precision() argument not a boolean or binary digit: {z}'
+            if ( z != null && z !== !!z && z !== 1 && z !== 0 ) {
+                if (ERRORS) raise( 13, 'argument' + notBool, z );
+                if ( z != !!z ) z = null;
+            }
+
+            if ( !c ) return null;
+            v = c.length - 1;
+            n = v * LOG_BASE + 1;
+
+            if ( v = c[v] ) {
+
+                // Subtract the number of trailing zeros of the last element.
+                for ( ; v % 10 == 0; v /= 10, n-- );
+
+                // Add the number of digits of the first element.
+                for ( v = c[0]; v >= 10; v /= 10, n++ );
+            }
+
+            if ( z && x.e + 1 > n ) n = x.e + 1;
+
+            return n;
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of
+         * dp decimal places using rounding mode rm, or to 0 and ROUNDING_MODE respectively if
+         * omitted.
+         *
+         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+         *
+         * 'round() decimal places out of range: {dp}'
+         * 'round() decimal places not an integer: {dp}'
+         * 'round() rounding mode not an integer: {rm}'
+         * 'round() rounding mode out of range: {rm}'
+         */
+        P.round = function ( dp, rm ) {
+            var n = new BigNumber(this);
+
+            if ( dp == null || isValidInt( dp, 0, MAX, 15 ) ) {
+                round( n, ~~dp + this.e + 1, rm == null ||
+                  !isValidInt( rm, 0, 8, 15, roundingMode ) ? ROUNDING_MODE : rm | 0 );
+            }
+
+            return n;
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the value of this BigNumber shifted by k places
+         * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.
+         *
+         * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.
+         *
+         * If k is out of range and ERRORS is false, the result will be ±0 if k < 0, or ±Infinity
+         * otherwise.
+         *
+         * 'shift() argument not an integer: {k}'
+         * 'shift() argument out of range: {k}'
+         */
+        P.shift = function (k) {
+            var n = this;
+            return isValidInt( k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 16, 'argument' )
+
+              // k < 1e+21, or truncate(k) will produce exponential notation.
+              ? n.times( '1e' + truncate(k) )
+              : new BigNumber( n.c && n.c[0] && ( k < -MAX_SAFE_INTEGER || k > MAX_SAFE_INTEGER )
+                ? n.s * ( k < 0 ? 0 : 1 / 0 )
+                : n );
+        };
+
+
+        /*
+         *  sqrt(-n) =  N
+         *  sqrt( N) =  N
+         *  sqrt(-I) =  N
+         *  sqrt( I) =  I
+         *  sqrt( 0) =  0
+         *  sqrt(-0) = -0
+         *
+         * Return a new BigNumber whose value is the square root of the value of this BigNumber,
+         * rounded according to DECIMAL_PLACES and ROUNDING_MODE.
+         */
+        P.squareRoot = P.sqrt = function () {
+            var m, n, r, rep, t,
+                x = this,
+                c = x.c,
+                s = x.s,
+                e = x.e,
+                dp = DECIMAL_PLACES + 4,
+                half = new BigNumber('0.5');
+
+            // Negative/NaN/Infinity/zero?
+            if ( s !== 1 || !c || !c[0] ) {
+                return new BigNumber( !s || s < 0 && ( !c || c[0] ) ? NaN : c ? x : 1 / 0 );
+            }
+
+            // Initial estimate.
+            s = Math.sqrt( +x );
+
+            // Math.sqrt underflow/overflow?
+            // Pass x to Math.sqrt as integer, then adjust the exponent of the result.
+            if ( s == 0 || s == 1 / 0 ) {
+                n = coeffToString(c);
+                if ( ( n.length + e ) % 2 == 0 ) n += '0';
+                s = Math.sqrt(n);
+                e = bitFloor( ( e + 1 ) / 2 ) - ( e < 0 || e % 2 );
+
+                if ( s == 1 / 0 ) {
+                    n = '1e' + e;
+                } else {
+                    n = s.toExponential();
+                    n = n.slice( 0, n.indexOf('e') + 1 ) + e;
+                }
+
+                r = new BigNumber(n);
+            } else {
+                r = new BigNumber( s + '' );
+            }
+
+            // Check for zero.
+            // r could be zero if MIN_EXP is changed after the this value was created.
+            // This would cause a division by zero (x/t) and hence Infinity below, which would cause
+            // coeffToString to throw.
+            if ( r.c[0] ) {
+                e = r.e;
+                s = e + dp;
+                if ( s < 3 ) s = 0;
+
+                // Newton-Raphson iteration.
+                for ( ; ; ) {
+                    t = r;
+                    r = half.times( t.plus( div( x, t, dp, 1 ) ) );
+
+                    if ( coeffToString( t.c   ).slice( 0, s ) === ( n =
+                         coeffToString( r.c ) ).slice( 0, s ) ) {
+
+                        // The exponent of r may here be one less than the final result exponent,
+                        // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits
+                        // are indexed correctly.
+                        if ( r.e < e ) --s;
+                        n = n.slice( s - 3, s + 1 );
+
+                        // The 4th rounding digit may be in error by -1 so if the 4 rounding digits
+                        // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the
+                        // iteration.
+                        if ( n == '9999' || !rep && n == '4999' ) {
+
+                            // On the first iteration only, check to see if rounding up gives the
+                            // exact result as the nines may infinitely repeat.
+                            if ( !rep ) {
+                                round( t, t.e + DECIMAL_PLACES + 2, 0 );
+
+                                if ( t.times(t).eq(x) ) {
+                                    r = t;
+                                    break;
+                                }
+                            }
+
+                            dp += 4;
+                            s += 4;
+                            rep = 1;
+                        } else {
+
+                            // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact
+                            // result. If not, then there are further digits and m will be truthy.
+                            if ( !+n || !+n.slice(1) && n.charAt(0) == '5' ) {
+
+                                // Truncate to the first rounding digit.
+                                round( r, r.e + DECIMAL_PLACES + 2, 1 );
+                                m = !r.times(r).eq(x);
+                            }
+
+                            break;
+                        }
+                    }
+                }
+            }
+
+            return round( r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m );
+        };
+
+
+        /*
+         *  n * 0 = 0
+         *  n * N = N
+         *  n * I = I
+         *  0 * n = 0
+         *  0 * 0 = 0
+         *  0 * N = N
+         *  0 * I = N
+         *  N * n = N
+         *  N * 0 = N
+         *  N * N = N
+         *  N * I = N
+         *  I * n = I
+         *  I * 0 = N
+         *  I * N = N
+         *  I * I = I
+         *
+         * Return a new BigNumber whose value is the value of this BigNumber times the value of
+         * BigNumber(y, b).
+         */
+        P.times = P.mul = function ( y, b ) {
+            var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,
+                base, sqrtBase,
+                x = this,
+                xc = x.c,
+                yc = ( id = 17, y = new BigNumber( y, b ) ).c;
+
+            // Either NaN, ±Infinity or ±0?
+            if ( !xc || !yc || !xc[0] || !yc[0] ) {
+
+                // Return NaN if either is NaN, or one is 0 and the other is Infinity.
+                if ( !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ) {
+                    y.c = y.e = y.s = null;
+                } else {
+                    y.s *= x.s;
+
+                    // Return ±Infinity if either is ±Infinity.
+                    if ( !xc || !yc ) {
+                        y.c = y.e = null;
+
+                    // Return ±0 if either is ±0.
+                    } else {
+                        y.c = [0];
+                        y.e = 0;
+                    }
+                }
+
+                return y;
+            }
+
+            e = bitFloor( x.e / LOG_BASE ) + bitFloor( y.e / LOG_BASE );
+            y.s *= x.s;
+            xcL = xc.length;
+            ycL = yc.length;
+
+            // Ensure xc points to longer array and xcL to its length.
+            if ( xcL < ycL ) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;
+
+            // Initialise the result array with zeros.
+            for ( i = xcL + ycL, zc = []; i--; zc.push(0) );
+
+            base = BASE;
+            sqrtBase = SQRT_BASE;
+
+            for ( i = ycL; --i >= 0; ) {
+                c = 0;
+                ylo = yc[i] % sqrtBase;
+                yhi = yc[i] / sqrtBase | 0;
+
+                for ( k = xcL, j = i + k; j > i; ) {
+                    xlo = xc[--k] % sqrtBase;
+                    xhi = xc[k] / sqrtBase | 0;
+                    m = yhi * xlo + xhi * ylo;
+                    xlo = ylo * xlo + ( ( m % sqrtBase ) * sqrtBase ) + zc[j] + c;
+                    c = ( xlo / base | 0 ) + ( m / sqrtBase | 0 ) + yhi * xhi;
+                    zc[j--] = xlo % base;
+                }
+
+                zc[j] = c;
+            }
+
+            if (c) {
+                ++e;
+            } else {
+                zc.shift();
+            }
+
+            return normalise( y, zc, e );
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of
+         * sd significant digits using rounding mode rm, or ROUNDING_MODE if rm is omitted.
+         *
+         * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.
+         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+         *
+         * 'toDigits() precision out of range: {sd}'
+         * 'toDigits() precision not an integer: {sd}'
+         * 'toDigits() rounding mode not an integer: {rm}'
+         * 'toDigits() rounding mode out of range: {rm}'
+         */
+        P.toDigits = function ( sd, rm ) {
+            var n = new BigNumber(this);
+            sd = sd == null || !isValidInt( sd, 1, MAX, 18, 'precision' ) ? null : sd | 0;
+            rm = rm == null || !isValidInt( rm, 0, 8, 18, roundingMode ) ? ROUNDING_MODE : rm | 0;
+            return sd ? round( n, sd, rm ) : n;
+        };
+
+
+        /*
+         * Return a string representing the value of this BigNumber in exponential notation and
+         * rounded using ROUNDING_MODE to dp fixed decimal places.
+         *
+         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+         *
+         * 'toExponential() decimal places not an integer: {dp}'
+         * 'toExponential() decimal places out of range: {dp}'
+         * 'toExponential() rounding mode not an integer: {rm}'
+         * 'toExponential() rounding mode out of range: {rm}'
+         */
+        P.toExponential = function ( dp, rm ) {
+            return format( this,
+              dp != null && isValidInt( dp, 0, MAX, 19 ) ? ~~dp + 1 : null, rm, 19 );
+        };
+
+
+        /*
+         * Return a string representing the value of this BigNumber in fixed-point notation rounding
+         * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.
+         *
+         * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',
+         * but e.g. (-0.00001).toFixed(0) is '-0'.
+         *
+         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+         *
+         * 'toFixed() decimal places not an integer: {dp}'
+         * 'toFixed() decimal places out of range: {dp}'
+         * 'toFixed() rounding mode not an integer: {rm}'
+         * 'toFixed() rounding mode out of range: {rm}'
+         */
+        P.toFixed = function ( dp, rm ) {
+            return format( this, dp != null && isValidInt( dp, 0, MAX, 20 )
+              ? ~~dp + this.e + 1 : null, rm, 20 );
+        };
+
+
+        /*
+         * Return a string representing the value of this BigNumber in fixed-point notation rounded
+         * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties
+         * of the FORMAT object (see BigNumber.config).
+         *
+         * FORMAT = {
+         *      decimalSeparator : '.',
+         *      groupSeparator : ',',
+         *      groupSize : 3,
+         *      secondaryGroupSize : 0,
+         *      fractionGroupSeparator : '\xA0',    // non-breaking space
+         *      fractionGroupSize : 0
+         * };
+         *
+         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.
+         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+         *
+         * 'toFormat() decimal places not an integer: {dp}'
+         * 'toFormat() decimal places out of range: {dp}'
+         * 'toFormat() rounding mode not an integer: {rm}'
+         * 'toFormat() rounding mode out of range: {rm}'
+         */
+        P.toFormat = function ( dp, rm ) {
+            var str = format( this, dp != null && isValidInt( dp, 0, MAX, 21 )
+              ? ~~dp + this.e + 1 : null, rm, 21 );
+
+            if ( this.c ) {
+                var i,
+                    arr = str.split('.'),
+                    g1 = +FORMAT.groupSize,
+                    g2 = +FORMAT.secondaryGroupSize,
+                    groupSeparator = FORMAT.groupSeparator,
+                    intPart = arr[0],
+                    fractionPart = arr[1],
+                    isNeg = this.s < 0,
+                    intDigits = isNeg ? intPart.slice(1) : intPart,
+                    len = intDigits.length;
+
+                if (g2) i = g1, g1 = g2, g2 = i, len -= i;
+
+                if ( g1 > 0 && len > 0 ) {
+                    i = len % g1 || g1;
+                    intPart = intDigits.substr( 0, i );
+
+                    for ( ; i < len; i += g1 ) {
+                        intPart += groupSeparator + intDigits.substr( i, g1 );
+                    }
+
+                    if ( g2 > 0 ) intPart += groupSeparator + intDigits.slice(i);
+                    if (isNeg) intPart = '-' + intPart;
+                }
+
+                str = fractionPart
+                  ? intPart + FORMAT.decimalSeparator + ( ( g2 = +FORMAT.fractionGroupSize )
+                    ? fractionPart.replace( new RegExp( '\\d{' + g2 + '}\\B', 'g' ),
+                      '$&' + FORMAT.fractionGroupSeparator )
+                    : fractionPart )
+                  : intPart;
+            }
+
+            return str;
+        };
+
+
+        /*
+         * Return a string array representing the value of this BigNumber as a simple fraction with
+         * an integer numerator and an integer denominator. The denominator will be a positive
+         * non-zero value less than or equal to the specified maximum denominator. If a maximum
+         * denominator is not specified, the denominator will be the lowest value necessary to
+         * represent the number exactly.
+         *
+         * [md] {number|string|BigNumber} Integer >= 1 and < Infinity. The maximum denominator.
+         *
+         * 'toFraction() max denominator not an integer: {md}'
+         * 'toFraction() max denominator out of range: {md}'
+         */
+        P.toFraction = function (md) {
+            var arr, d0, d2, e, exp, n, n0, q, s,
+                k = ERRORS,
+                x = this,
+                xc = x.c,
+                d = new BigNumber(ONE),
+                n1 = d0 = new BigNumber(ONE),
+                d1 = n0 = new BigNumber(ONE);
+
+            if ( md != null ) {
+                ERRORS = false;
+                n = new BigNumber(md);
+                ERRORS = k;
+
+                if ( !( k = n.isInt() ) || n.lt(ONE) ) {
+
+                    if (ERRORS) {
+                        raise( 22,
+                          'max denominator ' + ( k ? 'out of range' : 'not an integer' ), md );
+                    }
+
+                    // ERRORS is false:
+                    // If md is a finite non-integer >= 1, round it to an integer and use it.
+                    md = !k && n.c && round( n, n.e + 1, 1 ).gte(ONE) ? n : null;
+                }
+            }
+
+            if ( !xc ) return x.toString();
+            s = coeffToString(xc);
+
+            // Determine initial denominator.
+            // d is a power of 10 and the minimum max denominator that specifies the value exactly.
+            e = d.e = s.length - x.e - 1;
+            d.c[0] = POWS_TEN[ ( exp = e % LOG_BASE ) < 0 ? LOG_BASE + exp : exp ];
+            md = !md || n.cmp(d) > 0 ? ( e > 0 ? d : n1 ) : n;
+
+            exp = MAX_EXP;
+            MAX_EXP = 1 / 0;
+            n = new BigNumber(s);
+
+            // n0 = d1 = 0
+            n0.c[0] = 0;
+
+            for ( ; ; )  {
+                q = div( n, d, 0, 1 );
+                d2 = d0.plus( q.times(d1) );
+                if ( d2.cmp(md) == 1 ) break;
+                d0 = d1;
+                d1 = d2;
+                n1 = n0.plus( q.times( d2 = n1 ) );
+                n0 = d2;
+                d = n.minus( q.times( d2 = d ) );
+                n = d2;
+            }
+
+            d2 = div( md.minus(d0), d1, 0, 1 );
+            n0 = n0.plus( d2.times(n1) );
+            d0 = d0.plus( d2.times(d1) );
+            n0.s = n1.s = x.s;
+            e *= 2;
+
+            // Determine which fraction is closer to x, n0/d0 or n1/d1
+            arr = div( n1, d1, e, ROUNDING_MODE ).minus(x).abs().cmp(
+                  div( n0, d0, e, ROUNDING_MODE ).minus(x).abs() ) < 1
+                    ? [ n1.toString(), d1.toString() ]
+                    : [ n0.toString(), d0.toString() ];
+
+            MAX_EXP = exp;
+            return arr;
+        };
+
+
+        /*
+         * Return the value of this BigNumber converted to a number primitive.
+         */
+        P.toNumber = function () {
+            var x = this;
+
+            // Ensure zero has correct sign.
+            return +x || ( x.s ? x.s * 0 : NaN );
+        };
+
+
+        /*
+         * Return a BigNumber whose value is the value of this BigNumber raised to the power n.
+         * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.
+         * If POW_PRECISION is not 0, round to POW_PRECISION using ROUNDING_MODE.
+         *
+         * n {number} Integer, -9007199254740992 to 9007199254740992 inclusive.
+         * (Performs 54 loop iterations for n of 9007199254740992.)
+         *
+         * 'pow() exponent not an integer: {n}'
+         * 'pow() exponent out of range: {n}'
+         */
+        P.toPower = P.pow = function (n) {
+            var k, y,
+                i = mathfloor( n < 0 ? -n : +n ),
+                x = this;
+
+            // Pass ±Infinity to Math.pow if exponent is out of range.
+            if ( !isValidInt( n, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 23, 'exponent' ) &&
+              ( !isFinite(n) || i > MAX_SAFE_INTEGER && ( n /= 0 ) ||
+                parseFloat(n) != n && !( n = NaN ) ) ) {
+                return new BigNumber( Math.pow( +x, n ) );
+            }
+
+            // Truncating each coefficient array to a length of k after each multiplication equates
+            // to truncating significant digits to POW_PRECISION + [28, 41], i.e. there will be a
+            // minimum of 28 guard digits retained. (Using + 1.5 would give [9, 21] guard digits.)
+            k = POW_PRECISION ? mathceil( POW_PRECISION / LOG_BASE + 2 ) : 0;
+            y = new BigNumber(ONE);
+
+            for ( ; ; ) {
+
+                if ( i % 2 ) {
+                    y = y.times(x);
+                    if ( !y.c ) break;
+                    if ( k && y.c.length > k ) y.c.length = k;
+                }
+
+                i = mathfloor( i / 2 );
+                if ( !i ) break;
+
+                x = x.times(x);
+                if ( k && x.c && x.c.length > k ) x.c.length = k;
+            }
+
+            if ( n < 0 ) y = ONE.div(y);
+            return k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y;
+        };
+
+
+        /*
+         * Return a string representing the value of this BigNumber rounded to sd significant digits
+         * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits
+         * necessary to represent the integer part of the value in fixed-point notation, then use
+         * exponential notation.
+         *
+         * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.
+         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.
+         *
+         * 'toPrecision() precision not an integer: {sd}'
+         * 'toPrecision() precision out of range: {sd}'
+         * 'toPrecision() rounding mode not an integer: {rm}'
+         * 'toPrecision() rounding mode out of range: {rm}'
+         */
+        P.toPrecision = function ( sd, rm ) {
+            return format( this, sd != null && isValidInt( sd, 1, MAX, 24, 'precision' )
+              ? sd | 0 : null, rm, 24 );
+        };
+
+
+        /*
+         * Return a string representing the value of this BigNumber in base b, or base 10 if b is
+         * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and
+         * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent
+         * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than
+         * TO_EXP_NEG, return exponential notation.
+         *
+         * [b] {number} Integer, 2 to 64 inclusive.
+         *
+         * 'toString() base not an integer: {b}'
+         * 'toString() base out of range: {b}'
+         */
+        P.toString = function (b) {
+            var str,
+                n = this,
+                s = n.s,
+                e = n.e;
+
+            // Infinity or NaN?
+            if ( e === null ) {
+
+                if (s) {
+                    str = 'Infinity';
+                    if ( s < 0 ) str = '-' + str;
+                } else {
+                    str = 'NaN';
+                }
+            } else {
+                str = coeffToString( n.c );
+
+                if ( b == null || !isValidInt( b, 2, 64, 25, 'base' ) ) {
+                    str = e <= TO_EXP_NEG || e >= TO_EXP_POS
+                      ? toExponential( str, e )
+                      : toFixedPoint( str, e );
+                } else {
+                    str = convertBase( toFixedPoint( str, e ), b | 0, 10, s );
+                }
+
+                if ( s < 0 && n.c[0] ) str = '-' + str;
+            }
+
+            return str;
+        };
+
+
+        /*
+         * Return a new BigNumber whose value is the value of this BigNumber truncated to a whole
+         * number.
+         */
+        P.truncated = P.trunc = function () {
+            return round( new BigNumber(this), this.e + 1, 1 );
+        };
+
+
+
+        /*
+         * Return as toString, but do not accept a base argument.
+         */
+        P.valueOf = P.toJSON = function () {
+            return this.toString();
+        };
+
+
+        // Aliases for BigDecimal methods.
+        //P.add = P.plus;         // P.add included above
+        //P.subtract = P.minus;   // P.sub included above
+        //P.multiply = P.times;   // P.mul included above
+        //P.divide = P.div;
+        //P.remainder = P.mod;
+        //P.compareTo = P.cmp;
+        //P.negate = P.neg;
+
+
+        if ( configObj != null ) BigNumber.config(configObj);
+
+        return BigNumber;
+    }
+
+
+    // PRIVATE HELPER FUNCTIONS
+
+
+    function bitFloor(n) {
+        var i = n | 0;
+        return n > 0 || n === i ? i : i - 1;
+    }
+
+
+    // Return a coefficient array as a string of base 10 digits.
+    function coeffToString(a) {
+        var s, z,
+            i = 1,
+            j = a.length,
+            r = a[0] + '';
+
+        for ( ; i < j; ) {
+            s = a[i++] + '';
+            z = LOG_BASE - s.length;
+            for ( ; z--; s = '0' + s );
+            r += s;
+        }
+
+        // Determine trailing zeros.
+        for ( j = r.length; r.charCodeAt(--j) === 48; );
+        return r.slice( 0, j + 1 || 1 );
+    }
+
+
+    // Compare the value of BigNumbers x and y.
+    function compare( x, y ) {
+        var a, b,
+            xc = x.c,
+            yc = y.c,
+            i = x.s,
+            j = y.s,
+            k = x.e,
+            l = y.e;
+
+        // Either NaN?
+        if ( !i || !j ) return null;
+
+        a = xc && !xc[0];
+        b = yc && !yc[0];
+
+        // Either zero?
+        if ( a || b ) return a ? b ? 0 : -j : i;
+
+        // Signs differ?
+        if ( i != j ) return i;
+
+        a = i < 0;
+        b = k == l;
+
+        // Either Infinity?
+        if ( !xc || !yc ) return b ? 0 : !xc ^ a ? 1 : -1;
+
+        // Compare exponents.
+        if ( !b ) return k > l ^ a ? 1 : -1;
+
+        j = ( k = xc.length ) < ( l = yc.length ) ? k : l;
+
+        // Compare digit by digit.
+        for ( i = 0; i < j; i++ ) if ( xc[i] != yc[i] ) return xc[i] > yc[i] ^ a ? 1 : -1;
+
+        // Compare lengths.
+        return k == l ? 0 : k > l ^ a ? 1 : -1;
+    }
+
+
+    /*
+     * Return true if n is a valid number in range, otherwise false.
+     * Use for argument validation when ERRORS is false.
+     * Note: parseInt('1e+1') == 1 but parseFloat('1e+1') == 10.
+     */
+    function intValidatorNoErrors( n, min, max ) {
+        return ( n = truncate(n) ) >= min && n <= max;
+    }
+
+
+    function isArray(obj) {
+        return Object.prototype.toString.call(obj) == '[object Array]';
+    }
+
+
+    /*
+     * Convert string of baseIn to an array of numbers of baseOut.
+     * Eg. convertBase('255', 10, 16) returns [15, 15].
+     * Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
+     */
+    function toBaseOut( str, baseIn, baseOut ) {
+        var j,
+            arr = [0],
+            arrL,
+            i = 0,
+            len = str.length;
+
+        for ( ; i < len; ) {
+            for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );
+            arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );
+
+            for ( ; j < arr.length; j++ ) {
+
+                if ( arr[j] > baseOut - 1 ) {
+                    if ( arr[j + 1] == null ) arr[j + 1] = 0;
+                    arr[j + 1] += arr[j] / baseOut | 0;
+                    arr[j] %= baseOut;
+                }
+            }
+        }
+
+        return arr.reverse();
+    }
+
+
+    function toExponential( str, e ) {
+        return ( str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str ) +
+          ( e < 0 ? 'e' : 'e+' ) + e;
+    }
+
+
+    function toFixedPoint( str, e ) {
+        var len, z;
+
+        // Negative exponent?
+        if ( e < 0 ) {
+
+            // Prepend zeros.
+            for ( z = '0.'; ++e; z += '0' );
+            str = z + str;
+
+        // Positive exponent
+        } else {
+            len = str.length;
+
+            // Append zeros.
+            if ( ++e > len ) {
+                for ( z = '0', e -= len; --e; z += '0' );
+                str += z;
+            } else if ( e < len ) {
+                str = str.slice( 0, e ) + '.' + str.slice(e);
+            }
+        }
+
+        return str;
+    }
+
+
+    function truncate(n) {
+        n = parseFloat(n);
+        return n < 0 ? mathceil(n) : mathfloor(n);
+    }
+
+
+    // EXPORT
+
+
+    BigNumber = another();
+
+    // AMD.
+    if ( typeof define == 'function' && define.amd ) {
+        define( function () { return BigNumber; } );
+
+    // Node and other environments that support module.exports.
+    } else if ( typeof module != 'undefined' && module.exports ) {
+        module.exports = BigNumber;
+        if ( !crypto ) try { crypto = require('crypto'); } catch (e) {}
+
+    // Browser.
+    } else {
+        global.BigNumber = BigNumber;
+    }
+})(this);
+
+},{"crypto":1}],"natspec":[function(require,module,exports){
+/*
+    This file is part of natspec.js.
+
+    natspec.js is free software: you can redistribute it and/or modify
+    it under the terms of the GNU Lesser General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    natspec.js is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public License
+    along with natspec.js.  If not, see <http://www.gnu.org/licenses/>.
+*/
+/** @file natspec.js
+ * @authors:
+ *   Marek Kotewicz <marek@ethdev.com>
+ * @date 2015
+ */
+
+var abi = require('./node_modules/ethereum.js/lib/abi.js'); 
+
+/**
+ * This object should be used to evaluate natspec expression
+ * It has one method evaluateExpression which shoul be used
+ */
+var natspec = (function () {
+    /// Helper method
+    /// Should be called to copy values from object to global context
+    var copyToContext = function (obj, context) {
+        Object.keys(obj).forEach(function (key) {
+            context[key] = obj[key];
+        });
+    }
+    
+    /// generate codes, which will be evaluated
+    var generateCode = function (obj) {
+        return Object.keys(obj).reduce(function (acc, key) {
+            return acc + "var " + key + " = context['" + key + "'];\n";
+        }, "");
+    };
+
+    /// Helper method
+    /// Should be called to get method with given name from the abi
+    /// @param contract's abi
+    /// @param name of the method that we are looking for
+    var getMethodWithName = function(abi, name) {
+        return abi.filter(function (method) {
+            return method.name === name;
+        })[0];
+    };
+
+    /// Function called to get all contract method input variables
+    /// @returns hashmap with all contract's method input variables
+    var getMethodInputParams = function (method, transaction) {
+        // do it with output formatter (cause we have to decode)
+        var params = abi.formatOutput(method.inputs, '0x' + transaction.params[0].data.slice(10)); 
+
+        return method.inputs.reduce(function (acc, current, index) {
+            acc[current.name] = params[index];
+            return acc;
+        }, {});
+    };
+    
+    /// Should be called to evaluate expression
+    var mapExpressionsToEvaluate = function (expression, cb) {
+        var evaluatedExpression = "";
+
+        // match everything in `` quotes
+        var pattern = /\`(?:\\.|[^`\\])*\`/gim
+        var match;
+        var lastIndex = 0;
+        while ((match = pattern.exec(expression)) !== null) {
+            var startIndex = pattern.lastIndex - match[0].length;
+            var toEval = match[0].slice(1, match[0].length - 1);
+            evaluatedExpression += expression.slice(lastIndex, startIndex);
+            var evaluatedPart = cb(toEval);
+            evaluatedExpression += evaluatedPart;
+            lastIndex = pattern.lastIndex;
+        }
+        
+        evaluatedExpression += expression.slice(lastIndex);
+    
+        return evaluatedExpression;
+    };
+
+    /// Should be called to evaluate single expression
+    /// Is internally using javascript's 'eval' method
+    /// @param expression which should be evaluated
+    /// @param [call] object containing contract abi, transaction, called method
+    /// TODO: separate evaluation from getting input params, so as not to spoil 'evaluateExpression' function
+    var evaluateExpression = function (expression, call) {
+        //var self = this;
+        var context = {};
+        
+        if (!!call) {
+            try {
+                var method = getMethodWithName(call.abi, call.method);
+                var params = getMethodInputParams(method, call.transaction); 
+                copyToContext(params, context);
+            }
+            catch (err) {
+                return "Natspec evaluation failed, wrong input params";
+            }
+        }
+
+        var code = generateCode(context);
+
+        var evaluatedExpression = mapExpressionsToEvaluate(expression, function (toEval) {
+            try {
+                var fn = new Function("context", code + "return " + toEval + ";");
+                return fn(context).toString();
+            }
+            catch (err) {
+                return 'undefined'; 
+            }
+        });
+
+        return evaluatedExpression;
+    };
+
+    return {
+        evaluateExpression: evaluateExpression
+    };
+
+})();
+
+module.exports = natspec; 
+
+
+},{"./node_modules/ethereum.js/lib/abi.js":3}]},{},[]);

+ 51 - 0
ethutil/natspec/natspec_test.go

@@ -0,0 +1,51 @@
+package natspec
+
+import (
+	"testing"
+)
+
+func TestNotice(t *testing.T) {
+
+	ns, err := NewNATSpec(`
+	{
+            "jsonrpc": "2.0",
+            "method": "eth_call",
+            "params": [{
+                "to": "0x8521742d3f456bd237e312d6e30724960f72517a",
+                "data": "0xc6888fa1000000000000000000000000000000000000000000000000000000000000007a"
+            }],
+            "id": 6
+        }
+	`)
+
+	if err != nil {
+		t.Errorf("NewNATSpec error %v", err)
+	}
+
+	ns.SetABI(`
+	[{
+            "name": "multiply",
+            "constant": false,
+            "type": "function",
+            "inputs": [{
+                "name": "a",
+                "type": "uint256"
+            }],
+            "outputs": [{
+                "name": "d",
+                "type": "uint256"
+            }]
+        }]
+	`)
+	ns.SetDescription("Will multiply `a` by 7 and return `a * 7`.")
+	ns.SetMethod("multiply")
+
+	notice := ns.Parse()
+
+	expected := "Will multiply 122 by 7 and return 854."
+	if notice != expected {
+		t.Errorf("incorrect notice. expected %v, got %v", expected, notice)
+	} else {
+		t.Logf("returned notice \"%v\"", notice)
+	}
+}

+ 5 - 0
miner/miner.go

@@ -3,6 +3,7 @@ package miner
 import (
 	"math/big"
 
+	"github.com/ethereum/ethash"
 	"github.com/ethereum/go-ethereum/core"
 	"github.com/ethereum/go-ethereum/logger"
 	"github.com/ethereum/go-ethereum/pow"
@@ -44,6 +45,8 @@ func (self *Miner) Mining() bool {
 func (self *Miner) Start() {
 	self.mining = true
 
+	self.pow.(*ethash.Ethash).UpdateDAG()
+
 	self.worker.start()
 
 	self.worker.commitNewWork()
@@ -53,6 +56,8 @@ func (self *Miner) Stop() {
 	self.mining = false
 
 	self.worker.stop()
+
+	//self.pow.(*ethash.Ethash).Stop()
 }
 
 func (self *Miner) HashRate() int64 {

+ 3 - 3
miner/worker.go

@@ -30,7 +30,7 @@ type environment struct {
 }
 
 func env(block *types.Block, eth core.Backend) *environment {
-	state := state.New(block.Root(), eth.Db())
+	state := state.New(block.Root(), eth.StateDb())
 	env := &environment{
 		totalUsedGas: new(big.Int),
 		state:        state,
@@ -116,7 +116,7 @@ func (self *worker) register(agent Agent) {
 }
 
 func (self *worker) update() {
-	events := self.mux.Subscribe(core.ChainEvent{}, core.NewMinedBlockEvent{})
+	events := self.mux.Subscribe(core.ChainHeadEvent{}, core.NewMinedBlockEvent{})
 
 	timer := time.NewTicker(2 * time.Second)
 
@@ -125,7 +125,7 @@ out:
 		select {
 		case event := <-events.Chan():
 			switch ev := event.(type) {
-			case core.ChainEvent:
+			case core.ChainHeadEvent:
 				if self.current.block != ev.Block {
 					self.commitNewWork()
 				}

+ 1 - 14
rpc/api.go

@@ -9,7 +9,6 @@ For each request type, define the following:
 package rpc
 
 import (
-	"fmt"
 	"math/big"
 	"path"
 	"strings"
@@ -24,7 +23,6 @@ import (
 	"github.com/ethereum/go-ethereum/event"
 	"github.com/ethereum/go-ethereum/event/filter"
 	"github.com/ethereum/go-ethereum/state"
-	"github.com/ethereum/go-ethereum/ui"
 	"github.com/ethereum/go-ethereum/xeth"
 )
 
@@ -84,7 +82,7 @@ func (self *EthereumApi) setStateByBlockNumber(num int64) {
 	block = chain.GetBlockByNumber(uint64(num))
 
 	if block != nil {
-		self.useState(state.New(block.Root(), self.xeth().Backend().Db()))
+		self.useState(state.New(block.Root(), self.xeth().Backend().StateDb()))
 	} else {
 		self.useState(chain.State())
 	}
@@ -702,14 +700,3 @@ func (self *EthereumApi) useState(statedb *state.StateDB) {
 
 	self.eth = self.eth.UseState(statedb)
 }
-
-func t(f ui.Frontend) {
-	// Call the password dialog
-	ret, err := f.Call("PasswordDialog")
-	if err != nil {
-		fmt.Println(err)
-	}
-	// Get the first argument
-	t, _ := ret.Get(0)
-	fmt.Println("return:", t)
-}

+ 11 - 1
rpc/http.go

@@ -9,10 +9,14 @@ import (
 
 var rpchttplogger = logger.NewLogger("RPC-HTTP")
 
+const (
+	jsonrpcver       = "2.0"
+	maxSizeReqLength = 1024 * 1024 // 1MB
+)
+
 // JSONRPC returns a handler that implements the Ethereum JSON-RPC API.
 func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler {
 	var json JsonWrapper
-	const jsonrpcver = "2.0"
 	api := NewEthereumApi(pipe, dataDir)
 
 	return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
@@ -20,6 +24,12 @@ func JSONRPC(pipe *xeth.XEth, dataDir string) http.Handler {
 
 		rpchttplogger.DebugDetailln("Handling request")
 
+		if req.ContentLength > maxSizeReqLength {
+			jsonerr := &RpcErrorObject{-32700, "Error: Request too large"}
+			json.Send(w, &RpcErrorResponse{JsonRpc: jsonrpcver, ID: nil, Error: jsonerr})
+			return
+		}
+
 		reqParsed, reqerr := json.ParseRequestBody(req)
 		if reqerr != nil {
 			jsonerr := &RpcErrorObject{-32700, "Error: Could not parse request"}

+ 1 - 1
state/state_object.go

@@ -111,7 +111,7 @@ func NewStateObjectFromBytes(address, data []byte, db ethutil.Database) *StateOb
 func (self *StateObject) MarkForDeletion() {
 	self.remove = true
 	self.dirty = true
-	statelogger.DebugDetailf("%x: #%d %v (deletion)\n", self.Address(), self.nonce, self.balance)
+	statelogger.Debugf("%x: #%d %v X\n", self.Address(), self.nonce, self.balance)
 }
 
 func (c *StateObject) getAddr(addr []byte) *ethutil.Value {

+ 9 - 0
state/statedb.go

@@ -121,6 +121,7 @@ func (self *StateDB) Delete(addr []byte) bool {
 	stateObject := self.GetOrNewStateObject(addr)
 	if stateObject != nil {
 		stateObject.MarkForDeletion()
+		stateObject.balance = new(big.Int)
 
 		return true
 	}
@@ -128,6 +129,14 @@ func (self *StateDB) Delete(addr []byte) bool {
 	return false
 }
 
+func (self *StateDB) IsDeleted(addr []byte) bool {
+	stateObject := self.GetStateObject(addr)
+	if stateObject != nil {
+		return stateObject.remove
+	}
+	return false
+}
+
 //
 // Setting, updating & deleting state object methods
 //

+ 3 - 3
tests/files/BasicTests/genesishashestest.json

@@ -1,5 +1,5 @@
 {
-  "genesis_rlp_hex": "f9012ef90129a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07e204dc9cfb7acdf062ff0b8052f7fcb0b7e6593754773967932ce458d134af3a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b840000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080830f4240808080a004994f67dc55b09e814ab7ffc8df3686b4afb2bb53e60eae97ef043fe03fb829c0c0",
-  "genesis_state_root": "7e204dc9cfb7acdf062ff0b8052f7fcb0b7e6593754773967932ce458d134af3",
-  "genesis_hash": "32d9162f861a01bc8274e70b3cdb9d688fd7d8566f2f8c25cf1a882f244081c4"
+  "genesis_rlp_hex": "f90219f90214a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a09178d0f23c965d81f0834a4c72c6253ce6830f4022b1359aaebfc1ecba442d4ea056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080830f4240808080a00000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000088000000000000002ac0c0",
+  "genesis_state_root": "9178d0f23c965d81f0834a4c72c6253ce6830f4022b1359aaebfc1ecba442d4e",
+  "genesis_hash": "b5d6d8402156c5c1dfadaa4b87c676b5bcadb17ef9bc8e939606daaa0d35f55d"
 }

+ 108 - 0
tests/files/BlockTests/bcBlockChainTest.json

@@ -0,0 +1,108 @@
+{
+    "minDifficulty" : {
+        "blocks" : [
+            {
+                "blockHeader" : {
+                    "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+                    "coinbase" : "0000000000000000000000000000000000000000",
+                    "difficulty" : "131072",
+                    "extraData" : "0x",
+                    "gasLimit" : "99902343",
+                    "gasUsed" : "21000",
+                    "hash" : "89cbb1c4aed1dd11118dd30537a050f60e3c3ab2a75f931377ae5b8e4ce01556",
+                    "mixHash" : "10d3a79253db9e4307bd3f2f714b375f5aeb1a353e8faf2c275e4d45d3d9d49c",
+                    "nonce" : "482c8d8082a0f5ec",
+                    "number" : "1",
+                    "parentHash" : "0ef7e09a5afada6e6c62f9aa2816b4880877f5cf3f061d316d441bcf4a781c5e",
+                    "receiptTrie" : "eeceeeb4567b38e5b86275e3a36ac4ff55b9764b427714426710c3631a29011a",
+                    "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+                    "stateRoot" : "0178d4488f358061cbf1a6086fa270e4a7d6ce54a26947eb84a5157251090124",
+                    "timestamp" : "1425891408",
+                    "transactionsTrie" : "2117c9060f6d15db2f509a1c764cc4797dfeeb96ac0dbb7b51b042b050948fec",
+                    "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+                },
+                "rlp" : "0xf90284f9021ba00ef7e09a5afada6e6c62f9aa2816b4880877f5cf3f061d316d441bcf4a781c5ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a00178d4488f358061cbf1a6086fa270e4a7d6ce54a26947eb84a5157251090124a02117c9060f6d15db2f509a1c764cc4797dfeeb96ac0dbb7b51b042b050948feca0eeceeeb4567b38e5b86275e3a36ac4ff55b9764b427714426710c3631a29011ab901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000018405f463878252088454fd605080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a010d3a79253db9e4307bd3f2f714b375f5aeb1a353e8faf2c275e4d45d3d9d49c88482c8d8082a0f5ecf863f86180018404c4b43294095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca01e4e724272d9bc78a982f20019a4bea0818427ab75bc39f0a8581055303dab2fa0e1e08de6b6e62a368e174cf426ce7f6df2f593d453adb890de00efc63a8c582dc0",
+                "transactions" : [
+                    {
+                        "data" : "0x",
+                        "gasLimit" : "80000050",
+                        "gasPrice" : "1",
+                        "nonce" : "0",
+                        "r" : "0x1e4e724272d9bc78a982f20019a4bea0818427ab75bc39f0a8581055303dab2f",
+                        "s" : "0xe1e08de6b6e62a368e174cf426ce7f6df2f593d453adb890de00efc63a8c582d",
+                        "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+                        "v" : "28",
+                        "value" : "10"
+                    }
+                ],
+                "uncleHeaders" : [
+                ]
+            },
+            {
+                "blockHeader" : {
+                    "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+                    "coinbase" : "0000000000000000000000000000000000000000",
+                    "difficulty" : "131136",
+                    "extraData" : "0x",
+                    "gasLimit" : "99804806",
+                    "gasUsed" : "21000",
+                    "hash" : "a45bc709aa7c382c5cc9576cbf86865ce44eb5cb6da35a82e2de402a36be0985",
+                    "mixHash" : "2addc2ca0f0cd2ab8dc29a17fb18afa35fb0a20e6ce0b91fe6058a002d5f86dc",
+                    "nonce" : "72ac24eff4c0b511",
+                    "number" : "2",
+                    "parentHash" : "89cbb1c4aed1dd11118dd30537a050f60e3c3ab2a75f931377ae5b8e4ce01556",
+                    "receiptTrie" : "9f4d63754d02ccfa9a28d8a5795c462827a14370f01ec43925c95cd172b32672",
+                    "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+                    "stateRoot" : "9c6c6cdb405d0d1435cf5fba044c72eed942c2764fb11062a17349b819f87252",
+                    "timestamp" : "1425891413",
+                    "transactionsTrie" : "d7d5752b4ce98cb3e69da2f7af9a8ecfff1d1e002e9226f6b4262a5ff06e3a2d",
+                    "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+                },
+                "rlp" : "0xf90283f9021ba089cbb1c4aed1dd11118dd30537a050f60e3c3ab2a75f931377ae5b8e4ce01556a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a09c6c6cdb405d0d1435cf5fba044c72eed942c2764fb11062a17349b819f87252a0d7d5752b4ce98cb3e69da2f7af9a8ecfff1d1e002e9226f6b4262a5ff06e3a2da09f4d63754d02ccfa9a28d8a5795c462827a14370f01ec43925c95cd172b32672b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020040028405f2e6868252088454fd605580a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a02addc2ca0f0cd2ab8dc29a17fb18afa35fb0a20e6ce0b91fe6058a002d5f86dc8872ac24eff4c0b511f862f8600180837a120094095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca0e0265f78919277dddb484cd94f045b3c27b46360b4e278f1d50da9dc723fef4aa057c4916c08d212aa2a55321ec415e7b76fb58fde702b4b2e7d393e1883488500c0",
+                "transactions" : [
+                    {
+                        "data" : "0x",
+                        "gasLimit" : "8000000",
+                        "gasPrice" : "0",
+                        "nonce" : "1",
+                        "r" : "0xe0265f78919277dddb484cd94f045b3c27b46360b4e278f1d50da9dc723fef4a",
+                        "s" : "0x57c4916c08d212aa2a55321ec415e7b76fb58fde702b4b2e7d393e1883488500",
+                        "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+                        "v" : "28",
+                        "value" : "10"
+                    }
+                ],
+                "uncleHeaders" : [
+                ]
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "100000000",
+            "gasUsed" : "0",
+            "hash" : "0ef7e09a5afada6e6c62f9aa2816b4880877f5cf3f061d316d441bcf4a781c5e",
+            "mixHash" : "e2d79d3ba9c6f60140f847f0b708585ab95143ee278799954bb4b72ad697d5da",
+            "nonce" : "259eb77837632668",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "7dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    }
+}

+ 624 - 0
tests/files/BlockTests/bcInvalidHeaderTest.json

@@ -0,0 +1,624 @@
+{
+    "DifferentExtraData" : {
+        "blocks" : [
+            {
+                "blockHeader" : {
+                    "bloom" : "00000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000040000000000000000000000000000000000000000000000000000000",
+                    "coinbase" : "0000000000000000000000000000000000000000",
+                    "difficulty" : "131072",
+                    "extraData" : "0x42",
+                    "gasLimit" : "125000",
+                    "gasUsed" : "22027",
+                    "hash" : "f55e51dc6fdac6f0a73e07faab1eef011960b61dfb81bb7148d5a80ca439807f",
+                    "mixHash" : "75e030d34e06332819df95690bfcfeec718bbe92822930f2f058873d9d514a7b",
+                    "nonce" : "0cbb5d031bf6740a",
+                    "number" : "1",
+                    "parentHash" : "e2abece309dd5941a1b0fb0212de26bf1380a74ba2d4a7363fb478d97e2c3e13",
+                    "receiptTrie" : "f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304b",
+                    "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+                    "stateRoot" : "2debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cb",
+                    "timestamp" : "1425891929",
+                    "transactionsTrie" : "435436c82e71c7f4dc81f2458164477157e5b507e5db724a4b6a4e1ea561ce19",
+                    "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+                },
+                "rlp" : "0xf90286f9021aa0e2abece309dd5941a1b0fb0212de26bf1380a74ba2d4a7363fb478d97e2c3e13a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba0435436c82e71c7f4dc81f2458164477157e5b507e5db724a4b6a4e1ea561ce19a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd625942a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a075e030d34e06332819df95690bfcfeec718bbe92822930f2f058873d9d514a7b880cbb5d031bf6740af866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba095e628c66e5942993f5cd84385b12392d94d55158189154a717bff90f0ae7426a08dd530e6e0e689d41e3ecb2cc8f30ad0c2312004efa02fae29e9ff0af70f3c5ac0",
+                "transactions" : [
+                    {
+                        "data" : "0x",
+                        "gasLimit" : "50000",
+                        "gasPrice" : "10",
+                        "nonce" : "0",
+                        "r" : "0x95e628c66e5942993f5cd84385b12392d94d55158189154a717bff90f0ae7426",
+                        "s" : "0x8dd530e6e0e689d41e3ecb2cc8f30ad0c2312004efa02fae29e9ff0af70f3c5a",
+                        "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+                        "v" : "27",
+                        "value" : "5000000000"
+                    }
+                ],
+                "uncleHeaders" : [
+                ]
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "e2abece309dd5941a1b0fb0212de26bf1380a74ba2d4a7363fb478d97e2c3e13",
+            "mixHash" : "f07415280db34cb25831fb24f503ad80f6c839026ab0c20e9350611befe47f64",
+            "nonce" : "ba0f149e20920f20",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "log1_wrongBlockNumber" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa0ce46d8a28d0a1a8753f273f4ffa3c29750cd160278f9c765fa4e411d10250e21a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba0cc24be2d4c9a65a6890c9648f35809c736457f47b82786913d5ffb354fc326d9a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000028301e84882560b8454fd626280a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c9811741ad257716c4bfe358d29fc829539c47f8c554c6fa258a49c3741ae7858838a768145a941c00f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba05385247d4f678795cf2900dd6b5d1fe16da4669d221d72b477749e74bcba5096a0f38ff388fd6cdb491adc03fb1844332a81882aefa7fc507eca5cf01598c14370c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "ce46d8a28d0a1a8753f273f4ffa3c29750cd160278f9c765fa4e411d10250e21",
+            "mixHash" : "91079bc485ed7ee3f8409be8341207e5cd293840c66edd92a74823a30a7d40d4",
+            "nonce" : "a77943e052ba2797",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "log1_wrongBloom" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa05eff275392dd24ff0c170707082d9ecab5ea40b0c6ed01fd413f1e15b83069a8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba09ed68a94f10330d8773a8ae26ef5e5ddf2f96a23acfcd95427b921a7cbccbad0a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd626880a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0ac193c61800bf02d117483df9151d02f23de3d5afcfda70a21591c605943c6da880f84b3494dbbea11f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca01524ca51a7c9bc81bd3aa45a28ba9c0582eb1acae091ac742730be5fbe3ce53ba0d4fd5561911ae790f0de5f1aac4a303658eb4a6441e328c6dfae0f2f4073b2a8c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "5eff275392dd24ff0c170707082d9ecab5ea40b0c6ed01fd413f1e15b83069a8",
+            "mixHash" : "cd9a8bd7b84008c82dec114ab7b515a4e6adb3353030e4e84a8cd8bdc497397f",
+            "nonce" : "a26838476709ea09",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongCoinbase" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa0123e4ec7e8916d16402ad4ed16fc8f07e917c1c906231d3fecf9f92b957fb508a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba0c0df69b7d56d41b214e52f8c432fa55e9e95784020eec67f0dcf7df41dab4ce0a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd627780a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a02429c3fd5b502c076369071fb36a0105772acafc502088e86770555676dbcf2e881aa91bea8bd11cc3f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba034722697c54f0906c094e67a7f39fa833a25d385470470feccc7135256a49e60a01c389d36e2d07a3a14ed3298f7c1e2eefc10ccb4a9655bdfccccc7bac69e6179c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "123e4ec7e8916d16402ad4ed16fc8f07e917c1c906231d3fecf9f92b957fb508",
+            "mixHash" : "af08b7a9c3f080f8f9a46658903fd009b1dc57bd975a421a7a00ca5e62d7bed2",
+            "nonce" : "8e37a8488974bc53",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongDifficulty" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90285f90219a0812da7d6bfa58c6b14b510e39880884890e1ecd07d82c990155293fa97243e63a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba0ca089ecec69bde13f38458152034f8f9314005d4fcabca45cbc48d8c6f92e023a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb9010000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000040000000000000000000000000000000000000000000000000000000822710018301e84882560b8454fd629d80a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0a877c770311e2fedebf9be3f67202af6f2ac47d13b2c88bc456a40d84f9a623888b014794d7a355b18f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca022b52e6f46371bee47fe2335e9251abef9cd002061cfda03c52e2d22f3d4829ea0f8921f56ee33532ac86146da5b36ca21157925baa663c60e76242ac6a8257c9bc0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "812da7d6bfa58c6b14b510e39880884890e1ecd07d82c990155293fa97243e63",
+            "mixHash" : "2564f5b063915e44a817fde000cfdcf7a1e8276525f7031fdf676a37ed1801dd",
+            "nonce" : "7ed5d8dd724d54d3",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongGasLimit" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa078680505489c44da0c25423eda6dd472f5c30934d40b3659beba9a04288cc9f2a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba026792024010de4d69a85da4b671b54ff63615dd4d834736b1981c66464f8865ca0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb90100000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000400000000000000000000000000000000000000000000000000000008302000001830186a082560b8454fd62c380a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0615696893d1a00872fa39aeaade305912f146941854c4cd133631adcc667bbaa889df5942e507d3cdaf866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba02ffb90e65ee4d0513175e0a62627faea27e8e52c430191faf5ea98663a1a9fd1a095681e6584499c4fa0b22fef2767afbdc505221aa6455436fab69361ab0a8c84c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "78680505489c44da0c25423eda6dd472f5c30934d40b3659beba9a04288cc9f2",
+            "mixHash" : "df4a28d26eb59bb86f900449a6accdcae1365916ba47d123e3f2e86735b4b5f4",
+            "nonce" : "47e2068ec55ead5a",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongGasUsed" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90284f90218a039f7b28d4aca01d51e215c68113b755272962d12526a94eb7fa8148d5c118bafa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba056b3c4ed59c67c169b2df790bf702b941c2646bbabc232ef36c10c50a29a9c1aa0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e848808454fd62f980a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0fb3c6d54bbcae15b336093a8be15d8cc2eb748ef2387c8e3eaab31b8c8caad468884dd4cd1fe09214ff866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba0976c1e7dfef9251c11d02f492164d0f30630af1c0e8080b45a54ef8d1d0823f3a00366e6f1aeabe295454826fb0cb15ac5b3c716e37f7b6319c3de7073ddfbcf68c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "39f7b28d4aca01d51e215c68113b755272962d12526a94eb7fa8148d5c118baf",
+            "mixHash" : "9eb69393e7e8102b0835764a3d8f4fe5e906824fa812e489c475b82ff629b1d5",
+            "nonce" : "441ebd6f16b18963",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongNumber" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa0e59478d0389a906b2735977573b2d001dac7a51317eedf1c43f4c8c1f79d6361a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba0e98b05bf26e1dd4e60026ed6e7fa66ddc50db2d287486d1d296117d7531242b0a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000808301e84882560b8454fd633f80a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0ce112f7bca4b72a6c52d445dfc1874062c17a7b5c76281b42358d949def9fa0088b6bd72b05d17b99ef866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca0e720687089b33e173d18bcd79f34813ab47ad36669a28af145f48e8162077f64a00788c64cb0422740a4bcd01ccff20313b69d4c4026ac1a0883c73bbe7fcb4698c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "e59478d0389a906b2735977573b2d001dac7a51317eedf1c43f4c8c1f79d6361",
+            "mixHash" : "251efbb211354c8c9c3b69cc2dc9a9b2961bb3d9a7a6d3897f7d89c7cb18212b",
+            "nonce" : "dcdffc67766ec51c",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongParentHash" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba02fc7cb87c55108b1e6bc0838bd2b19e34353aee11f211aa8746b27f5fc643e0fa0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd639980a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0d62665b696d1ccfeb4312883a48f21b9ed014cedfeb684c371ed64a96fb9b6f5881f8eb6ae61948baef866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba0cf3506d6323a0f29310684f732c2f8fb12ef036b484eb6234f1ca24e6df93afba058d284f2d9fe0b7b70947670d0396b87fbdf3e55d41b4b8450b478d039364e9bc0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "0fda5185f12ad285f5f2d3823a90c7bc8c4a66a2c81d27829849655556e146db",
+            "mixHash" : "204ca076479f838d1bae80cad8c36fbedb21fd96a16093f33761353fbbbe42d2",
+            "nonce" : "d661653e6160020a",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongReceiptTrie" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa0504fec052c7527b57aba1054cafc66deb9ada5f71f6102718dbd06aab77b70d3a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba05ebf8751931d6ad6e32ec8424bd5662196ea403b60cda7c0a6d7cb6c076a0952a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd63db80a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a05e57b4159a1d200d32ab7b244e77dfbb7149d9f5e1bf192768a984d045d4652388a25e2824ff8534e0f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca0793d8c0fb1e1f2acc7ea006d7bd24024dd4e07849bb690933852a30cce7ab766a0e6c775a0bbf37551462f3fe78c3f044465e64c3747a59d61d3ee1e70ccda2e8ec0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "504fec052c7527b57aba1054cafc66deb9ada5f71f6102718dbd06aab77b70d3",
+            "mixHash" : "ad432bd0b5a060a3bd5c20e09032b118053ccb351f4a81076a620f36ff9cfa2e",
+            "nonce" : "d62fbfa229a41af2",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongStateRoot" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa0ff29610b3fdd8fefc444f14fec66cdc23b633531fc3f6a99796348c77b767ef4a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0f99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903aa004b3aa1df1a8151fb6fd47fc079db02ea43c1029a34cf2cb3ed2809a5930750ea0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd63e680a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c7e122fa10f689934bef6786f114da1199c948c111cdbec78406c4ecbade47c9882f56d86cee115e0df866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba0962c3181082312d787cfa68bf583d1c3f3f04a1bee8851c855091bb53ca30757a0374bf08e1822c2c01ded6f529cfbd67863e8dab1118c2da3c87b42572c0cba60c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "ff29610b3fdd8fefc444f14fec66cdc23b633531fc3f6a99796348c77b767ef4",
+            "mixHash" : "f9ec9b9fcd570eadf821669c025353b79a93a5e0283ea8f813bc592f52a91be4",
+            "nonce" : "fa43b409bdbdd1bb",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongTimestamp" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa05445751cd5fc3b9104d64ad6956a1bce6ca3c24989b897c1c409337506f4133ca01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba0df45c519f1669250855a02e574e3c812ecb6c594228da88ecc1f90c470073763a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454c98c8080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a04f21e27f508fe8c723864010c513eb6da66516b7e48248e02263413d110923fb8899f218ccf0fbeaa8f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca00902e8df5f49c329f8724aef942d15f4edb2c6b440bdddfe292c61b9865cbfbfa01df319cef696fa173049fd9d334559673cff04a690ca954d56bce0bb4dda8d37c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "5445751cd5fc3b9104d64ad6956a1bce6ca3c24989b897c1c409337506f4133c",
+            "mixHash" : "1f3167f87c6f7bf6641260148dd5445ba94ba87ab3f6e9235ec8baed7374463b",
+            "nonce" : "c9fcb36fc1e0912f",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongTransactionsTrie" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa03fea5e985ee6eac71e3a3a68f2c458cf3899372438171dbbdc1f74a70389474fa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba055e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd648280a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0e1c8a48340d38537eb2fe7128755ec3d02989154bba83095048e77d28b1a601f882df1305eeee28f85f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca027071de86529138d7caa4964d221a5fa82c33187fbce894d275f5e1db66202c9a0c098a5ce096f80f48144d481b5b79e1fbde5371c68be5427e8fbcaf141054978c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "3fea5e985ee6eac71e3a3a68f2c458cf3899372438171dbbdc1f74a70389474f",
+            "mixHash" : "a25a1d2fe0143dbef02eb6540b02b8add4ec3387a9d638d159b48eb74077d7d3",
+            "nonce" : "8abb0cf0edbf09d6",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "wrongUncleHash" : {
+        "blocks" : [
+            {
+                "rlp" : "0xf90286f9021aa0f777ae0f828d5bbc96bb8a9130ceadef72e54a31194d5477b96ab06da202a925a00dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a02debf71e4cc78eaacdd660ebc93f641c09fc19a49caf6b159171f5ba9d4928cba007e4571785abf822ad04761eaa46207009484aaf9b31795f21a0304ad45ce101a0f315ec0a9ad4f2db3303623360931df1d08bfdd9e0bd4cbbc2d64b5b1de4304bb901000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000004000000000000000000000000000000000000000000000000000000083020000018301e84882560b8454fd64a380a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0ef7a433dd31de89c0f1044bc842402ac533b426d3f898bb565a9c1eff4282b8588780de3b1d80c0be5f866f864800a82c35094095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca0391f0c3474599249a774b58f40560c57a14c543d4cfdf7bbc41ad5bb083b95e4a0c454e61485929d93d7bcf4641ad27be509e327d19d309e5b6c5ca68afcf28b47c0"
+            }
+        ],
+        "genesisBlockHeader" : {
+            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
+            "coinbase" : "8888f1f195afa192cfee860698584c030f4c9db1",
+            "difficulty" : "131072",
+            "extraData" : "0x42",
+            "gasLimit" : "125000",
+            "gasUsed" : "0",
+            "hash" : "f777ae0f828d5bbc96bb8a9130ceadef72e54a31194d5477b96ab06da202a925",
+            "mixHash" : "eb660bea6f2e553d986aa70a39862f0fe49292251fdc708d0473ab392d1e6a5b",
+            "nonce" : "9f65816d9f5282a8",
+            "number" : "0",
+            "parentHash" : "0000000000000000000000000000000000000000000000000000000000000000",
+            "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "seedHash" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "stateRoot" : "925002c3260b44e44c3edebad1cc442142b03020209df1ab8bb86752edbd2cd7",
+            "timestamp" : "1422494849",
+            "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
+            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
+        },
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "100",
+                "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600052600060206000a1",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "10000000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    }
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 97 - 0
tests/files/BlockTests/bcUncleTest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 92 - 0
tests/files/BlockTests/bcValidBlockTest.json


+ 0 - 85
tests/files/BlockTests/blForkBlocks.json

@@ -1,85 +0,0 @@
-{
-    "ForkBlockTransactionFee5" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "5c4b5a259003f5717d9fb6bedf298fbb4e07e1eaef1cfe747e4a54932fac2d5c",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019af90133a01027db44289ca8ee6531aa143f57dbd9c14cc6330fb2d255fed1c47b77be10e5a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a022fab51fe44db728d2c8caa2018ad4581688305471fea3d57aa8cbab5501ad2fa088d9a9f6cbc82e9c4b5712cbe9784f61ab95ed7de920bdbe786aa7dea3aaae3aa06e87d93a708dbd3e74a92a8bdf163d2712d173cd6cd25ff8ca07d73cc387b324b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000058454f0dccf80a006c3abf5074d88d97e9cb1270b8bfccf78bb8717c06c5094aef3ee049485171ff861f85f80018207d094b94f5374fce5edbc8e2a8697c15331677e6ebf0b64801ca012b0439b2d0a4dda01f1d3150a6b82472656dbedcc2b0ecf9d8eaa838486d6fea03feed6ee8b7746219694fbbbd4b9d97020bb4484b2a05cd1f13559eb49297e91c0"
-    },
-
-    "ForkBlockValueNotInTransactionCost" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "d499a99249cb29fcec16ea199034f5ee514fd7ef175a9c5df15e8b52ffd5dd70",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019cf90135a061d539f8f80e058754d06518a523175f12df9de06cb0b5634d988c0769fdbfaba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a069fd3f94d654a84e1160cb4864c41e9811250225355a7d5ccefe6d4f4eae9c0da042544006026776e4a36626cfe686c0a1ebf974660bb20b15e6c7e853f5055fa7a014d66747ae958fc4a9baf9684e67c135f8fb98bb5db3bdffef1f795fc8f0eb2fb84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a5188439370008201f48454f0e47b80a074d42816c7a2daeed1d7c6bcbfa2e8fb1053357622e3c3ce1c2913c1a61e9677f861f85f80018207d094b94f5374fce5edbc8e2a8697c15331677e6ebf0b64801ba04c5dbdafda364e28209857554030787414dcbf67861f727af3704ec9c616fa96a00dbb8979c53534d163f788eb28864f1a2b3ae746e015b414e1c0eed5f9ef0756c0"
-    },
-
-     "ForkBlockCreatedContractsStartWith1000eth" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "61d3037528d7dcd86166936d27b6b5335f66bee76ab04a1b18a21712b7cd2daf",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf90188f90135a000080f45353c77c06ceda8a1e532f342f553f0b12bf72cedac418faa2e8f95dea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0feb1c35a6fb17928f8df46556de8c69f274c298a7f402cc2292a2ed4722529ffa01f48e009e7ca22aa905aa0b20b22aea7db1356c6fd377b04e73096cd065367f8a013473ade795b967f4d44485c1e13ed71bd2e5033d29ab9654ad4060d4d31c178b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a5188439370008201f48454f0e60380a09ab495bd9cafdb1c78a51e8db07dc8246fa7400489660c715305ee174def2021f84df84b80018207d08080801ba0757204fb437aded3bad4e618c317824c28c0ea0b5a8a4decc91dc1599030234fa01ad3cdfff76ffecd8c2dec28d03abf77f23f7f6663a7188d15078c140bb000b5c0"
-    }
-}

+ 0 - 523
tests/files/BlockTests/blInvalidHeaderTest.json

@@ -1,523 +0,0 @@
-{
-    "DifferentExtraData" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "9991",
-            "extraData" : "42",
-            "gasLimit" : "125000",
-            "gasUsed" : "603",
-            "nonce" : "c2556997ad4b244a7c709128b3485bf54ece1a82191dec50b1f4220ac1e24f9b",
-            "number" : "1",
-            "parentHash" : "f1d8d2974fc5392207a360865ff9578f1c91d544feb4a59510f32b4d7c62c79e",
-            "receiptTrie" : "70b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5",
-            "stateRoot" : "48138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661",
-            "timestamp" : "1424083064",
-            "transactionsTrie" : "0afcdd9127ffe2e1a727b57dde38c5ec90db114f2eba50c42d6fc83ae6a5dc11",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "4c6b53b246e3ad2684af990639765a513fbdb12841af29de74520ae87863c09d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0f1d8d2974fc5392207a360865ff9578f1c91d544feb4a59510f32b4d7c62c79ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a00afcdd9127ffe2e1a727b57dde38c5ec90db114f2eba50c42d6fc83ae6a5dc11a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454e1c87842a0c2556997ad4b244a7c709128b3485bf54ece1a82191dec50b1f4220ac1e24f9bf866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca0f2ba09e58784e4cf61b716b4a85c311f8f045a923a1b55bb36861c482e461c2fa0999e5b7626076a7cf87e36d5d6f6ca134ba2b3741b87dd548f77b186202471f1c0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "5000",
-                "gasPrice" : "10",
-                "nonce" : "0",
-                "r" : "0xf2ba09e58784e4cf61b716b4a85c311f8f045a923a1b55bb36861c482e461c2f",
-                "s" : "0x999e5b7626076a7cf87e36d5d6f6ca134ba2b3741b87dd548f77b186202471f1",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "5000000000"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "log1_wrongBlockNumber" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "f6b48e0ef57cbae7f6526075cb5435540dcdcf916211719e81f87f5de130af1a",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0687e7c170ae8f319737acc01c1f250f4e32a45af7e3ed74a4c334296362a8245a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0a7169660d2acaaf9651f3b648934490aec3fc3a0b0011977463b32a5c96bd518a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707028301e84882025b8454e1c87c80a0d864173657516dcfc6f751865f8ddaec03262ed3e4a154a85eed6f63461d200af866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba098c00744227db292d6cb408f91b1c9c275cc93fbbe577f59c152c2e92d13c6eca0302f9f5da48161a3ae799f8febffbb104cef2bd9eae35a78c4ae38247b75ba40c0"
-    },
-    "log1_wrongBloom" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "0568f0590dfdbed1c0de30b3e45bbb15939b3deee281d25d7ce31882bbc668af",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0a12ef9cd662bc72cb65b7e4c3ddd1f6649a50b1e33d9399a795194cd2e71dd11a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a077b54fa2e38b064155127b559d76005656649866fea74cc7239b5abf046c3601a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018301e84882025b8454e1c87e80a04bba164774ffd2b59b3899180b906d5c39a5804a468c0e33cdc1f79b5099a491f866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca0179c900dbcd95326b314fee3a2fb224eefcf531a871c27b2fa80ec12f0c6fb89a03610bcb26412b17958804d12bfde1c6a72de65c48922479afaac9c10c3e33015c0"
-    },
-    "wrongCoinbase" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "8ae8106ba74d5514db3454923761dbbe22c48814832375e581412e72f605eb2f",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0d355399725ac03df647fd2159410ecb751ef9c5548f7551574170082d5834ab3a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a069c519d1459a7638fafd267b76ac53bc01a55b0dae58f87220bf897df4af552fa070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454e1c88180a02725c5f2e68f121b94ace1c976cc4d9792c7813ef4f59fd3d4e417e4afb6cd98f866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba090276f340ad5024f02f3e2fe166b4e09e6d61a22864d7b029e78c8fc3f400768a03c54408c28d7b8a55cbe0d862ed145174c2d66abaff48f400dfd9a9f931b3a1dc0"
-    },
-    "wrongDifficulty" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "38f58acaa68c72088c1170be9d3bcba49ebe5b0aef533da0445c0961b16382c0",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea09c641dd6a37c9f91460185794a68e68bc2b27589d9f85ef83927a1d7ce0ebc97a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0764a4f9bf80f3fd94b97724d9d62599e16c99943611f8845864903f8cbb4c8a4a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822710018301e84882025b8454e1c88480a015f130e6066c24f4b2d5f0b535b20fe50acac4bcd45cde4304267634b9a5c61ff866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca0a9c1c5281795981eca35e9c32f134ee62bcaba7c02f1020fb875b8b2bf16dbb1a02cfd84c870ba91546d1b6c3db7dc6613b628b782fdb42413cfc11eb065609686c0"
-    },
-    "wrongGasLimit" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "399a365ea3e96db1a001b2a23a05023d6c4cadec70f2636e362918ea4e85054d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea01101fad052cf0b2b09b8b0013cfa31f1ec55464b0767d61c4a40a1421648e7a7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0f3ae525b1a4352887a87b7b4831fc0d7520f59f28fd061d745e78fda1a253daba070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b8400000000000000000100000000000000000000000000000000000000000002000000000004200000004000000000008000000000000000000000000000000000082270701830186a082025b8454e1c88680a02c41c4b46fb4afdd34456dab52066a069f1860d1de222c5eca9202de86af54fcf866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba0fafeff6992eb159f0dc3b57937f580da147a8402e93c553a6aea6c8061e2a773a0131c8f5c5ea919fb154107382d2c50ab44b9d7c26d41843582f5e1d38fa18842c0"
-    },
-    "wrongGasUsed" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "f5cf109b15a08b5ca0d156a2b8f85bdfe3b849302b7e7f8da1ba7ab70706b37c",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf90198f9012ca01ab7d39c1bc87b87c41d7926c648d8537f08cbfa26b056cd12cb9ce94fc0131ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0a70155e538213c15c028835864a6ffff4b8ac2358c84a614c2ae8a53cd65a3a7a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e848808454e1c88880a0b50d9614a780db0ac711f1aa6396b5be465eae478c50a5f54e39ad8804cf6dfaf866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba071810d9e01d9aca3278e62375023bfeeeb9c57ab6aa7d6b7ce52eb608aad70aea0d3e97c6385e434939b4a6703427dfb4db25baa6a3b04de718190c3397686760ec0"
-    },
-    "wrongNumber" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "f9d9b63d116e07424288b48b8ca2ed6548a61bb3fb24203fda1b4d063ff5d855",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea05f5a3ed4e0752c14419b70ed9ce8ce58b617ce7902d92568a6a79a0542d41f2fa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a00b9e387930e29674ce009c347524cfbd8899ce83d40daa26a1778aa46be95c8aa070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707808301e84882025b8454e1c88980a0ed6bb2dd42563bcc72ef5caf4cfdfbcaee1bcc6e72aeaf584d5ac112d018508bf866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba045701d84814f5e1421761a834cd1ca2b8feb039cc48678903c5faf9ecefef485a014c288ebe8e06b843fe95c63b93fcda02d821800de20e127e2e269c4dbd2afa9c0"
-    },
-    "wrongParentHash" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "6865bfb8b7f4022340fcb1687cea03463edbcad33047062f4448f15a9200503b",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a05f16b3b181210971c4695a397b2eaf24810b2bf064213e653ac0efc5e8b9d62aa070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454e1c88b80a00e5a273ea36c941fea47656e26c996f702791928ae35b35bd3fd96f444c57255f866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba0b0cdcb7543cc2fb4074d06ba9f78c13ded24bb8d7aaa6755d7a7ecbe1f43a8d0a0e1512525e407175372d65f7d498583cc589fc9ff2dac35da642ec08790b8516fc0"
-    },
-    "wrongReceiptTrie" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "5de0c4dbfee63881e579656d4474325ac6ee840a438c0d461eb0dace1f7a1837",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0db18770c6d9b7c521110592617aa378716f0c899c3a922b9fb69a7c12bd9feb8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0d20aaaff555de48bc249cc37476d1402a6e1119aedc08d98a91533bf4c791f0fa056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454e1c88d80a04ead82301595ff86360fabfc19246c2d8e532827609783eff9c0afb658525e13f866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba0f780dd127435acc6bb6cd880542ee8d4b9cae41dcbd9d79eda5434222ece4d91a0dff1d678b87583d29de40f68855459f1dd3fa436eb8d113ef88d9d4eaf39594dc0"
-    },
-    "wrongStateRoot" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "c412436edd4f31f3c1db74bfbcddc3845373f5bca084f2f32acf9e6a117b66d8",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0f9ed1cb0715242f05abf9178d0f9d7862c67fc0ef70d294446b7dc5201668eeba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0f99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903aa00ba8f0f3a2b6b388ceab97fa3f96fbdcefa7a6990ce427392c35c670980f0dd4a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454e1c89080a0f83e50ca176217304c8768d8148ea7ed2196915d322261d843476a575babbe6af866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca0ccff0442c0da15563401e5c902787265a56670e94edd9e660212ebcd91fa25d2a002ded9070d7a18e6af78250b5bc3537817b341117d651ffe12cef7d30593965fc0"
-    },
-    "wrongTimestamp" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "b799266af1e1e18a49106cbe335ea70dc8d2ae88fdd6bbd353a9db4fa97b3904",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0029c59064cf414d8752549e4e28a47bf98ad6110c89cd8c9ef45ca4cff3e6016a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0c847121fbb1647e9bb08761002954db400412743381c22d6e802d87288f93078a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454c98c8080a0fd1fe45f090eb92975545bb53d6bd06968543d31ae3e77d04e67b07523878077f866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca01f532c282f5d72aceba55c4ec677dc2d2ca4e8642467c4ad0f69f3212a6c507ca007986811482d07632db826fb6786820d9f005ab543af46805c723b745e0dff75c0"
-    },
-    "wrongTransactionsTrie" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "b24adf49a12a8c3199c8ea07e951c0fececf5b890297d5702dbc06001314a42b",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0c2bf11cd2a281f27986ddcbc4ba03778a6d420de0a594afb0dc83c9b2b91bd1ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454e1c89780a03c574adf477a817aeef0fde7340799bbda5cddf76b498e59578de187b177080df866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca07a359dc6ed4ca1e7d612c0365a5b1e8eedd5b4cb408ec8136a80592e81771175a0d15625336fdb6d608a5ce05d93846abc278f141760731cb0742f51297df7d989c0"
-    },
-    "wrongUncleHash" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "0e768b124306c366d41042740f49b4e8dcb776bcd6aa2a82a9dfc4af338a9482",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea04565966776c5d728d6ff78eccc690e8e4769db84d736a3ca83d1dbd7ab8c13f4a00dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0d5bf5da40ccca029f9aab5f6fba625e2ac9d854967c9aa1a4bf041ae6e9305d1a070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454e1c89a80a0bc3fdc0c70ecf444d92ea0f8d79908fc3b85d2c9f474642be68855de21cf7996f866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ba05a5942989fb54d6430241d8e894ed04adf152bfd2afae472eff2961aa5808bc2a0e95eb27eeeee2bfd35704b403dfcfc8cd64a69a46008677bf0ddf0f40b1532f9c0"
-    }
-}

+ 0 - 546
tests/files/BlockTests/blInvalidTransactionRLP.json

@@ -1,546 +0,0 @@
-{
-    "BlockTransactionAddressLessThan20" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9018df90133a0a7a629572631685f28865fe32eea3d3798f9e4f7f2231432bafea5b41dcb2f6aa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0b859853b1309f7423f7ffc5adcc9ffbd3d1d7cb7354f26a59ce25983cc505321a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edd2d180a046af926f4f0e5a3bef4a02238b6fa46e557bd29cb2ba5021c7b6a9b694afff42f854f85280018207d0870b9331677e6ebf0a801ca098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4aa08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "2000",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "b9331677e6ebf",
-            "value" : "10",
-            "v" : "28",
-            "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a",
-            "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
-        }
-    },
-
-    "BlockTransactionAddressMoreThan20" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019bf90133a03c79123100a280514474c3f96098a00950cd65b2eac1982a14af3c3615e9084ba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a054f1a97f3f9c8fafa9848696a4987bbefe2141d050075638b1b30e5eb55b5a09a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454ecdbf880a0e65fea6a07e42c84a59e150da0b6d0adb98b28bb1e7c1b4f8b1be625f60f984df862f86080018207d095b94f5374fce5edbc8e2a8697c15331677e6ebf0b1c0a801ca098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4aa08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "2000",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b1c",
-            "value" : "10",
-            "v" : "28",
-            "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a",
-            "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
-        }
-    },
-
-    "BlockTransactionAddressMoreThan20PrefixedBy0" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf901a2f90133a0b387ce170324d44abb06fc0a468e8c0fd28353b8c639ddf1d703391fa98966a1a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a07d97fa7c8ea69421f26b577f59dda1c81dc37b4c392ae957f41fe1b2f6ee859fa056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454ecdcbc80a0829e96bc20909eecc4218f55e9647ef2df40cc0ce8914e9102ba1f3e3747455af869f867367b8203e89c0000000000000000095e7baea6a6c7c4c2dfeb977efac326af552d870b121ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804c0",
-        "//encodedTransaction" : {
-            "data" : "0x12",
-            "gasLimit" : "1000",
-            "gasPrice" : "123",
-            "nonce" : "54",
-            "to" : "0x0000000000000000095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "11",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
-        }
-    },
-
-    "BlockTransactionWithGasLimitOverflow" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf901b9f90133a0ac63dec108c9a4e5a237fcc8accaf7a992036fe1304667eb80a3620f330a5f93a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0d65686cfca93068623fcc2ca88e61f6b500aa038ab898de62758140165888097a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454ecdd5d80a088b36f84a1290eacc8754cc58dcdf4532294f00571542865cb2e3699f0989fb9f880f87e807ba101000000000000000000000000000000000000000000000000000000000000000094095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639936",
-            "gasPrice" : "123",
-            "nonce" : "0",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "11",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
-        }
-    },
-
-    "BlockTransactionWithGasPriceOverflow" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf901bbf90133a0789fa8a9906c6c1b824709a4f71a7b7e4122d92a3038c3fde5de9d58b5cacb24a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0e4818e70bb801d8117daa3d31ce5c1aec6dc3f2c0ab0f2276db0e97c37574c72a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454ecde9380a09ddcaeda3461bd7c9e245a196967db0f7b8122820926372893d2724af2d7033af882f88080a101000000000000000000000000000000000000000000000000000000000000000082035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "850",
-            "gasPrice" : "115792089237316195423570985008687907853269984665640564039457584007913129639936",
-            "nonce" : "0",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "11",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
-        }
-    },
-
-    "BlockTransactionWithHihghValueOverflow" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf901bbf90133a032669daa99da414d83cbc6dc706a16c6e797e48cb815c76e229d76252a980e75a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a02fb4410375a6859de949742e937287b16c7a40c8534b5e5728aa6e139cf0dc10a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454ecdf0380a0d206ada52b2c118bb01fac21f9f5049e0a1b044ad568391b90d37456be8f8acef882f880800182035294095e7baea6a6c7c4c2dfeb977efac326af552d87a1010000000000000000000000000000000000000000000000000000000000000000801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "850",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639936",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
-        }
-    },
-
-    "BlockTransactionWithNonceOverflow" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf901bbf90133a0d548f3d4ed425de51a23d82f0c29f85b98cc0eba0c59838c2d3a6795331169a7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a080b23d38770f272b3ba3cb922a238f8e23fa60762fd01e51ff8ee98f36066740a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454ecdf5e80a09b165d7dcc29b433c61b347aaa3f9be69beed47dd0e094403d1b8f7d9dd9a301f882f880a10100000000000000000000000000000000000000000000000000000000000000000182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "850",
-            "gasPrice" : "1",
-            "nonce" : "115792089237316195423570985008687907853269984665640564039457584007913129639936",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "11",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
-        }
-    },
-
-    "BlockTransactionWithRvalueOverflow" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019af90133a05168d386ee88aab0f97b0b828878add7817c2387504aaf297ce4b220f7896cdca01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0532147d5c09739de5176198ea959cb55ba2b0bb8e0dd4e9190a3648d1280fb81a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edb7ae80a0f471d7daa1e037d9aae090032ba25ad2eeebadf874f8d0e1d2199f3d80f363ccf861f85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba0fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "850",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "11",
-            "v" : "27",
-            "r" : "0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
-        }
-    },
-
-    "BlockTransactionWithSvalueOverflow" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019af90133a0306e8e1dc427ca7f0e6e3f677ed1a9d111e3201f064c788e7a24f9dbd3c3adfaa01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a09a2869096e5fe4c8e856b0e62b65e4a20d1a4f8617cc7dc80d7e3ed311827e8fa056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edb83780a0982bdf9e62cb9d9008c1dc831a89e5ee11f289a450add33dce5be793e077b0c5f861f85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2fc0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "850",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "11",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"
-        }
-    },
-
-    "BlockTransactionWithTooFewRLPElements" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf90196f90133a04f0a207e960761a1e5eae7fe6c07c0850d4a4c5b452849caba19c4d1885ded45a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0c801dd124a194433cafbb0461587a76c81c51714ccdd9dd69114b434cd0f48dba056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edb8f380a0d468c217d7c45c72b1de13508f5bb2e74f3e438443f148dbc31bdf091e8adc1cf85df85b800194095e7baea6a6c7c4c2dfeb977efac326af552d87801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
-        }
-    },
-
-    "BlockTransactionWithTooManyRLPElements" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf901a0f90133a0f8dc2081a24ccac6fcac3d48c31babfbf6891046b8342ef525e56ef84a375da2a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0c283332aed7ef07cbeef342b3f3142790d6c016ab77ae237a719ac8a02fac0d8a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edb96b80a07b146a5bb00a9953ede36abeddd46ea6b5c535258e0fc83e11116167ac4af177f867f865800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804851de98d0eddc0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "850",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "10",
-            "v" : "27",
-            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
-            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
-            "extrafield" : "128472387293"
-        }
-    },
-
-    "BlockTransactionWrongVRSTestIncorrectSize" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019ef90133a0dc2f66ba7a65fd6abcbe06e10c9e458e87eb08492b4f8beb94ec3c648c277b64a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a026095f6796dae2f09fde3da9a104f2b5d11590eb23d1c5a4a5731075e8c0389ba056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edb9e680a082b0e724075f7de4c755dc7c18a371653abf857a12a5ca135700f571d12ef608f865f86380018207d094b94f5374fce5edbc8e2a8697c15331677e6ebf0b0a801ca298ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a02c3a28887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a302c3c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "2000",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
-            "value" : "10",
-            "v" : "28",
-            "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a02c3",
-            "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a302c3"
-        }
-    },
-
-    "BlockTransactionWrongVRSTestVge31" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019af90133a028cad44f749a888533e4f33593725df09708a30bc88c7e2844368a3e3fab1f2ba01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0b60afaa85d23fc4a399820f4f8d4594cb817cbab1763c66a60153e0aba36c532a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edba4380a00744f0a5b9fc32ecdca5949a2030d703dfb75816e34fa69d92fb348c9ff2fad4f861f85f80018207d094b94f5374fce5edbc8e2a8697c15331677e6ebf0b0a801fa098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4aa08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "2000",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
-            "value" : "10",
-            "v" : "31",
-            "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a",
-            "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
-        }
-    },
-
-    "BlockTransactionWrongVRSTestVl27" : {
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "10000000000000000000000",
-            "gasUsed" : "0",
-            "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "0x5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "nonce" : "0",
-                "code" : "",
-                "storage": {}
-            }
-        },
-        "rlp" : "0xf9019af90133a0647b2d56a77be9ed758038ac237402b9b9480e474ab296ad552fa465c9056ba1a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a07bbdccbcf64104a3f2517a0e03f31b9f42987bac6f9ed7f19640a1a76a31b7a3a0ba5040aad1cc53ae09d6bb11cff18dd2ed8b5027ba382ef38634c8ec46f0db8ea056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018a021d925a518843937000808454edba9d80a01607d064b978b14b5beeafb5e56506524aadb3fed1b87079c3d0a999448b7440f861f85f80018207d094b94f5374fce5edbc8e2a8697c15331677e6ebf0b0a801aa098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4aa08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3c0",
-        "//encodedTransaction" : {
-            "data" : "",
-            "gasLimit" : "2000",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
-            "value" : "10",
-            "v" : "26",
-            "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a",
-            "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
-        }
-    }
-}

+ 0 - 514
tests/files/BlockTests/blValidBlockTest.json

@@ -1,514 +0,0 @@
-{
-    "SimpleTx" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "9991",
-            "extraData" : "",
-            "gasLimit" : "125000",
-            "gasUsed" : "500",
-            "nonce" : "3da2a6b26a5a25c600d1403055dd784834d8f5a5b94c1930874ea5c32437789d",
-            "number" : "1",
-            "parentHash" : "3bee1d0f5a37345d650c4daae9e266770fb6c0d4aed5150163798bec3e2c87e2",
-            "receiptTrie" : "bb866bc40bcf83ac9f994fde3f14b7b7e1cca02c22d069671202cf9f8526dc7f",
-            "stateRoot" : "4fec5d9b1a753965b14b54c36ecbf9fe0e3dbe6fa9add500a1a48bea3cfe3e1c",
-            "timestamp" : "1424950585",
-            "transactionsTrie" : "ff1093458e25a4aaaaad06d2ba933e373d198da48da58e9bb594637915f44735",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "17248592817ed1d364c75d57081fa1f52e2c7c8478de276f6fc11adbc05e91fd",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf90195f9012ea03bee1d0f5a37345d650c4daae9e266770fb6c0d4aed5150163798bec3e2c87e2a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a04fec5d9b1a753965b14b54c36ecbf9fe0e3dbe6fa9add500a1a48bea3cfe3e1ca0ff1093458e25a4aaaaad06d2ba933e373d198da48da58e9bb594637915f44735a0bb866bc40bcf83ac9f994fde3f14b7b7e1cca02c22d069671202cf9f8526dc7fb84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018301e8488201f48454ef053980a03da2a6b26a5a25c600d1403055dd784834d8f5a5b94c1930874ea5c32437789df861f85f800a8201f494095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca075943511743f2c15bae7628bc7a44ab22b3c02976569d382978ba493853df9f1a078184451dac2d3b83f6ee7d17700b499b1a0519221177158d64911bd9e14157dc0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "500",
-                "gasPrice" : "10",
-                "nonce" : "0",
-                "r" : "0x75943511743f2c15bae7628bc7a44ab22b3c02976569d382978ba493853df9f1",
-                "s" : "0x78184451dac2d3b83f6ee7d17700b499b1a0519221177158d64911bd9e14157d",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "10"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "diff1024" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "1024",
-            "extraData" : "",
-            "gasLimit" : "125000",
-            "gasUsed" : "500",
-            "nonce" : "b262633ad96e55d18a5f9275fc1901e1e5af10fc1aacc6f7b48c9e6e1d420807",
-            "number" : "1",
-            "parentHash" : "11c0ea780840d0607398276bb0117d874f3d9e321b9e31fd87cbc05d5b9af646",
-            "receiptTrie" : "54dda5bb38763a85fbd62f836eec4930668bd1de5d633ab94f7594d04344a59d",
-            "stateRoot" : "894e5f02e855f8f3ac078fb4e45a2690442f4030fb81d928b1878f7356dd86e1",
-            "timestamp" : "1424950586",
-            "transactionsTrie" : "2e8cd07205dee51995b326044876154d2a15c98e99801809d78dc11895cf6e2e",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "1024",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "0cbc1b0135ed0bbeab8f10bfc2ca9295e4c7cdd5ca4617e1d2f0fa31b2e1c427",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf90195f9012ea011c0ea780840d0607398276bb0117d874f3d9e321b9e31fd87cbc05d5b9af646a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0894e5f02e855f8f3ac078fb4e45a2690442f4030fb81d928b1878f7356dd86e1a02e8cd07205dee51995b326044876154d2a15c98e99801809d78dc11895cf6e2ea054dda5bb38763a85fbd62f836eec4930668bd1de5d633ab94f7594d04344a59db84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000820400018301e8488201f48454ef053a80a0b262633ad96e55d18a5f9275fc1901e1e5af10fc1aacc6f7b48c9e6e1d420807f861f85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca06a3a352ee6ae21a0b2f2c822a349ef0ee2bb34c27b48090b391916125130a746a07fe8e918db62c57b287af41f2c01a6c997654a2eff32d1fb0a5a237116d5f1fdc0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "850",
-                "gasPrice" : "1",
-                "nonce" : "0",
-                "r" : "0x6a3a352ee6ae21a0b2f2c822a349ef0ee2bb34c27b48090b391916125130a746",
-                "s" : "0x7fe8e918db62c57b287af41f2c01a6c997654a2eff32d1fb0a5a237116d5f1fd",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "10"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "diffTooLowToChange" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "1024",
-            "extraData" : "",
-            "gasLimit" : "125000",
-            "gasUsed" : "500",
-            "nonce" : "a9862fb84fe6d9b22401a47d8f8a6d7b24f65f99ff10b570c006aefe7279bee7",
-            "number" : "1",
-            "parentHash" : "f73b6db51ca294b7a0c17af5588fbfa7cedf89a1e5a809f6bfd0d98e22a12df4",
-            "receiptTrie" : "54dda5bb38763a85fbd62f836eec4930668bd1de5d633ab94f7594d04344a59d",
-            "stateRoot" : "894e5f02e855f8f3ac078fb4e45a2690442f4030fb81d928b1878f7356dd86e1",
-            "timestamp" : "1424950587",
-            "transactionsTrie" : "1b32fedb838dc202fea566249fff445adc55fb9cb5ccf07c7e1021a5410ae5d2",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "1023",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "bd3e8d220e0d5642054ac5a9e6870ac3e62bce45e1c53954cf5a86a66cd30d16",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf90195f9012ea0f73b6db51ca294b7a0c17af5588fbfa7cedf89a1e5a809f6bfd0d98e22a12df4a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0894e5f02e855f8f3ac078fb4e45a2690442f4030fb81d928b1878f7356dd86e1a01b32fedb838dc202fea566249fff445adc55fb9cb5ccf07c7e1021a5410ae5d2a054dda5bb38763a85fbd62f836eec4930668bd1de5d633ab94f7594d04344a59db84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000820400018301e8488201f48454ef053b80a0a9862fb84fe6d9b22401a47d8f8a6d7b24f65f99ff10b570c006aefe7279bee7f861f85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca04c60ee7469c4b1f722920657d4787e5b9c48ffb6a391dbc5ac10f7196148413ba08a26c8550de8f866222abac75a02344275e126b5371a52533536ea74874740b9c0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "850",
-                "gasPrice" : "1",
-                "nonce" : "0",
-                "r" : "0x4c60ee7469c4b1f722920657d4787e5b9c48ffb6a391dbc5ac10f7196148413b",
-                "s" : "0x8a26c8550de8f866222abac75a02344275e126b5371a52533536ea74874740b9",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "10"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "gasLimitTooHigh" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "9991",
-            "extraData" : "",
-            "gasLimit" : "999023",
-            "gasUsed" : "500",
-            "nonce" : "ebe9f4c35341ad85d91f0145b900880f06354622b12c54bc5649faabbd35fb26",
-            "number" : "1",
-            "parentHash" : "a2806025a525a8f893160d1e2f752c20059af2cc5f2e9508479db92dd9b865d8",
-            "receiptTrie" : "c0d1f2dbd06e111e8d780ce87efa268cc26ea15be97cf99c6dab7c039726e357",
-            "stateRoot" : "ca9c04defbe0de69545bedb63550ae00cc8111dd66ba643044500a7a22f16797",
-            "timestamp" : "1424950588",
-            "transactionsTrie" : "2af91939f077ba429bde7b18806aec7307019c0c1244e585bc6be02dd64cb6aa",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "1000000",
-            "gasUsed" : "0",
-            "nonce" : "48ee382bac733242fbc01aafb08c829f6b5b65dd2861d5cc19854c9bd3e85b23",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf90195f9012ea0a2806025a525a8f893160d1e2f752c20059af2cc5f2e9508479db92dd9b865d8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0ca9c04defbe0de69545bedb63550ae00cc8111dd66ba643044500a7a22f16797a02af91939f077ba429bde7b18806aec7307019c0c1244e585bc6be02dd64cb6aaa0c0d1f2dbd06e111e8d780ce87efa268cc26ea15be97cf99c6dab7c039726e357b8400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082270701830f3e6f8201f48454ef053c80a0ebe9f4c35341ad85d91f0145b900880f06354622b12c54bc5649faabbd35fb26f861f85f808082035294095e7baea6a6c7c4c2dfeb977efac326af552d870a801ca07c4786bb4c6101ac14769189e96be62b041fe5956a74d994496c501eb1a3d8d1a014f126999f50f4111a3493d7891d484dfefced975c0714517abebbb72d2b4262c0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "850",
-                "gasPrice" : "0",
-                "nonce" : "0",
-                "r" : "0x7c4786bb4c6101ac14769189e96be62b041fe5956a74d994496c501eb1a3d8d1",
-                "s" : "0x14f126999f50f4111a3493d7891d484dfefced975c0714517abebbb72d2b4262",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "10"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "gasPrice0" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "9991",
-            "extraData" : "",
-            "gasLimit" : "125000",
-            "gasUsed" : "500",
-            "nonce" : "2fd4ec0f0dda5be369aa5ff132c66a9e96d151022cdac6ae24b10d4ce5b2c574",
-            "number" : "1",
-            "parentHash" : "b94d005ca0d8da194c6b1f731174a55cdaa221ac3b08d933930a7f583794a2b7",
-            "receiptTrie" : "c0d1f2dbd06e111e8d780ce87efa268cc26ea15be97cf99c6dab7c039726e357",
-            "stateRoot" : "ca9c04defbe0de69545bedb63550ae00cc8111dd66ba643044500a7a22f16797",
-            "timestamp" : "1424950589",
-            "transactionsTrie" : "0a52b6df5bfbe423c5e07d8566667406585ed612019cf36f7fd09eb09dccf8f0",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "20795bf699894034f312110e0b299907ed89573b24844b11e2afd49d566f6fb6",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf90195f9012ea0b94d005ca0d8da194c6b1f731174a55cdaa221ac3b08d933930a7f583794a2b7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0ca9c04defbe0de69545bedb63550ae00cc8111dd66ba643044500a7a22f16797a00a52b6df5bfbe423c5e07d8566667406585ed612019cf36f7fd09eb09dccf8f0a0c0d1f2dbd06e111e8d780ce87efa268cc26ea15be97cf99c6dab7c039726e357b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018301e8488201f48454ef053d80a02fd4ec0f0dda5be369aa5ff132c66a9e96d151022cdac6ae24b10d4ce5b2c574f861f85f808082035294095e7baea6a6c7c4c2dfeb977efac326af552d870a801ba0e148d993f0abe8e829dc4ffeee51a8745b2e8f3a9b8bd5b78e34f70b294e1232a03f714dc982d7ee4624b28eb824632ada5ae7a0adb3df22e60b50e256be7e99e5c0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "850",
-                "gasPrice" : "0",
-                "nonce" : "0",
-                "r" : "0xe148d993f0abe8e829dc4ffeee51a8745b2e8f3a9b8bd5b78e34f70b294e1232",
-                "s" : "0x3f714dc982d7ee4624b28eb824632ada5ae7a0adb3df22e60b50e256be7e99e5",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "27",
-                "value" : "10"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "log1_correct" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "9991",
-            "extraData" : "",
-            "gasLimit" : "125000",
-            "gasUsed" : "603",
-            "nonce" : "79f5c33b6d1ffe3aa783b7a3516ccbb9506308b0c5fa1b63803f7d5d0a49c389",
-            "number" : "1",
-            "parentHash" : "538270c3e02bc33515a4fb0a6b1bb0405369fc4ac4bf12fa273a5723abbb81fe",
-            "receiptTrie" : "70b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5",
-            "stateRoot" : "48138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661",
-            "timestamp" : "1424950590",
-            "transactionsTrie" : "b37e445ec998e683a1efa0a8764bae530769ac6cf42b34a71393edc3f4cd7b4a",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "firstBlockTest" : {
-            "block" : {
-                "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-                "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-                "difficulty" : "023101",
-                "extraData" : "42",
-                "gasLimit" : "0x0dddb6",
-                "gasUsed" : "100",
-                "nonce" : "0x498e88f5c14b0b60d6e14ce9c6cc958cbe16a1df8dd90210e50d2d77562a348d",
-                "number" : "62",
-                "parentHash" : "0xefb4db878627027c81b3bb1c7dd3a18dae3914a49cdd24a3e40ab3bbfbb240c5",
-                "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-                "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a",
-                "timestamp" : "0x54c98c81",
-                "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-                "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-            },
-            "pre" : {
-            },
-            "transactions" : [
-                {
-                    "data" : "0x60056013565b6101918061001d6000396000f35b3360008190555056006001600060e060020a6000350480630a874df61461003a57806341c0e1b514610058578063a02b161e14610066578063dbbdf0831461007757005b610045600435610149565b80600160a060020a031660005260206000f35b610060610161565b60006000f35b6100716004356100d4565b60006000f35b61008560043560243561008b565b60006000f35b600054600160a060020a031632600160a060020a031614156100ac576100b1565b6100d0565b8060018360005260205260406000208190555081600060005260206000a15b5050565b600054600160a060020a031633600160a060020a031614158015610118575033600160a060020a0316600182600052602052604060002054600160a060020a031614155b61012157610126565b610146565b600060018260005260205260406000208190555080600060005260206000a15b50565b60006001826000526020526040600020549050919050565b600054600160a060020a031633600160a060020a0316146101815761018f565b600054600160a060020a0316ff5b56",
-                    "gasLimit" : "0x0f3e6f",
-                    "gasPrice" : "0x09184e72a000",
-                    "nonce" : "0",
-                    "r" : "0xd4287e915ebac7a8af390560fa53c8f0b7f13802ba0393d7afa5823c2560ca89",
-                    "s" : "0xae75db31a34f7e386ad459646de98ec3a1c88cc91b11620b4ffd86871f579942",
-                    "to" : "",
-                    "v" : "0x1b",
-                    "value" : ""
-                }
-            ]
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "7eb0ab30c5fba8d864b374fab896adb77e7d093a7facd8832bcfd06989c9aef3",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "b62ae5e6f9473520003af46b346563240245c89d0d0e52fb542c7ffce8831eeb",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100",
-                "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) (LOG1 0 32 0) }",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0538270c3e02bc33515a4fb0a6b1bb0405369fc4ac4bf12fa273a5723abbb81fea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a048138aeddc959dc1fca7fdc228271177c7bd67186aa618bdc3cad17d50608661a0b37e445ec998e683a1efa0a8764bae530769ac6cf42b34a71393edc3f4cd7b4aa070b51d9eb8b72e14bd0152a2ce1fd97855a1d5edbb583ec76e8ea9b45d65fda5b84000000000000000001000000000000000000000000000000000000000000020000000000042000000040000000000080000000000000000000000000000000000822707018301e84882025b8454ef053e80a079f5c33b6d1ffe3aa783b7a3516ccbb9506308b0c5fa1b63803f7d5d0a49c389f866f864800a82138894095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca07f78998784c93043f1b6143074ec0ceb5717d15f80f4256f51dad81905574976a027c974227d9f83508c199cde5faf16d8ddc21329011b59995ba92dc3a78fa163c0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "5000",
-                "gasPrice" : "10",
-                "nonce" : "0",
-                "r" : "0x7f78998784c93043f1b6143074ec0ceb5717d15f80f4256f51dad81905574976",
-                "s" : "0x27c974227d9f83508c199cde5faf16d8ddc21329011b59995ba92dc3a78fa163",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "5000000000"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "txEqualValue" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "9991",
-            "extraData" : "",
-            "gasLimit" : "125000",
-            "gasUsed" : "500",
-            "nonce" : "e64199688147489b9708ab00e0e5ee76a8ef2d58a22f54570698c5a3cf6b3f6a",
-            "number" : "1",
-            "parentHash" : "2a1e0d239b0b325729511e9eb8c62b7fe8e42cd6086ca9851ee02bed9bb56fa7",
-            "receiptTrie" : "56f90df1c1bac86a121aababc8de0b80519a03893702b2a5847594a307b0aa50",
-            "stateRoot" : "54417a6d1eebaed6d8533952f1c6703b757e5be0981a79a589591b99bc453378",
-            "timestamp" : "1424950592",
-            "transactionsTrie" : "18625e67541060298a00285c48678fcaaf01447e1c5a5b0c7c69635d80cdeb4c",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "5bfaaf6189c57476d0e7e1ade77cd4cbfce23dfca9c4287168ac35719ec960ec",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea02a1e0d239b0b325729511e9eb8c62b7fe8e42cd6086ca9851ee02bed9bb56fa7a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a054417a6d1eebaed6d8533952f1c6703b757e5be0981a79a589591b99bc453378a018625e67541060298a00285c48678fcaaf01447e1c5a5b0c7c69635d80cdeb4ca056f90df1c1bac86a121aababc8de0b80519a03893702b2a5847594a307b0aa50b84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018301e8488201f48454ef054080a0e64199688147489b9708ab00e0e5ee76a8ef2d58a22f54570698c5a3cf6b3f6af866f86480098201f494095e7baea6a6c7c4c2dfeb977efac326af552d8785012a05f200801ca097dcd2d413c1c0e752507e4430f8df55b77beca534f11b9af46e650a9c34afafa01c9a605e8e8f145427af986f5680b92b6bf91b93c06c89a20d1a702c65b32745c0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "500",
-                "gasPrice" : "9",
-                "nonce" : "0",
-                "r" : "0x97dcd2d413c1c0e752507e4430f8df55b77beca534f11b9af46e650a9c34afaf",
-                "s" : "0x1c9a605e8e8f145427af986f5680b92b6bf91b93c06c89a20d1a702c65b32745",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "5000000000"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    },
-    "txOrder" : {
-        "blockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0000000000000000000000000000000000000000",
-            "difficulty" : "9991",
-            "extraData" : "",
-            "gasLimit" : "125000",
-            "gasUsed" : "500",
-            "nonce" : "17e6c4cef21e1847c9bfab3c3096fe17882ef622df44d443efb9d1d7b26c3ef6",
-            "number" : "1",
-            "parentHash" : "ab3c8b17136438809c12db4f9a17536c4b08072358776d91b3820fb2885bcca8",
-            "receiptTrie" : "7957b53950ec96cef653bedf32b3609ea5601a5b7613765c1b4608d7a307793d",
-            "stateRoot" : "840d3da57e6118f27e0ba0f6ab88bbaa2c4e983bd64f8110445f352dd4f1374a",
-            "timestamp" : "1424950593",
-            "transactionsTrie" : "3499f3a4feaaf979e2dd37148ca36dd3d87e7cfed5d1196242f84df8ed3d7e29",
-            "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "genesisBlockHeader" : {
-            "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
-            "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1",
-            "difficulty" : "10000",
-            "extraData" : "42",
-            "gasLimit" : "100000",
-            "gasUsed" : "0",
-            "nonce" : "c747c6574976da45ad759b0a419dc509ddcf37127a0cb3e16f5d5066abd9756d",
-            "number" : "0",
-            "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
-            "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "stateRoot" : "5a4dfc958aba3034471698fe05df217e24637181edabff9259bbc826f0424ac4",
-            "timestamp" : "0x54c98c81",
-            "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-            "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
-        },
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000000",
-                "code" : "",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "rlp" : "0xf9019af9012ea0ab3c8b17136438809c12db4f9a17536c4b08072358776d91b3820fb2885bcca8a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a0840d3da57e6118f27e0ba0f6ab88bbaa2c4e983bd64f8110445f352dd4f1374aa03499f3a4feaaf979e2dd37148ca36dd3d87e7cfed5d1196242f84df8ed3d7e29a07957b53950ec96cef653bedf32b3609ea5601a5b7613765c1b4608d7a307793db84000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000822707018301e8488201f48454ef054180a017e6c4cef21e1847c9bfab3c3096fe17882ef622df44d443efb9d1d7b26c3ef6f866f864800a8201f494095e7baea6a6c7c4c2dfeb977efac326af552d878501a13b8600801ca03ed93687d362aab9f216bd3b9ae06247c028fdc14581fcef7b0ca4b5711cbad9a06db8f2873192a708e1ea9aade4565780a0cb5726de67d2ecce408857fde5d026c0",
-        "transactions" : [
-            {
-                "data" : "",
-                "gasLimit" : "500",
-                "gasPrice" : "10",
-                "nonce" : "0",
-                "r" : "0x3ed93687d362aab9f216bd3b9ae06247c028fdc14581fcef7b0ca4b5711cbad9",
-                "s" : "0x6db8f2873192a708e1ea9aade4565780a0cb5726de67d2ecce408857fde5d026",
-                "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-                "v" : "28",
-                "value" : "7000000000"
-            }
-        ],
-        "uncleHeaders" : [
-        ]
-    }
-}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 329 - 1560
tests/files/BlockchainTests/basicBlockChain.json


+ 13 - 0
tests/files/PoWTests/ethash_tests.json

@@ -0,0 +1,13 @@
+{
+    "first": {
+        "nonce": "000000000000002a", 
+        "mixhash": "86d46c9a313b096d66609ef84a334d6c3376d3a5e13b18aa5c666094ae04a1eb", 
+        "header": "f90213a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347940000000000000000000000000000000000000000a09178d0f23c965d81f0834a4c72c6253ce6830f4022b1359aaebfc1ecba442d4ea056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b901000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000082080080830f4240808080a00000000000000000000000000000000000000000000000000000000000000000a086d46c9a313b096d66609ef84a334d6c3376d3a5e13b18aa5c666094ae04a1eb88000000000000002a", 
+        "seed": "0000000000000000000000000000000000000000000000000000000000000000", 
+        "result": "a91eb868c6262d5456a696bd59cf67191ca7578c04dc72f40c5ece41fb1c3f9f", 
+        "cache_size": 1048384, 
+        "full_size": 1073739904, 
+        "header_hash": "f71b596d43b462f63552a6d73a525dc777f172de3e9a023c8a85d3271144038b", 
+        "cache_hash": "86a62f39bc1def6c35b54babdca953425392827c1992538c145bad931c546494"
+    }
+}

+ 36 - 18
tests/files/StateTests/stBlockHashTest.json

@@ -13,21 +13,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000000010",
                 "code" : "0x600040600055600540600155600440600255",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "28500",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "71490",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "5991795a1f45b319ba9eeaad2a016d05b8e7bcde1386113f5630d27d427641a4",
+        "postStateRoot" : "4782016164122fd5f724151b5248a3c6397a8024176248a83f1ab06dd15fd335",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -44,10 +51,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "8500",
+            "gasLimit" : "28500",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -69,21 +75,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000000010",
                 "code" : "0x60014060005560024060015561010040600255",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "28500",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "71490",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "38895b1dec6e4e94204eebf737fb4669be2c81c17200ac87c8ad015a9c905258",
+        "postStateRoot" : "4180bf3804d44990168f5b3de8f3d061c3c0b6dc3f8f42f895c77cd98de5735b",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -100,10 +113,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "8500",
+            "gasLimit" : "28500",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -125,21 +137,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000000010",
                 "code" : "0x600040600055610101406001557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40600255",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "28500",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "71490",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "cffd7c0b521c88a02d0c5329d2639d2ac6e8547d738c8f39ed2d5e0e93555f2f",
+        "postStateRoot" : "0ad00ad494cd7ceedc6b27be63573f7c8831f8e5bcca798b0bcafeea53806c03",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -156,10 +175,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "8500",
+            "gasLimit" : "28500",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",

+ 13 - 6
tests/files/StateTests/stExample.json

@@ -13,21 +13,29 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000100000",
                 "code" : "0x6001600101600055",
                 "nonce" : "0",
                 "storage" : {
+                    "0x" : "0x02"
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "1000000000000000000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "41012",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "999999999999858988",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "4b4b7a0d58a2388c0e6b3b048c3c27edd6febc6f04171167ed15a77ab2e60b16",
+        "postStateRoot" : "17454a767e5f04461256f3812ffca930443c04a47d05ce3f38940c4a14b8c479",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -44,10 +52,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "10000",
+            "gasLimit" : "400000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",

+ 163 - 67
tests/files/StateTests/stInitCodeTest.json

@@ -60,7 +60,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x00",
             "gasLimit" : "20000000",
@@ -123,7 +122,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x00",
             "gasLimit" : "20000000",
@@ -193,7 +191,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x00",
             "gasLimit" : "20000000",
@@ -265,7 +262,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x00",
             "gasLimit" : "20000000",
@@ -343,7 +339,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x00",
             "gasLimit" : "20000000",
@@ -368,21 +363,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "0",
+                "balance" : "1",
                 "code" : "0x3060025560206000600039602060006000f0",
                 "nonce" : "40",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "40000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "59999",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "97cece6bf5648d3af08ae84cff4795f33c7fa0ca34b0aec566773e5e148595cd",
+        "postStateRoot" : "b172ab3228567998c69af66c3c389ea31a313f3760554b0495cb09a1085f71bb",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "0",
@@ -399,10 +401,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x00",
-            "gasLimit" : "10000",
+            "gasLimit" : "40000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -424,21 +425,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "0",
+                "balance" : "1",
                 "code" : "0x602060006000f0",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "40000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "59999",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "a7eedf1843a4a7a6e3172dd783517e9982ed7c0a3f7de975089c206967348e99",
+        "postStateRoot" : "265dea5a631897bed221b2e4e0445fcd0f09c4e19ff11c070ff1a32db5785268",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "0",
@@ -455,10 +463,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x00",
-            "gasLimit" : "10000",
+            "gasLimit" : "40000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -479,28 +486,41 @@
         ],
         "out" : "0x",
         "post" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "2",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "22176",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+                "balance" : "1",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "0",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "8b349ba4168d101eb80264bf712d8adcd342e41eda6b4bed9e805ac9a31031da",
+        "postStateRoot" : "ab2af6cb4355c873efb8d017d1100dc261e56127bb47ef2121faf67209006abb",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "2",
+                "balance" : "22177",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x600a80600c6000396000f200600160008035811a8100",
-            "gasLimit" : "599",
+            "gasLimit" : "22176",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -522,27 +542,26 @@
         "out" : "0x",
         "post" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "70000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "postStateRoot" : "bb8ecac4b17ff3b014cd53a3286ba5e42517ea8edde6a1c97de065943d3a6a2d",
+        "postStateRoot" : "e690db2aaa205cdcda6c0e0a275c234fa8b3a225cc6737d06ab638b47840235a",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "70000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x600a80600c6000396000f200600160008035811a8100",
-            "gasLimit" : "590",
+            "gasLimit" : "21590",
             "gasPrice" : "3",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -561,12 +580,19 @@
         },
         "logs" : [
         ],
-        "out" : "0x",
+        "out" : "0x0015",
         "post" : {
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "21090",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+                "balance" : "78910",
                 "code" : "0x6001601f6001601e600073b94f5374fce5edbc8e2a8697c15331677e6ebf0b6107d0f1506002601ef3",
-                "nonce" : "0",
+                "nonce" : "1",
                 "storage" : {
                 }
             },
@@ -578,7 +604,7 @@
                 }
             }
         },
-        "postStateRoot" : "262a214f1ac4aa762d10b7f47aa18ef6d8aeb6462e74a24bc5426ad4833ae3b2",
+        "postStateRoot" : "42ef55e243c47be922c62b4056fbbce8801576631352c43ed3c0a8db99922a52",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
                 "balance" : "100000",
@@ -595,10 +621,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "5000",
+            "gasLimit" : "41000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -619,10 +644,17 @@
         ],
         "out" : "0x",
         "post" : {
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "25000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+                "balance" : "75000",
                 "code" : "0x60156000526020602060206000600073b94f5374fce5edbc8e2a8697c15331677e6ebf0b611b58f15060406000f3",
-                "nonce" : "0",
+                "nonce" : "1",
                 "storage" : {
                 }
             },
@@ -634,7 +666,7 @@
                 }
             }
         },
-        "postStateRoot" : "d49e5f42842dd9e9faead37ece66d06a9f72489ec8741139627bcf1bbc95f19f",
+        "postStateRoot" : "e50a793ac270f127f73357d842a80f165f7069dde8540b6bfbff5c9dd46bdfc5",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
                 "balance" : "100000",
@@ -651,10 +683,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "15000",
+            "gasLimit" : "25000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -675,28 +706,41 @@
         ],
         "out" : "0x",
         "post" : {
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "40000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+                "balance" : "0",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
                 "balance" : "10000",
                 "code" : "0x",
-                "nonce" : "0",
+                "nonce" : "1",
                 "storage" : {
                 }
             }
         },
-        "postStateRoot" : "bb8ecac4b17ff3b014cd53a3286ba5e42517ea8edde6a1c97de065943d3a6a2d",
+        "postStateRoot" : "413c855a22b2e40a76999f9bd796cf2599b84a6b148712fe7430fc2f892a4d7c",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "50000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x6000f1",
-            "gasLimit" : "1000",
+            "gasLimit" : "40000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -717,15 +761,29 @@
         ],
         "out" : "0x",
         "post" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "32599",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+                "balance" : "1",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "67400",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "a3e1c133a5a51b03399ed9ad0380f3182e9e18322f232b816dd4b9094f871e1b",
+        "postStateRoot" : "3cfd002a3559783f75228964cc1ac46adaddec77224361d58485898a02d418c3",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
                 "balance" : "100000",
@@ -735,10 +793,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x600a80600c6000396000f200600160008035811a8100",
-            "gasLimit" : "599",
+            "gasLimit" : "32599",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -759,28 +816,41 @@
         ],
         "out" : "0x",
         "post" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "23000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+                "balance" : "1",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "76999",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "bb8ecac4b17ff3b014cd53a3286ba5e42517ea8edde6a1c97de065943d3a6a2d",
+        "postStateRoot" : "84c0364010c8d918ded07ca3c2fa555bf1dd3f116670fb237204347eec2ff004",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x600a80600c6000396000f200ff600160008035811a81",
-            "gasLimit" : "1000",
+            "gasLimit" : "23000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -801,28 +871,41 @@
         ],
         "out" : "0x",
         "post" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "22204",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : {
+                "balance" : "1",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "77795",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "bb8ecac4b17ff3b014cd53a3286ba5e42517ea8edde6a1c97de065943d3a6a2d",
+        "postStateRoot" : "b2de012ac480412426664a68a009920fb4ce8c9651543900c440070e8e286644",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x600a80600c600039600000f20000600160008035811a81",
-            "gasLimit" : "1000",
+            "gasLimit" : "23000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -843,28 +926,41 @@
         ],
         "out" : "0x",
         "post" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+            "0000000000000000000000000000000000000000" : {
+                "balance" : "1",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "11198",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "88801",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "bb8ecac4b17ff3b014cd53a3286ba5e42517ea8edde6a1c97de065943d3a6a2d",
+        "postStateRoot" : "281c38b9ee70d3f690adb447443791a390715dc7b83cb563c7cf756d0a065988",
         "pre" : {
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0x600a80600c6000396000fff2ffff600160008035811a81",
-            "gasLimit" : "1000",
+            "gasLimit" : "23000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 312 - 113
tests/files/StateTests/stLogTests.json


+ 0 - 2
tests/files/StateTests/stMemoryStressTest.json

@@ -51,7 +51,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "17592320524892",
@@ -114,7 +113,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "37791080412587",

+ 12 - 48
tests/files/StateTests/stMemoryTest.json

@@ -52,7 +52,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -116,7 +115,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -180,7 +178,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -245,7 +242,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -310,7 +306,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -375,7 +370,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -440,7 +434,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -505,7 +498,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -570,7 +562,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -635,7 +626,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -700,7 +690,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -765,7 +754,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -829,7 +817,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -893,7 +880,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -957,7 +943,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1021,7 +1006,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1085,7 +1069,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1149,7 +1132,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1213,7 +1195,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1277,7 +1258,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1341,7 +1321,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1405,7 +1384,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1470,7 +1448,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183640",
@@ -1535,7 +1512,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1600,7 +1576,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1665,7 +1640,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1730,7 +1704,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -1795,7 +1768,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183640",
@@ -1860,7 +1832,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183640",
@@ -1925,7 +1896,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183640",
@@ -1990,7 +1960,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2054,7 +2023,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2118,7 +2086,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2182,7 +2149,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2246,7 +2212,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2310,7 +2275,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2374,7 +2338,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2438,7 +2401,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2502,7 +2464,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2566,7 +2527,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "1342183320",
@@ -2629,7 +2589,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "0xff55883355001144bbccddffeeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
             "gasLimit" : "1342183320",
@@ -2692,7 +2651,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "17592320524892",
@@ -2717,21 +2675,28 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000000010",
                 "code" : "0x61010051600155",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "429496729600",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "22000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "429496707590",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "fc8d86e5ab2eca5eb27044e50bfe2708b6108df612634733913cb040fcf208a2",
+        "postStateRoot" : "bf38e7c8442426c0c0df74b74c1c6a6b044720e89b68cfb3c7bd4e0c2bdd5255",
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
                 "balance" : "1000000000000000000",
@@ -2748,10 +2713,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "1000",
+            "gasLimit" : "22000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",

+ 8 - 41
tests/files/StateTests/stPreCompiledContracts.json

@@ -58,7 +58,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -128,7 +127,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -198,7 +196,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -268,7 +265,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -338,7 +334,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -409,7 +404,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -479,7 +473,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -549,7 +542,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -619,7 +611,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -690,7 +681,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -760,7 +750,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -830,7 +819,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -901,7 +889,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -972,7 +959,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1043,7 +1029,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1114,7 +1099,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "10000000",
@@ -1185,7 +1169,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1257,7 +1240,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1272,7 +1254,7 @@
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
-            "currentGasLimit" : "10000000",
+            "currentGasLimit" : "100000000",
             "currentNumber" : "0",
             "currentTimestamp" : 1,
             "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
@@ -1281,42 +1263,33 @@
         ],
         "out" : "0x",
         "post" : {
-            "0000000000000000000000000000000000000002" : {
-                "balance" : "19",
-                "code" : "0x",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "20099981",
-                "code" : "0x6020600060006000601360026101f4f1600255600051600055",
+                "balance" : "200100000",
+                "code" : "0x6020600060006000601360026301312d00f1600255600051600055",
                 "nonce" : "0",
                 "storage" : {
-                    "0x" : "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-                    "0x02" : "0x01"
                 }
             },
             "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
-                "balance" : "92836",
+                "balance" : "365224",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "999999999999807164",
+                "balance" : "999999999999534776",
                 "code" : "0x",
                 "nonce" : "1",
                 "storage" : {
                 }
             }
         },
-        "postStateRoot" : "b67e2ee8594b1b040771d4097af8bcf05d591c20faa2369baa4e4a964e1f430c",
+        "postStateRoot" : "a753c25f66dda332d99702bbbf714586d40af0944ab8a95d33b78c525c42b33b",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "20000000",
-                "code" : "0x6020600060006000601360026101f4f1600255600051600055",
+                "balance" : "200000000",
+                "code" : "0x6020600060006000601360026301312d00f1600255600051600055",
                 "nonce" : "0",
                 "storage" : {
                 }
@@ -1329,7 +1302,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1401,7 +1373,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1473,7 +1444,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1545,7 +1515,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1617,7 +1586,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "365224",
@@ -1688,7 +1656,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "10000000",

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 494 - 0
tests/files/StateTests/stQuadraticComplexityTest.json


+ 0 - 1
tests/files/StateTests/stRecursiveCreate.json

@@ -142,7 +142,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "465224",

+ 458 - 104
tests/files/StateTests/stRefundTest.json

@@ -1,9 +1,9 @@
 {
-    "RefundOverflow" : {
+    "refund500" : {
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "45678256",
-            "currentGasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
             "currentNumber" : "0",
             "currentTimestamp" : 1,
             "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
@@ -12,36 +12,64 @@
         ],
         "out" : "0x",
         "post" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "400",
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x600154506002545060ff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+                "nonce" : "0",
+                "storage" : {
+                    "0x0a" : "0x8000000000000000000000000000000000000000000000000000000000000000",
+                    "0x0b" : "0x0de0b6b3a7640000"
+                }
+            },
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "45600",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "54400",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "50e4efc6066e4158974b1cd159d914e8eda2978d3395f0027146f4a6bb014924",
+        "postStateRoot" : "66b43c34731b76309714e8ebbcd740082785e5180c7c6a28105e985cc4fef83a",
         "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x600154506002545060ff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01",
+                    "0x02" : "0x01",
+                    "0x03" : "0x01",
+                    "0x04" : "0x01",
+                    "0x05" : "0x01",
+                    "0x06" : "0x01"
+                }
+            },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "400",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "5789604461865809771178549250434395392663499233282028201972879200395656482016",
-            "gasPrice" : "20",
+            "gasLimit" : "100000",
+            "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
-            "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b",
-            "value" : ""
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "value" : "0"
         }
     },
-    "refund500" : {
+    "refund50_1" : {
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -56,52 +84,51 @@
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x600154506002545060ff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+                "code" : "0x60006001556000600255600060035560006004556000600555",
                 "nonce" : "0",
                 "storage" : {
-                    "0x01" : "0x01",
-                    "0x02" : "0x01",
-                    "0x03" : "0x01",
-                    "0x04" : "0x01",
-                    "0x05" : "0x01",
-                    "0x06" : "0x01"
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "23015",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "76985",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "474f462c223af7131ea26e4fa90afa13d2699f5d1475d4ce9aadec59ea01afb5",
+        "postStateRoot" : "b0c57a1107e5d2f752d931cb42167d1893902c6cf4b563edf64efee021e2fe35",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x600154506002545060ff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+                "code" : "0x60006001556000600255600060035560006004556000600555",
                 "nonce" : "0",
                 "storage" : {
                     "0x01" : "0x01",
                     "0x02" : "0x01",
                     "0x03" : "0x01",
                     "0x04" : "0x01",
-                    "0x05" : "0x01",
-                    "0x06" : "0x01"
+                    "0x05" : "0x01"
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "10000",
+            "gasLimit" : "100000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -109,7 +136,7 @@
             "value" : "0"
         }
     },
-    "refund50_1" : {
+    "refund50_2" : {
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -124,7 +151,33 @@
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x60006001556000600255600060035560006004556000600555",
+                "code" : "0x6001600a556001600b5560006001556000600255600060035560006004556000600555",
+                "nonce" : "0",
+                "storage" : {
+                    "0x0a" : "0x01",
+                    "0x0b" : "0x01"
+                }
+            },
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "43021",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "56979",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
+            }
+        },
+        "postStateRoot" : "87dd26d566e797f0eee168936579dd677afebf184b84618988bf7b4c3289d0ae",
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6001600a556001600b5560006001556000600255600060035560006004556000600555",
                 "nonce" : "0",
                 "storage" : {
                     "0x01" : "0x01",
@@ -135,39 +188,85 @@
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "100000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        },
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "100000",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "value" : "0"
+        }
+    },
+    "refund600" : {
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : 1,
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x600154506002545061ffff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+                "nonce" : "0",
+                "storage" : {
+                    "0x0b" : "0x0de0b6b3a7640000"
+                }
+            },
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "38105",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "61895",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "73c582fa60e3e566845180766d925cbb38ef88d91712ac8c28751d16013adad3",
+        "postStateRoot" : "a880188f4bdc7256bb8fb3dd086146bd1a768bea9568c6a0bb03689df1ef41fe",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x60006001556000600255600060035560006004556000600555",
+                "code" : "0x600154506002545061ffff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
                 "nonce" : "0",
                 "storage" : {
                     "0x01" : "0x01",
                     "0x02" : "0x01",
                     "0x03" : "0x01",
                     "0x04" : "0x01",
-                    "0x05" : "0x01"
+                    "0x05" : "0x01",
+                    "0x06" : "0x01"
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "10000",
+            "gasLimit" : "100000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -175,7 +274,7 @@
             "value" : "0"
         }
     },
-    "refund50_2" : {
+    "refund_CallA" : {
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -190,58 +289,65 @@
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x6001600a556001600b5560006001556000600255600060035560006004556000600555",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1600055",
                 "nonce" : "0",
                 "storage" : {
-                    "0x01" : "0x01",
-                    "0x02" : "0x01",
-                    "0x03" : "0x01",
-                    "0x04" : "0x01",
-                    "0x05" : "0x01"
+                    "0x01" : "0x01"
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "2000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600155",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
             }
         },
-        "postStateRoot" : "336d6709c0a4eb5aa7936d1eb151cf7faa9c884b46393253f69e159885330034",
+        "postStateRoot" : "d9a50deea9e3a61d3338d683568b6d7f4740625dcbe510918bb59b17d43b2387",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x6001600a556001600b5560006001556000600255600060035560006004556000600555",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1600055",
                 "nonce" : "0",
                 "storage" : {
-                    "0x01" : "0x01",
-                    "0x02" : "0x01",
-                    "0x03" : "0x01",
-                    "0x04" : "0x01",
-                    "0x05" : "0x01"
+                    "0x01" : "0x01"
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "2000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600155",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "10000",
+            "gasLimit" : "1500",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
             "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "0"
+            "value" : "10"
         }
     },
-    "refund600" : {
+    "refund_CallA2" : {
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -256,60 +362,65 @@
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x600154506002545061ffff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6032f1600055",
                 "nonce" : "0",
                 "storage" : {
-                    "0x01" : "0x01",
-                    "0x02" : "0x01",
-                    "0x03" : "0x01",
-                    "0x04" : "0x01",
-                    "0x05" : "0x01",
-                    "0x06" : "0x01"
+                    "0x01" : "0x01"
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "1000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600155",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
             }
         },
-        "postStateRoot" : "60c3973fadf0cbde89c55b69b8ac46314d4fa9fc0d585b9ee75c390e3a9da00b",
+        "postStateRoot" : "2b1a17e7018ac5dd49ae05c6874fd6c1005a241c5eec68763b55a00292c87ba9",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
-                "code" : "0x600154506002545061ffff60020a600a553031600b55600060015560006002556000600355600060045560006005556000600655",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6032f1600055",
                 "nonce" : "0",
                 "storage" : {
-                    "0x01" : "0x01",
-                    "0x02" : "0x01",
-                    "0x03" : "0x01",
-                    "0x04" : "0x01",
-                    "0x05" : "0x01",
-                    "0x06" : "0x01"
+                    "0x01" : "0x01"
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000",
+                "balance" : "1000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600155",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "10000",
+            "gasLimit" : "850",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
             "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
-            "value" : "0"
+            "value" : "10"
         }
     },
-    "refund_NoOOG_1" : {
+    "refund_CallA_OOG" : {
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -323,23 +434,224 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6001f1600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "1000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
                 "balance" : "1000000000000000000",
                 "code" : "0x6000600155",
                 "nonce" : "0",
                 "storage" : {
                     "0x01" : "0x01"
                 }
+            }
+        },
+        "postStateRoot" : "91f35f1a4bb43ca165845e4b2a313421f2d94e68e70261fb0ca6ce4daea7dc85",
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6001f1600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "502",
+                "balance" : "1000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600155",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
             }
         },
-        "postStateRoot" : "4bbcf27592ac2fcdc64eecf45b8c8f37377e7d2b297344db12acd56a8a6d9fe9",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "850",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "value" : "10"
+        }
+    },
+    "refund_CallToSuicide" : {
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "10000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : 1,
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "2000000000000000010",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x01",
+                    "0x01" : "0x01"
+                }
+            },
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "20534",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "99979456",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
+            }
+        },
+        "postStateRoot" : "dc5f1097912d0bdfe23391f2a099cc95db9d58cbea4549b6ff2018379d8b4fac",
         "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "100000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x73095e7baea6a6c7c4c2dfeb977efac326af552d87ff",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
+            }
+        },
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "10000000",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "value" : "10"
+        }
+    },
+    "refund_CallToSuicideTwice" : {
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "10000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : 1,
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "2000000000000000010",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f16000556000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x01",
+                    "0x01" : "0x01"
+                }
+            },
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "20566",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "99979424",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
+            }
+        },
+        "postStateRoot" : "08978bb9dd49f1c4c46d35c11266a5b04795ea9d916a482be220d14257118762",
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f16000556000600060006000600073aaae7baea6a6c7c4c2dfeb977efac326af552aaa6101f4f1",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "100000000",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
+            "aaae7baea6a6c7c4c2dfeb977efac326af552aaa" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x73095e7baea6a6c7c4c2dfeb977efac326af552d87ff",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
+            }
+        },
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "10000000",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "value" : "10"
+        }
+    },
+    "refund_NoOOG_1" : {
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : 1,
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
                 "code" : "0x6000600155",
@@ -348,18 +660,42 @@
                     "0x01" : "0x01"
                 }
             },
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "21002",
+                "code" : "0x",
+                "nonce" : "0",
+                "storage" : {
+                }
+            },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "502",
+                "balance" : "29198",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
+            }
+        },
+        "postStateRoot" : "f553b8f28cd1e7deff7b631e12d52d9564552b027090ee3269bccd1c8ede5ed4",
+        "pre" : {
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x6000600155",
+                "nonce" : "0",
+                "storage" : {
+                    "0x01" : "0x01"
+                }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "50200",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "502",
+            "gasLimit" : "21002",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -388,15 +724,22 @@
                     "0x01" : "0x01"
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "500",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "21000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "29000",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "3267d372a060d12f996b1fda01f53b661a81e55013da90d7ec27774ec0c8b4b4",
+        "postStateRoot" : "86ab258287135fc989b8f4ee2a7a302176a7b6ece88bc10a9041be62bb0f3260",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -407,17 +750,16 @@
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "500",
+                "balance" : "50000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "500",
+            "gasLimit" : "21000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -439,22 +781,29 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000000010",
                 "code" : "0x6017600155",
                 "nonce" : "0",
                 "storage" : {
                     "0x01" : "0x01"
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "1000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "22850",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "77140",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "a98f9a59a95e7f47e25b239381678849c8dcb2f39595b4916050b00406f74364",
+        "postStateRoot" : "0a7194d5598c0c6404846ec0591eb8bb4ed55450dae7642b9db38e4bd77df5f6",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -465,17 +814,16 @@
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "1000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "850",
+            "gasLimit" : "22850",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -497,22 +845,29 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000000010",
                 "code" : "0x6000600155",
                 "nonce" : "0",
                 "storage" : {
                     "0x01" : "0x01"
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "1000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "22850",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "77140",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "a77f2277f9fb82641aee02cac48503cfd4bb7eafc2c61a701b4124450d44ab84",
+        "postStateRoot" : "e684f24153cdcc565a0698b180a3c07307d40ebf5655be1a61b99015008773f8",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -523,17 +878,16 @@
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "1000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "850",
+            "gasLimit" : "22850",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",

+ 61 - 96
tests/files/StateTests/stSolidityTest.json

@@ -13,21 +13,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100000",
+                "balance" : "100001",
                 "code" : "0x60003560e060020a90048063c040622614601557005b601b6021565b60006000f35b61014f60008190555056",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "500",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "30000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "19999",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "fb10f5e6bb91ac2c2bdd99645a174f653efd54a27e3fcac8edcfc43e25a27fe5",
+        "postStateRoot" : "1ca281e59535e0c5bbc764a6ed3ec091521d0a95c915659892367ae904b4505a",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "100000",
@@ -37,18 +44,17 @@
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "500",
+                "balance" : "50000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "//" : "run()",
             "data" : "0xc0406226",
-            "gasLimit" : "10000",
+            "gasLimit" : "30000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -70,21 +76,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100000",
+                "balance" : "100001",
                 "code" : "0x60e060020a600035048063296df0df1460285780634893d88a146034578063981a316514604057005b602e604c565b60006000f35b603a6061565b60006000f35b60466059565b60006000f35b5b600115605757604d565b565b605f6061565b565b60676059565b56",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "500",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "30000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "19999",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "c0007603bf1d9314327a2b028513ddfcadacefa4a4f987d8dd3211db25836d51",
+        "postStateRoot" : "0af08991d3f5141747ecde162774e4c0a23ecb4faa4dbe9c8fcbbcf4f83d279a",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "100000",
@@ -94,18 +107,17 @@
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "500",
+                "balance" : "50000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "//" : "testInfiniteLoop()",
             "data" : "0x296df0df",
-            "gasLimit" : "10000",
+            "gasLimit" : "30000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -127,21 +139,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100000",
+                "balance" : "100001",
                 "code" : "0x60e060020a60003504806330debb4214610020578063c04062261461003157005b61002b6004356100a4565b60006000f35b610039610043565b8060005260206000f35b60006000600160008190555060656100af600039606560006000f0905080600160a060020a03166319ab453c600060008260e060020a02600052600433600160a060020a03168152602001600060008660155a03f150505060005491505090565b80600081905550505600605980600c6000396000f30060e060020a60003504806319ab453c14601457005b601d6004356023565b60006000f35b80600160a060020a03166330debb42600060008260e060020a02600052600460e18152602001600060008660155a03f15050505056",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "35000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "64999",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "067b39d9a7a9860f1eb3ac1651eb797b573ff2c00b53acc6d6cdbc817e1cc31e",
+        "postStateRoot" : "fd62470bc8049475d5dd9b443024f14e67a9d28abde8cc2df707243b74c0c9aa",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "100000",
@@ -158,11 +177,10 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "//" : "run()",
             "data" : "0xc0406226",
-            "gasLimit" : "15000",
+            "gasLimit" : "35000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -184,21 +202,28 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "100000",
+                "balance" : "100001",
                 "code" : "0x60e060020a600035048063296df0df1460285780634893d88a146034578063981a316514604057005b602e604c565b60006000f35b603a6061565b60006000f35b60466059565b60006000f35b5b600115605757604d565b565b605f6061565b565b60676059565b56",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "25000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
+            },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "74999",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
             }
         },
-        "postStateRoot" : "0e28dbdfe5e9fc9e2edbdb90849fc7a3982d21d400c59304aa791193d5e6e3da",
+        "postStateRoot" : "cf7a8fbd8a9034f428908c1be77116fe1b42fbe7ecdbe88507b7d8dcf2f21556",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "100000",
@@ -215,11 +240,10 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "//" : "testRecursiveMethods()",
             "data" : "0x981a3165",
-            "gasLimit" : "2000",
+            "gasLimit" : "25000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -227,7 +251,7 @@
             "value" : "1"
         }
     },
-    "QuadraticComplexity" : {
+    "RecursiveCreateContracts" : {
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "45678256",
@@ -240,86 +264,29 @@
         ],
         "out" : "0x",
         "post" : {
-            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
-                "balance" : "3500000",
-                "code" : "0x",
-                "nonce" : "0",
-                "storage" : {
-                }
-            },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "6500000",
-                "code" : "0x60003560e060020a9004806361a4770614601557005b601e6004356024565b60006000f35b60008160008190555073b94f5374fce5edbc8e2a8697c15331677e6ebf0b90505b600082131560bf5780600160a060020a03166000600060007f6a7573740000000000000000000000000000000000000000000000000000000081526004017f63616c6c000000000000000000000000000000000000000000000000000000008152602001600060008560155a03f150506001820391506045565b505056",
-                "nonce" : "1",
-                "storage" : {
-                }
-            },
-            "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
-                "code" : "0x60206000600037",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "postStateRoot" : "7d5742aed246f2483ad573d595588c4b032fb2bfd596ebe7e746274925bba18e",
-        "pre" : {
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "10000000",
-                "code" : "0x60003560e060020a9004806361a4770614601557005b601e6004356024565b60006000f35b60008160008190555073b94f5374fce5edbc8e2a8697c15331677e6ebf0b90505b600082131560bf5780600160a060020a03166000600060007f6a7573740000000000000000000000000000000000000000000000000000000081526004017f63616c6c000000000000000000000000000000000000000000000000000000008152602001600060008560155a03f150506001820391506045565b505056",
+            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
+                "balance" : "1000001",
+                "code" : "0x60003560e060020a90048063820b13f614610021578063a444f5e91461003257005b61002c600435610043565b60006000f35b61003d60043561008f565b60006000f35b600060c66100cc60003960c6600054600160a060020a0316815260200182815260200160006000f0905080600160a060020a0316600060026000600060006000848787f1505050505050565b6000336000819055508160018190555060686101926000396068600054600160a060020a0316815260200182815260200160006000f09050505056006012604060c6600439600451602451601e565b60018060c56000396000f35b6000600182039150600082116031576057565b6068605d600039606883600160a060020a0316815260200182815260200160006000f090505b5050505600601260406068600439600451602451601e565b60018060676000396000f35b60018103905060008111602f576062565b81600160a060020a031663820b13f6600060008260e060020a026000526004858152602001600060008660155a03f15050505b505056000000601260406068600439600451602451601e565b60018060676000396000f35b60018103905060008111602f576062565b81600160a060020a031663820b13f6600060008260e060020a026000526004858152602001600060008660155a03f15050505b5050560000",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "100000",
-                "code" : "0x60206000600037",
-                "nonce" : "0",
-                "storage" : {
-                }
-            }
-        },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
-        "transaction" : {
-            "//" : "run(int256)",
-            "data" : "0x61a47706000000000000000000000000000000000000000000000000000000000000c350",
-            "gasLimit" : "3500000",
-            "gasPrice" : "1",
-            "nonce" : "0",
-            "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
-            "to" : "a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
-            "value" : "1"
-        }
-    },
-    "RecursiveCreateContracts" : {
-        "env" : {
-            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
-            "currentDifficulty" : "45678256",
-            "currentGasLimit" : "100000000",
-            "currentNumber" : "0",
-            "currentTimestamp" : 1,
-            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
-        },
-        "logs" : [
-        ],
-        "out" : "0x",
-        "post" : {
-            "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000",
-                "code" : "0x60003560e060020a90048063820b13f614610021578063a444f5e91461003257005b61002c600435610043565b60006000f35b61003d60043561008f565b60006000f35b600060c66100cc60003960c6600054600160a060020a0316815260200182815260200160006000f0905080600160a060020a0316600060026000600060006000848787f1505050505050565b6000336000819055508160018190555060686101926000396068600054600160a060020a0316815260200182815260200160006000f09050505056006012604060c6600439600451602451601e565b60018060c56000396000f35b6000600182039150600082116031576057565b6068605d600039606883600160a060020a0316815260200182815260200160006000f090505b5050505600601260406068600439600451602451601e565b60018060676000396000f35b60018103905060008111602f576062565b81600160a060020a031663820b13f6600060008260e060020a026000526004858152602001600060008660155a03f15050505b505056000000601260406068600439600451602451601e565b60018060676000396000f35b60018103905060008111602f576062565b81600160a060020a031663820b13f6600060008260e060020a026000526004858152602001600060008660155a03f15050505b5050560000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "30000",
+                "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "500000",
+                "balance" : "469999",
                 "code" : "0x",
-                "nonce" : "0",
+                "nonce" : "1",
                 "storage" : {
                 }
             }
         },
-        "postStateRoot" : "ec9eadbedfa101ee02b24666825027434d3f8f1dc1c356270b60dbad8f342714",
+        "postStateRoot" : "7bb6e7db040ac9868d304b8cc779463440d125c732da7591a12758ba21535be3",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000",
@@ -336,11 +303,10 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "//" : "run(uint256)",
             "data" : "0xa444f5e900000000000000000000000000000000000000000000000000000000000204",
-            "gasLimit" : "10000",
+            "gasLimit" : "30000",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",
@@ -400,7 +366,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "//" : "runSolidityTests()",
             "data" : "0x0c4c9a80",

+ 13 - 8
tests/files/StateTests/stSpecialTest.json

@@ -30,7 +30,6 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
             "gasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639435",
@@ -55,19 +54,26 @@
         "out" : "0x",
         "post" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
-                "balance" : "1000000000000000000",
+                "balance" : "1000000000000000010",
                 "code" : "0x7b601080600c6000396000f200600035541560095700602035600035556000526000600060006000601773aaaaaaaaace5edbc8e2a8697c15331677e6ebf0b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecf1",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
-            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "1000",
+            "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" : {
+                "balance" : "22850",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
                 }
             },
+            "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
+                "balance" : "77140",
+                "code" : "0x",
+                "nonce" : "1",
+                "storage" : {
+                }
+            },
             "aaaaaaaaace5edbc8e2a8697c15331677e6ebf0b" : {
                 "balance" : "1000000000000000000",
                 "code" : "0x600160015532600255",
@@ -76,7 +82,7 @@
                 }
             }
         },
-        "postStateRoot" : "45a2a0c2ccdbef34e6b9c9514025624c7de68630fb4b654abcc0c25052fea8e0",
+        "postStateRoot" : "942d1aa0569204aa9cef7c5cc98d75c3a19c04575dfa6033170e578b383200b4",
         "pre" : {
             "095e7baea6a6c7c4c2dfeb977efac326af552d87" : {
                 "balance" : "1000000000000000000",
@@ -86,7 +92,7 @@
                 }
             },
             "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : {
-                "balance" : "1000",
+                "balance" : "100000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
@@ -100,10 +106,9 @@
                 }
             }
         },
-        "preStateRoot" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
         "transaction" : {
             "data" : "",
-            "gasLimit" : "850",
+            "gasLimit" : "22850",
             "gasPrice" : "1",
             "nonce" : "0",
             "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8",

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 334 - 101
tests/files/StateTests/stSystemOperationsTest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 427 - 104
tests/files/StateTests/stTransactionTest.json


+ 114 - 0
tests/files/TransactionTests/ttTransactionTest.json

@@ -72,9 +72,69 @@
     "TransactionWithGasLimitOverflow" : {
         "rlp" : "0xf87e807ba101000000000000000000000000000000000000000000000000000000000000000094095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
     },
+    "TransactionWithGasLimitxPriceOverflow" : {
+        "rlp" : "0xf8858088016345785d8a0000a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+        "sender" : "700764607c82cf3e9cf4ecbd49185f8914f1a361",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+            "gasPrice" : "100000000000000000",
+            "nonce" : "0",
+            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
+            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "v" : "27",
+            "value" : "0"
+        }
+    },
     "TransactionWithGasPriceOverflow" : {
         "rlp" : "0xf88080a101000000000000000000000000000000000000000000000000000000000000000082035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
     },
+    "TransactionWithHihghGas" : {
+        "rlp" : "0xf87d8001a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+        "sender" : "9e92c26895f279d68ad7b57b803dc522717d5572",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
+            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "v" : "27",
+            "value" : "0"
+        }
+    },
+    "TransactionWithHihghGasPrice" : {
+        "rlp" : "0xf87f80a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203e894095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+        "sender" : "16fd9197d7c7e37ac06ef78a2c2fcf5a70ae2db3",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "1000",
+            "gasPrice" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+            "nonce" : "0",
+            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
+            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "v" : "27",
+            "value" : "0"
+        }
+    },
+    "TransactionWithHihghNonce" : {
+        "rlp" : "0xf87fa0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0182035294095e7baea6a6c7c4c2dfeb977efac326af552d8780801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+        "sender" : "224fdba918cbedf058c4694f2e88a35fae134623",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "850",
+            "gasPrice" : "1",
+            "nonce" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
+            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "v" : "27",
+            "value" : "0"
+        }
+    },
     "TransactionWithHihghValue" : {
         "rlp" : "0xf87f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d87a0ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
         "sender" : "50702f47f1c4bfc6b75e65e2b995a8024fe25be9",
@@ -96,12 +156,66 @@
     "TransactionWithNonceOverflow" : {
         "rlp" : "0xf880a10100000000000000000000000000000000000000000000000000000000000000000182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
     },
+    "TransactionWithRvalueHigh" : {
+        "rlp" : "0xf85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba0fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140a08887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3"
+    },
     "TransactionWithRvalueOverflow" : {
+        "rlp" : "0xf861800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba2fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641410000a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
+    },
+    "TransactionWithRvalueTooHigh" : {
         "rlp" : "0xf85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba0fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
     },
+    "TransactionWithRvalueWrongSize" : {
+        "rlp" : "0xf850800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801b910ebaaedce6af48a03bbfd25e8cd0364141a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+        "sender" : "590233a2475e255fcdbc91d70da548315ca938a8",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "850",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "r" : "0xebaaedce6af48a03bbfd25e8cd0364141",
+            "s" : "0xefffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "v" : "27",
+            "value" : "11"
+        }
+    },
+    "TransactionWithSvalueHigh" : {
+        "rlp" : "0xf85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e",
+        "sender" : "53ea6a7f58d1b13a32147d908c2631611680e2ac",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "850",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "r" : "0x48b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353",
+            "s" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2e",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "v" : "27",
+            "value" : "11"
+        }
+    },
     "TransactionWithSvalueOverflow" : {
+        "rlp" : "0xf861800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a2fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f0000"
+    },
+    "TransactionWithSvalueTooHigh" : {
         "rlp" : "0xf85f800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"
     },
+    "TransactionWithSvalueWrongSize" : {
+        "rlp" : "0xf851800182035294095e7baea6a6c7c4c2dfeb977efac326af552d870b801ba098ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a920ef0b28ad43601b4ab949f53faa07bd2c804",
+        "sender" : "3a9f53e51de6314acdcfb604fcb2a11f10345d8e",
+        "transaction" : {
+            "data" : "",
+            "gasLimit" : "850",
+            "gasPrice" : "1",
+            "nonce" : "0",
+            "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a",
+            "s" : "0xef0b28ad43601b4ab949f53faa07bd2c804",
+            "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87",
+            "v" : "27",
+            "value" : "11"
+        }
+    },
     "TransactionWithTooFewRLPElements" : {
         "rlp" : "0xf85b800194095e7baea6a6c7c4c2dfeb977efac326af552d87801ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"
     },

+ 14 - 0
tests/files/TrieTests/hex_encoded_securetrie_test.json

@@ -26,5 +26,19 @@
         },
         "root": "0xa7c787bf470808896308c215e22c7a580a0087bb6db6e8695fb4759537283a83",
         "hexEncoded": true
+    },
+    "test3": {
+        "in": {
+                "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b": 
+                "0xf84c01880de0b6b3a7614bc3a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
+                "0x095e7baea6a6c7c4c2dfeb977efac326af552d87": 
+                "0xf84880840132b3a0a065fee2fffd7a68488cf7ef79f35f7979133172ac5727b5e0cf322953d13de492a06e5d8fec8b6b9bf41c3fb9b61696d5c87b66f6daa98d5f02ba9361b0c6916467",
+                "0x0000000000000000000000000000000000000001": 
+                "0xf8448080a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
+                "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba": 
+                "0xf8478083012d9da056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a0c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
+        },
+        "root": "0x40b37be88a49e2c08b8d33fcb03a0676ffd0481df54dfebd3512b8ec54f40cad", 
+        "hexEncoded": true
     }
 }

+ 46 - 0
tests/files/VMTests/RandomTests/randomTest.json

@@ -0,0 +1,46 @@
+{
+    "randomVMtest" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "300",
+            "currentTimestamp" : "2",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x41404043404340427b40620b775255",
+            "data" : "0x",
+            "gas" : "10000",
+            "gasPrice" : "100000000000000",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "1000000000000000000"
+        },
+        "gas" : "9909",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x41404043404340427b40620b775255",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "1000000000000000000",
+                "code" : "0x41404043404340427b40620b775255",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    }
+}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 465 - 57
tests/files/VMTests/vmArithmeticTest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 374 - 70
tests/files/VMTests/vmBitwiseLogicOperationTest.json


+ 129 - 32
tests/files/VMTests/vmBlockInfoTest.json

@@ -15,18 +15,18 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600040600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "4974",
+        "gas" : "94974",
         "logs" : [
         ],
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600040600055",
                 "nonce" : "0",
                 "storage" : {
@@ -35,7 +35,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600040600055",
                 "nonce" : "0",
                 "storage" : {
@@ -59,18 +59,18 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600140600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "4974",
+        "gas" : "94974",
         "logs" : [
         ],
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600140600055",
                 "nonce" : "0",
                 "storage" : {
@@ -79,7 +79,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600140600055",
                 "nonce" : "0",
                 "storage" : {
@@ -88,6 +88,8 @@
         }
     },
     "blockhashInRange" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -101,14 +103,30 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x60014060005560024060015561010040600255",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "39922",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x60014060005560024060015561010040600255",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6",
+                    "0x01" : "0xad7c5bef027816a800da1736444fb58a807ef4c9603b7848673f7e3a68eb14a5",
+                    "0x02" : "0x6ca54da2c4784ea43fd88b3402de07ae4bced597cbb19f323b7595857a6720ae"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x60014060005560024060015561010040600255",
                 "nonce" : "0",
                 "storage" : {
@@ -132,18 +150,18 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600140600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "4974",
+        "gas" : "94974",
         "logs" : [
         ],
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600140600055",
                 "nonce" : "0",
                 "storage" : {
@@ -152,7 +170,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600140600055",
                 "nonce" : "0",
                 "storage" : {
@@ -176,18 +194,18 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600240600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "4974",
+        "gas" : "94974",
         "logs" : [
         ],
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600240600055",
                 "nonce" : "0",
                 "storage" : {
@@ -196,7 +214,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600240600055",
                 "nonce" : "0",
                 "storage" : {
@@ -205,6 +223,8 @@
         }
     },
     "blockhashOutOfRange" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -218,14 +238,27 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600040600055610101406001557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40600255",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "84922",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x600040600055610101406001557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40600255",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600040600055610101406001557fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff40600255",
                 "nonce" : "0",
                 "storage" : {
@@ -234,6 +267,8 @@
         }
     },
     "coinbase" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -247,14 +282,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x41600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "79995",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x41600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x41600055",
                 "nonce" : "0",
                 "storage" : {
@@ -263,6 +312,8 @@
         }
     },
     "difficulty" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -276,14 +327,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x44600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "79995",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x44600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x0100"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x44600055",
                 "nonce" : "0",
                 "storage" : {
@@ -292,6 +357,8 @@
         }
     },
     "gaslimit" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -305,14 +372,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x45600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "79995",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x45600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x0f4240"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x45600055",
                 "nonce" : "0",
                 "storage" : {
@@ -336,18 +417,18 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x43600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "4995",
+        "gas" : "94995",
         "logs" : [
         ],
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x43600055",
                 "nonce" : "0",
                 "storage" : {
@@ -356,7 +437,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x43600055",
                 "nonce" : "0",
                 "storage" : {
@@ -365,6 +446,8 @@
         }
     },
     "timestamp" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -378,14 +461,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x42600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "79995",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x42600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x01"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x42600055",
                 "nonce" : "0",
                 "storage" : {

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 344 - 80
tests/files/VMTests/vmEnvironmentalInfoTest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 278 - 86
tests/files/VMTests/vmIOandFlowOperationsTest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 122 - 122
tests/files/VMTests/vmLogTest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 220 - 0
tests/files/VMTests/vmPerformanceTest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 455 - 55
tests/files/VMTests/vmPushDupSwapTest.json


+ 406 - 14
tests/files/VMTests/vmSha3Test.json

@@ -26,7 +26,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6000600020600055",
                 "nonce" : "0",
                 "storage" : {
@@ -36,7 +36,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6000600020600055",
                 "nonce" : "0",
                 "storage" : {
@@ -45,6 +45,8 @@
         }
     },
     "sha3_1" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -58,14 +60,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x6005600420600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "79952",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x6005600420600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xc41589e7559804ea4a2080dad19d876a024ccb05117835447d72ce08c1d020ec"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6005600420600055",
                 "nonce" : "0",
                 "storage" : {
@@ -74,6 +90,8 @@
         }
     },
     "sha3_2" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -87,14 +105,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600a600a20600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "79952",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x600a600a20600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x6bd2dd6bd408cbee33429358bf24fdc64612fbf8b1b4db604518f40ffd34b607"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600a600a20600055",
                 "nonce" : "0",
                 "storage" : {
@@ -116,14 +148,14 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x620fffff6103e820600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x620fffff6103e820600055",
                 "nonce" : "0",
                 "storage" : {
@@ -145,14 +177,14 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x6064640fffffffff20600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6064640fffffffff20600055",
                 "nonce" : "0",
                 "storage" : {
@@ -174,14 +206,14 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x640fffffffff61271020600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x640fffffffff61271020600055",
                 "nonce" : "0",
                 "storage" : {
@@ -203,14 +235,14 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff20600055",
                 "nonce" : "0",
                 "storage" : {
@@ -320,5 +352,365 @@
                 }
             }
         }
+    },
+    "sha3_memSizeNoQuadraticCost31" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x60016103c020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947157",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016103c020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016103c020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "sha3_memSizeQuadraticCost32" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x60016103e020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947153",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016103e020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016103e020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "sha3_memSizeQuadraticCost32_zeroSize" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x600061040020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947257",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x600061040020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x600061040020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "sha3_memSizeQuadraticCost33" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x600161040020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947150",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x600161040020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x600161040020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "sha3_memSizeQuadraticCost63" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x60016107c020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947055",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016107c020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016107c020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "sha3_memSizeQuadraticCost64" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x60016107e020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947051",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016107e020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60016107e020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "sha3_memSizeQuadraticCost64_2" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x60206107e020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947051",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60206107e020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e563"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x60206107e020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
+    },
+    "sha3_memSizeQuadraticCost65" : {
+        "callcreates" : [
+        ],
+        "env" : {
+            "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
+            "currentDifficulty" : "256",
+            "currentGasLimit" : "1000000",
+            "currentNumber" : "0",
+            "currentTimestamp" : "1",
+            "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6"
+        },
+        "exec" : {
+            "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6",
+            "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "code" : "0x600161080020600055",
+            "data" : "0x",
+            "gas" : "4294967296",
+            "gasPrice" : "1",
+            "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
+            "value" : "115792089237316195423570985008687907853269984665640564039457584007913129639935"
+        },
+        "gas" : "4294947048",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x600161080020600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0xbc36789e7a1e281436464229828f817d6612f7b477d66591ff96a9e064bcc98a"
+                }
+            }
+        },
+        "pre" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
+                "code" : "0x600161080020600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        }
     }
 }

+ 121 - 46
tests/files/VMTests/vmSystemOperationsTest.json

@@ -32,7 +32,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "999999999999999976",
+                "balance" : "99999999999999999999976",
                 "code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e8f15855",
                 "nonce" : "0",
                 "storage" : {
@@ -49,7 +49,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e8f15855",
                 "nonce" : "0",
                 "storage" : {
@@ -85,7 +85,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e85a03f15855",
                 "nonce" : "0",
                 "storage" : {
@@ -121,7 +121,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6001600054016000556000600060006000600173945304eb96065b2a98b57a48a06ae28d285a71b56103e85a03f1",
                 "nonce" : "0",
                 "storage" : {
@@ -205,7 +205,7 @@
         "out" : "0x",
         "post" : {
             "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
-                "balance" : "999999999999999999",
+                "balance" : "99999999999999999999999",
                 "code" : "0x60006000600060006017730f572e5295c57f15886f9b263e2f6d2d6c7b5ec66101f4f16001015855",
                 "nonce" : "0",
                 "storage" : {
@@ -214,7 +214,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e8f1585573945304eb96065b2a98b57a48a06ae28d285a71b5ff",
                 "nonce" : "0",
                 "storage" : {
@@ -262,7 +262,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "999999999999999976",
+                "balance" : "99999999999999999999976",
                 "code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e8f15855",
                 "nonce" : "0",
                 "storage" : {
@@ -279,7 +279,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6000600060006000601873945304eb96065b2a98b57a48a06ae28d285a71b56103e8f15855",
                 "nonce" : "0",
                 "storage" : {
@@ -334,7 +334,7 @@
                 }
             },
             "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600160005401600055600060006000600060003060e05a03f1600155",
                 "nonce" : "0",
                 "storage" : {
@@ -350,7 +350,7 @@
                 }
             },
             "945304eb96065b2a98b57a48a06ae28d285a71b5" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600160005401600055600060006000600060003060e05a03f1600155",
                 "nonce" : "0",
                 "storage" : {
@@ -547,7 +547,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "999999999999999977",
+                "balance" : "99999999999999999999977",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -564,7 +564,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -600,7 +600,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000620f120660406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -636,7 +636,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa602052600060406000620f1206601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -672,7 +672,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56064f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -708,7 +708,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa602052600060406040633ade68b1601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -744,7 +744,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa60205260006040629688d86000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -780,7 +780,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7feeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526001620f120660406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -796,6 +796,14 @@
         }
     },
     "CallToPrecompiledContract" : {
+        "callcreates" : [
+            {
+                "data" : "0x0000",
+                "destination" : "0000000000000000000000000000000000000002",
+                "gasLimit" : "0",
+                "value" : "0"
+            }
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "115792089237316195423570985008687907853269984665640564039457584007913129639935",
@@ -809,14 +817,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x4243434242434243f14555",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "54939",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x4243434242434243f14555",
+                "nonce" : "0",
+                "storage" : {
+                    "0x0f4240" : "0x01"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x4243434242434243f14555",
                 "nonce" : "0",
                 "storage" : {
@@ -857,7 +879,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "999999999999999977",
+                "balance" : "99999999999999999999977",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -874,7 +896,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f1600055",
                 "nonce" : "0",
                 "storage" : {
@@ -916,7 +938,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080",
                 "nonce" : "0",
                 "storage" : {
@@ -932,7 +954,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080",
                 "nonce" : "0",
                 "storage" : {
@@ -974,7 +996,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080",
                 "nonce" : "0",
                 "storage" : {
@@ -990,7 +1012,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080",
                 "nonce" : "0",
                 "storage" : {
@@ -1006,6 +1028,8 @@
         }
     },
     "TestNameRegistrator" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -1019,14 +1043,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x6000355415600957005b60203560003555",
             "data" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffafffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "79915",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100000000000000000000000",
+                "code" : "0x6000355415600957005b60203560003555",
+                "nonce" : "0",
+                "storage" : {
+                    "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa" : "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x6000355415600957005b60203560003555",
                 "nonce" : "0",
                 "storage" : {
@@ -1067,7 +1105,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "999999999999999977",
+                "balance" : "99999999999999999999977",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f2600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1084,7 +1122,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526000604060406000601773945304eb96065b2a98b57a48a06ae28d285a71b5620f4240f2600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1132,7 +1170,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "999999999999999977",
+                "balance" : "99999999999999999999977",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f2600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1149,7 +1187,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526002600060406000601773945304eb96065b2a98b57a48a06ae28d285a71b56101f4f2600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1191,7 +1229,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1208,7 +1246,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1250,7 +1288,7 @@
         "out" : "0x",
         "post" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1267,7 +1305,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6000527faaffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffaa6020526080600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1283,6 +1321,14 @@
         }
     },
     "createNameRegistrator" : {
+        "callcreates" : [
+            {
+                "data" : "0x601080600c6000396000f3006000355415600957005b60203560003555",
+                "destination" : "",
+                "gasLimit" : "67979",
+                "value" : "23"
+            }
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -1296,14 +1342,28 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d60036017f0600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
+        "gas" : "47976",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "99999999999999999999977",
+                "code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d60036017f0600055",
+                "nonce" : "0",
+                "storage" : {
+                    "0x" : "0x945304eb96065b2a98b57a48a06ae28d285a71b5"
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d60036017f0600055",
                 "nonce" : "0",
                 "storage" : {
@@ -1325,7 +1385,7 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d650fffffffffff6017f0600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "100"
@@ -1354,7 +1414,7 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x7c601080600c6000396000f3006000355415600957005b6020356000355560005263ffffffff60036017f0600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "100"
@@ -1370,6 +1430,8 @@
         }
     },
     "createNameRegistratorValueTooHigh" : {
+        "callcreates" : [
+        ],
         "env" : {
             "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
             "currentDifficulty" : "256",
@@ -1383,11 +1445,24 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d600360e6f0600055",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "100"
         },
+        "gas" : "62976",
+        "logs" : [
+        ],
+        "out" : "0x",
+        "post" : {
+            "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
+                "balance" : "100",
+                "code" : "0x7c601080600c6000396000f3006000355415600957005b60203560003555600052601d600360e6f0600055",
+                "nonce" : "0",
+                "storage" : {
+                }
+            }
+        },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
                 "balance" : "100",
@@ -1557,7 +1632,7 @@
         "out" : "0x",
         "post" : {
             "cd1722f3947def4cf144679da39c4c32bdc35681" : {
-                "balance" : "1000000000000000023",
+                "balance" : "100000000000000000000023",
                 "code" : "0x6000355415600957005b60203560003555",
                 "nonce" : "0",
                 "storage" : {
@@ -1566,7 +1641,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x33ff",
                 "nonce" : "0",
                 "storage" : {
@@ -1608,7 +1683,7 @@
         "out" : "0x",
         "post" : {
             "aa1722f3947def4cf144679da39c4c32bdc35681" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
@@ -1624,7 +1699,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x73aa1722f3947def4cf144679da39c4c32bdc35681ff",
                 "nonce" : "0",
                 "storage" : {
@@ -1675,7 +1750,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x30ff",
                 "nonce" : "0",
                 "storage" : {

+ 10 - 10
tests/files/VMTests/vmtests.json

@@ -13,14 +13,14 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600060006000600060026002600803036002600306600260020460046004600402026002600201010101013360c85a03f1",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600060006000600060026002600803036002600306600260020460046004600402026002600201010101013360c85a03f1",
                 "nonce" : "0",
                 "storage" : {
@@ -42,14 +42,14 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x600160011615601a57600060006000600060023360c85a03f1505b600060011615603557600060006000600060033360c85a03f1505b600160001615605057600060006000600060043360c85a03f1505b600060001615606b57600060006000600060053360c85a03f1505b6001600117156086576000600060006000600c3360c85a03f1505b60006001171560a1576000600060006000600d3360c85a03f1505b60016000171560bc576000600060006000600e3360c85a03f1505b60006000171560d7576000600060006000600f3360c85a03f1505b",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x600160011615601a57600060006000600060023360c85a03f1505b600060011615603557600060006000600060033360c85a03f1505b600160001615605057600060006000600060043360c85a03f1505b600060001615606b57600060006000600060053360c85a03f1505b6001600117156086576000600060006000600c3360c85a03f1505b60006001171560a1576000600060006000600d3360c85a03f1505b60016000171560bc576000600060006000600e3360c85a03f1505b60006000171560d7576000600060006000600f3360c85a03f1505b",
                 "nonce" : "0",
                 "storage" : {
@@ -71,14 +71,14 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x60006000600060006706f05b59d3b200003360c85a03f1",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x60006000600060006706f05b59d3b200003360c85a03f1",
                 "nonce" : "0",
                 "storage" : {
@@ -102,18 +102,18 @@
             "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "code" : "0x33ff",
             "data" : "0x",
-            "gas" : "10000",
+            "gas" : "100000",
             "gasPrice" : "100000000000000",
             "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681",
             "value" : "1000000000000000000"
         },
-        "gas" : "9998",
+        "gas" : "99998",
         "logs" : [
         ],
         "out" : "0x",
         "post" : {
             "cd1722f3947def4cf144679da39c4c32bdc35681" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x",
                 "nonce" : "0",
                 "storage" : {
@@ -122,7 +122,7 @@
         },
         "pre" : {
             "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : {
-                "balance" : "1000000000000000000",
+                "balance" : "100000000000000000000000",
                 "code" : "0x33ff",
                 "nonce" : "0",
                 "storage" : {

+ 8 - 4
tests/vm/gh_test.go

@@ -75,14 +75,18 @@ type VmTest struct {
 }
 
 func RunVmTest(p string, t *testing.T) {
+
 	tests := make(map[string]VmTest)
 	helper.CreateFileTests(t, p, &tests)
 
 	for name, test := range tests {
-		helper.Logger.SetLogLevel(4)
-		if name != "CallEcrecover0_overlappingInputOutput" {
-			continue
-		}
+		/*
+			vm.Debug = true
+			helper.Logger.SetLogLevel(4)
+			if name != "refund_CallToSuicideTwice" {
+				continue
+			}
+		*/
 		db, _ := ethdb.NewMemDatabase()
 		statedb := state.New(nil, db)
 		for addr, account := range test.Pre {

+ 4 - 14
ui/frontend.go

@@ -1,18 +1,8 @@
 package ui
 
-// ReturnInterface is returned by the Intercom interface when a method is called
-type ReturnInterface interface {
-	Get(i int) (interface{}, error)
-	Size() int
-}
+import "github.com/ethereum/go-ethereum/core/types"
 
-// Frontend is the basic interface for calling arbitrary methods on something that
-// implements a front end (GUI, CLI, etc)
-type Frontend interface {
-	// Checks whether a specific method is implemented
-	Supports(method string) bool
-	// Call calls the given method on interface it implements. This will return
-	// an error with errNotImplemented if the method hasn't been implemented
-	// and will return a ReturnInterface if it does.
-	Call(method string) (ReturnInterface, error)
+type Interface interface {
+	UnlockAccount(address []byte) bool
+	ConfirmTransaction(tx *types.Transaction) bool
 }

+ 3 - 0
vm/common.go

@@ -9,6 +9,9 @@ import (
 
 var vmlogger = logger.NewLogger("VM")
 
+// Global Debug flag indicating Debug VM (full logging)
+var Debug bool
+
 type Type byte
 
 const (

+ 13 - 3
vm/vm.go

@@ -30,8 +30,8 @@ type Vm struct {
 
 func New(env Environment) *Vm {
 	lt := LogTyPretty
-	// lt = LogTyDiff
-	return &Vm{debug: true, env: env, logTy: lt, Recoverable: true}
+
+	return &Vm{debug: Debug, env: env, logTy: lt, Recoverable: true}
 }
 
 func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, callData []byte) (ret []byte, err error) {
@@ -405,7 +405,12 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
 		case BALANCE:
 
 			addr := stack.Pop().Bytes()
-			balance := statedb.GetBalance(addr)
+			var balance *big.Int
+			if statedb.GetStateObject(addr) != nil {
+				balance = statedb.GetBalance(addr)
+			} else {
+				balance = base
+			}
 
 			stack.Push(balance)
 
@@ -731,6 +736,7 @@ func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.I
 			self.Printf(" => (%x) %v", receiver.Address()[:4], balance)
 
 			receiver.AddBalance(balance)
+
 			statedb.Delete(context.Address())
 
 			fallthrough
@@ -900,6 +906,10 @@ func (self *Vm) calculateGasAndSize(context *Context, caller ContextRef, op OpCo
 			g = GasStorageMod
 		}
 		gas.Set(g)
+	case SUICIDE:
+		if !statedb.IsDeleted(context.Address()) {
+			statedb.Refund(self.env.Origin(), RefundSuicide)
+		}
 	case MLOAD:
 		newMemSize = calcMemSize(stack.Peek(), u256(32))
 	case MSTORE8:

+ 1 - 1
xeth/state.go

@@ -26,7 +26,7 @@ func (self *State) SafeGet(addr string) *Object {
 func (self *State) safeGet(addr string) *state.StateObject {
 	object := self.state.GetStateObject(fromHex(addr))
 	if object == nil {
-		object = state.NewStateObject(fromHex(addr), self.xeth.eth.Db())
+		object = state.NewStateObject(fromHex(addr), self.xeth.eth.StateDb())
 	}
 
 	return object

+ 16 - 2
xeth/xeth.go

@@ -19,6 +19,7 @@ import (
 	"github.com/ethereum/go-ethereum/miner"
 	"github.com/ethereum/go-ethereum/p2p"
 	"github.com/ethereum/go-ethereum/state"
+	"github.com/ethereum/go-ethereum/ui"
 	"github.com/ethereum/go-ethereum/whisper"
 )
 
@@ -33,7 +34,8 @@ type Backend interface {
 	PeerCount() int
 	IsListening() bool
 	Peers() []*p2p.Peer
-	Db() ethutil.Database
+	BlockDb() ethutil.Database
+	StateDb() ethutil.Database
 	EventMux() *event.TypeMux
 	Whisper() *whisper.Whisper
 	Miner() *miner.Miner
@@ -47,9 +49,16 @@ type XEth struct {
 	state          *State
 	whisper        *Whisper
 	miner          *miner.Miner
+
+	frontend ui.Interface
 }
 
-func New(eth Backend) *XEth {
+type TmpFrontend struct{}
+
+func (TmpFrontend) UnlockAccount([]byte) bool                  { panic("UNLOCK ACCOUNT") }
+func (TmpFrontend) ConfirmTransaction(*types.Transaction) bool { panic("CONFIRM TRANSACTION") }
+
+func New(eth Backend, frontend ui.Interface) *XEth {
 	xeth := &XEth{
 		eth:            eth,
 		blockProcessor: eth.BlockProcessor(),
@@ -58,6 +67,11 @@ func New(eth Backend) *XEth {
 		whisper:        NewWhisper(eth.Whisper()),
 		miner:          eth.Miner(),
 	}
+
+	if frontend == nil {
+		xeth.frontend = TmpFrontend{}
+	}
+
 	xeth.state = NewState(xeth, xeth.chainManager.TransState())
 
 	return xeth

Vissa filer visades inte eftersom för många filer har ändrats