some simplification and cleanup
This commit is contained in:
parent
4f04332205
commit
7aa0c386dd
|
@ -320,7 +320,7 @@ OK: 0/58 Fail: 15/58 Skip: 43/58
|
|||
OK: 0/58 Fail: 58/58 Skip: 0/58
|
||||
## stChangedEIP150
|
||||
```diff
|
||||
Call1024BalanceTooLow.json Skip
|
||||
- Call1024BalanceTooLow.json Fail
|
||||
- Call1024PreCalls.json Fail
|
||||
- Callcode1024BalanceTooLow.json Fail
|
||||
+ callcall_00_OOGE_1.json OK
|
||||
|
@ -351,12 +351,12 @@ OK: 0/58 Fail: 58/58 Skip: 0/58
|
|||
+ contractCreationMakeCallThatAskMoreGasThenTransactionProvided.jsonOK
|
||||
- createInitFail_OOGduringInit.json Fail
|
||||
```
|
||||
OK: 4/30 Fail: 24/30 Skip: 2/30
|
||||
OK: 4/30 Fail: 25/30 Skip: 1/30
|
||||
## stCodeCopyTest
|
||||
```diff
|
||||
ExtCodeCopyTests.json Skip
|
||||
- ExtCodeCopyTests.json Fail
|
||||
```
|
||||
OK: 0/1 Fail: 0/1 Skip: 1/1
|
||||
OK: 0/1 Fail: 1/1 Skip: 0/1
|
||||
## stCodeSizeLimit
|
||||
```diff
|
||||
- codesizeInit.json Fail
|
||||
|
@ -400,7 +400,7 @@ OK: 2/3 Fail: 1/3 Skip: 0/3
|
|||
OK: 0/30 Fail: 22/30 Skip: 8/30
|
||||
## stDelegatecallTestHomestead
|
||||
```diff
|
||||
Call1024BalanceTooLow.json Skip
|
||||
- Call1024BalanceTooLow.json Fail
|
||||
- Call1024OOG.json Fail
|
||||
- Call1024PreCalls.json Fail
|
||||
- CallLoseGasOOG.json Fail
|
||||
|
@ -435,7 +435,7 @@ OK: 0/30 Fail: 22/30 Skip: 8/30
|
|||
- delegatecodeDynamicCode.json Fail
|
||||
- delegatecodeDynamicCode2SelfCall.json Fail
|
||||
```
|
||||
OK: 3/34 Fail: 30/34 Skip: 1/34
|
||||
OK: 3/34 Fail: 31/34 Skip: 0/34
|
||||
## stEIP150Specific
|
||||
```diff
|
||||
CallAndCallcodeConsumeMoreGasThenTransactionHas.json Skip
|
||||
|
|
|
@ -49,12 +49,12 @@ proc setupComputation*(header: BlockHeader, vmState: var BaseVMState, transactio
|
|||
result.precompiles = initTable[string, Opcode]()
|
||||
doAssert result.isOriginComputation
|
||||
|
||||
proc execComputation*(computation: var BaseComputation, vmState: BaseVMState): bool =
|
||||
proc execComputation*(computation: var BaseComputation): bool =
|
||||
try:
|
||||
computation.executeOpcodes()
|
||||
#[vmState.mutateStateDB:
|
||||
computation.vmState.mutateStateDB:
|
||||
for deletedAccount in computation.getAccountsForDeletion:
|
||||
db.deleteAccount deletedAccount]#
|
||||
db.deleteAccount deletedAccount
|
||||
|
||||
result = not computation.isError
|
||||
except ValueError:
|
||||
|
@ -74,7 +74,7 @@ proc applyCreateTransaction*(db: var AccountStateDB, t: Transaction, head: Block
|
|||
createAddress = contractAddress))
|
||||
var c = newBaseComputation(vmState, head.blockNumber, msg)
|
||||
|
||||
if execComputation(c, vmState):
|
||||
if execComputation(c):
|
||||
db.addBalance(contractAddress, t.value)
|
||||
|
||||
# XXX: copy/pasted from GST fixture
|
||||
|
|
|
@ -526,5 +526,7 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool =
|
|||
"pointAdd.json",
|
||||
"pointAddTrunc.json",
|
||||
"pointMulAdd.json",
|
||||
"pointMulAdd2.json"]
|
||||
"pointMulAdd2.json",
|
||||
"Call1024BalanceTooLow.json",
|
||||
"ExtCodeCopyTests.json"]
|
||||
name in allowedFailingGeneralStateTests
|
||||
|
|
|
@ -66,7 +66,7 @@ proc testFixtureIndexes(header: BlockHeader, pre: JsonNode, transaction: Transac
|
|||
db.addBalance(transaction.to, transaction.value)
|
||||
|
||||
# What remains is call and/or value transfer
|
||||
if execComputation(computation, vmState):
|
||||
if execComputation(computation):
|
||||
let
|
||||
gasRemaining = computation.gasMeter.gasRemaining.u256
|
||||
gasRefunded = computation.gasMeter.gasRefunded.u256
|
||||
|
@ -75,8 +75,6 @@ proc testFixtureIndexes(header: BlockHeader, pre: JsonNode, transaction: Transac
|
|||
gasRefundAmount = (gasRefund + gasRemaining) * transaction.gasPrice.u256
|
||||
|
||||
vmState.mutateStateDB:
|
||||
for deletedAccount in computation.getAccountsForDeletion:
|
||||
db.deleteAccount deletedAccount
|
||||
# TODO if the balance/etc calls were gated on gAFD or similar,
|
||||
# that would simplify/combine codepaths
|
||||
if header.coinbase notin computation.getAccountsForDeletion:
|
||||
|
|
|
@ -86,10 +86,7 @@ func failIn32Bits(folder, name: string): bool =
|
|||
func validTest*(folder: string, name: string): bool =
|
||||
# tests we want to skip or which segfault will be skipped here
|
||||
result = (folder != "vmPerformance" or "loop" notin name) and
|
||||
(not slowTest(folder, name) and
|
||||
# TODO: check whether these are still useful
|
||||
name notin @["static_Call1024BalanceTooLow.json",
|
||||
"Call1024BalanceTooLow.json", "ExtCodeCopyTests.json"])
|
||||
not slowTest(folder, name)
|
||||
|
||||
proc lacksHomesteadPostStates*(filename: string): bool =
|
||||
# XXX: Until Nimbus supports Byzantine or newer forks, as opposed
|
||||
|
@ -198,8 +195,6 @@ proc verifyStateDB*(wantedState: JsonNode, stateDB: AccountStateDB) =
|
|||
wantedValue = UInt256.fromHex value.getStr
|
||||
|
||||
let (actualValue, found) = stateDB.getStorage(account, slotId)
|
||||
# echo "FOUND ", found
|
||||
# echo "ACTUAL VALUE ", actualValue.toHex
|
||||
doAssert found
|
||||
doAssert actualValue == wantedValue, &"{actualValue.toHex} != {wantedValue.toHex}"
|
||||
|
||||
|
@ -228,7 +223,7 @@ proc getFixtureTransaction*(j: JsonNode, dataIndex, gasIndex, valueIndex: int):
|
|||
result.gasLimit = j["gasLimit"][gasIndex].getStr.parseHexInt
|
||||
|
||||
# TODO: there are a couple fixtures which appear to distinguish between
|
||||
# empty and 0 transaction.to.
|
||||
# empty and 0 transaction.to; check/verify whether correct conditions.
|
||||
let rawTo = j["to"].getStr
|
||||
if rawTo == "":
|
||||
result.to = "0x".parseAddress
|
||||
|
|
Loading…
Reference in New Issue