fixes failed tx test

This commit is contained in:
andri lim 2020-02-11 10:34:50 +07:00 committed by zah
parent deb09f40f0
commit ad1b27d2a4
2 changed files with 6 additions and 16 deletions

View File

@ -155,11 +155,3 @@ func skipNewBCTests*(folder: string, name: string): bool =
] ]
result = name in allowedFailingBCTests result = name in allowedFailingBCTests
func skipTxTests*(folder: string, name: string): bool =
# from test_transaction_json
when sizeof(int) == 4:
# see nim-eth#95
result = name == "RLPHeaderSizeOverflowInt32.json"
else:
false

View File

@ -11,7 +11,7 @@ proc testFixture(node: JsonNode, testStatusIMPL: var TestStatus)
proc transactionJsonMain*() = proc transactionJsonMain*() =
suite "Transactions tests": suite "Transactions tests":
jsonTest("TransactionTests", testFixture, skipTxTests) jsonTest("TransactionTests", testFixture)
when isMainModule: when isMainModule:
transactionJsonMain() transactionJsonMain()
@ -38,6 +38,10 @@ func noHash(fixture: JsonNode): bool =
if forkData.len == 0: return if forkData.len == 0: return
if "hash" in forkData: return false if "hash" in forkData: return false
# nimbus rlp cannot allow type mismatch
# e.g. uint256 value put into int64
# so we skip noHash check. this behavior
# is different compared to py-evm
const SKIP_TITLES = [ const SKIP_TITLES = [
"TransactionWithGasLimitxPriceOverflow", "TransactionWithGasLimitxPriceOverflow",
"TransactionWithHighNonce256", "TransactionWithHighNonce256",
@ -63,13 +67,7 @@ proc testFixture(node: JsonNode, testStatusIMPL: var TestStatus) =
try: try:
tx = rlp.decode(rlpData, Transaction) tx = rlp.decode(rlpData, Transaction)
except RlpTypeMismatch, MalformedRlpError: except RlpTypeMismatch, MalformedRlpError, UnsupportedRlpError:
# TODO:
# nimbus rlp cannot allow type mismatch
# e.g. uint256 value put into int64
# so we skip noHash check
# this behavior different compared to
# py-evm, not sure what should we do
if title in SKIP_TITLES: if title in SKIP_TITLES:
return return
check noHash(fixture) check noHash(fixture)