diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-31 00:10:02 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-31 00:10:02 +0800 |
commit | a9068aa8ff1b3ee1a665f3759f4b3a94ac702884 (patch) | |
tree | 034cc7b5e49b8b5bb15e94d01425c0512a55aaba | |
parent | 51a97c031fdb609c869f64271e1c52966974a2ee (diff) | |
parent | 89244981a8a9f190a6afc74ec2c584692f04dcdd (diff) | |
download | dexon-a9068aa8ff1b3ee1a665f3759f4b3a94ac702884.tar dexon-a9068aa8ff1b3ee1a665f3759f4b3a94ac702884.tar.gz dexon-a9068aa8ff1b3ee1a665f3759f4b3a94ac702884.tar.bz2 dexon-a9068aa8ff1b3ee1a665f3759f4b3a94ac702884.tar.lz dexon-a9068aa8ff1b3ee1a665f3759f4b3a94ac702884.tar.xz dexon-a9068aa8ff1b3ee1a665f3759f4b3a94ac702884.tar.zst dexon-a9068aa8ff1b3ee1a665f3759f4b3a94ac702884.zip |
Merge branch 'develop' into poc8
-rw-r--r-- | cmd/ethtest/main.go | 11 | ||||
-rw-r--r-- | tests/files/VMTests/RandomTests/randomTest.json | 46 | ||||
-rw-r--r-- | vm/vm_debug.go | 2 |
3 files changed, 9 insertions, 50 deletions
diff --git a/cmd/ethtest/main.go b/cmd/ethtest/main.go index 94ab779db..96ef94e40 100644 --- a/cmd/ethtest/main.go +++ b/cmd/ethtest/main.go @@ -95,10 +95,15 @@ func RunVmTest(js string) (failed int) { failed = 1 } - gexp := ethutil.Big(test.Gas) - if gexp.Cmp(gas) != 0 { - log.Printf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas) + if len(test.Gas) == 0 && err == nil { + log.Printf("0 gas indicates error but no error given by VM") failed = 1 + } else { + gexp := ethutil.Big(test.Gas) + if gexp.Cmp(gas) != 0 { + log.Printf("%s's gas failed. Expected %v, got %v\n", name, gexp, gas) + failed = 1 + } } for addr, account := range test.Post { diff --git a/tests/files/VMTests/RandomTests/randomTest.json b/tests/files/VMTests/RandomTests/randomTest.json deleted file mode 100644 index dad2ee4a2..000000000 --- a/tests/files/VMTests/RandomTests/randomTest.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "randomVMtest" : { - "callcreates" : [ - ], - "env" : { - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", - "currentDifficulty" : "256", - "currentGasLimit" : "1000000", - "currentNumber" : "0", - "currentTimestamp" : "1", - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" - }, - "exec" : { - "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", - "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "code" : "0x675545", - "data" : "0x", - "gas" : "10000", - "gasPrice" : "100000000000000", - "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", - "value" : "1000000000000000000" - }, - "gas" : "9999", - "logs" : [ - ], - "out" : "0x", - "post" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : "1000000000000000000", - "code" : "0x675545", - "nonce" : "0", - "storage" : { - } - } - }, - "pre" : { - "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { - "balance" : "1000000000000000000", - "code" : "0x675545", - "nonce" : "0", - "storage" : { - } - } - } - } -}
\ No newline at end of file diff --git a/vm/vm_debug.go b/vm/vm_debug.go index 9a538c940..933fb7b12 100644 --- a/vm/vm_debug.go +++ b/vm/vm_debug.go @@ -140,7 +140,7 @@ func (self *DebugVm) Run(me, caller ClosureRef, code []byte, value, gas, price * // Stack checks only case ISZERO, CALLDATALOAD, POP, JUMP, NOT: // 1 require(1) - case ADD, SUB, DIV, SDIV, MOD, SMOD, LT, GT, SLT, SGT, EQ, AND, OR, XOR, BYTE: // 2 + case ADD, SUB, DIV, SDIV, MOD, SMOD, LT, GT, SLT, SGT, EQ, AND, OR, XOR, BYTE, SIGNEXTEND: // 2 require(2) case ADDMOD, MULMOD: // 3 require(3) |