fix wrong gasUsed

This commit is contained in:
andri lim 2019-09-09 13:24:42 +07:00 committed by zah
parent 85b21721b0
commit b5266a7412
3 changed files with 6 additions and 4 deletions

View File

@ -91,7 +91,7 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
+ wrongCoinbase.json OK
wrongDifficulty.json Skip
+ wrongGasLimit.json OK
wrongGasUsed.json Skip
+ wrongGasUsed.json OK
wrongMixHash.json Skip
wrongNonce.json Skip
+ wrongNumber.json OK
@ -103,7 +103,7 @@ OK: 1/1 Fail: 0/1 Skip: 0/1
+ wrongTransactionsTrie.json OK
+ wrongUncleHash.json OK
```
OK: 18/23 Fail: 0/23 Skip: 5/23
OK: 19/23 Fail: 0/23 Skip: 4/23
## bcMultiChainTest
```diff
+ CallContractFromNotBestBlock.json OK
@ -404,4 +404,4 @@ OK: 20/20 Fail: 0/20 Skip: 0/20
OK: 5/5 Fail: 0/5 Skip: 0/5
---TOTAL---
OK: 260/318 Fail: 0/318 Skip: 58/318
OK: 261/318 Fail: 0/318 Skip: 57/318

View File

@ -259,6 +259,9 @@ proc processBlock(vmState: BaseVMState, minedBlock: PlainBlock, fork: Fork) =
raise newException(ValidationError, "could not get sender")
vmState.receipts[txIndex] = makeReceipt(vmState, fork)
if vmState.cumulativeGasUsed != minedBlock.header.gasUsed:
raise newException(ValidationError, "wrong gas used in header")
assignBlockRewards(minedBlock, vmState, fork, vmState.chainDB)
func validateBlockUnchanged(a, b: PlainBlock): bool =

View File

@ -82,7 +82,6 @@ func allowedFailingGeneralStateTest*(folder, name: string): bool =
# bcInvalidHeaderTest
"DifficultyIsZero.json",
"wrongDifficulty.json",
"wrongGasUsed.json",
"wrongMixHash.json",
"wrongNonce.json",