From 17c95f3f827fe110db88c096a08cf16d88c75b4e Mon Sep 17 00:00:00 2001 From: andri lim Date: Wed, 20 Mar 2019 12:22:55 +0700 Subject: [PATCH] fix test_vm_json --- tests/test_vm_json.nim | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/test_vm_json.nim b/tests/test_vm_json.nim index 3046b409d..eaa0c0cb6 100644 --- a/tests/test_vm_json.nim +++ b/tests/test_vm_json.nim @@ -7,13 +7,9 @@ import unittest, strformat, strutils, sequtils, tables, json, ospaths, times, - byteutils, ranges/typedranges, - eth/[rlp, common], eth/trie/db, - ./test_helpers, - ../nimbus/[constants, errors], - ../nimbus/[vm_state, vm_types], - ../nimbus/utils, - ../nimbus/vm/interpreter, + byteutils, ranges/typedranges, eth/[rlp, common], eth/trie/db, + ./test_helpers, ../nimbus/vm/interpreter, + ../nimbus/[constants, errors, vm_state, vm_types, utils], ../nimbus/db/[db_chain, state_db] proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus) @@ -60,7 +56,10 @@ proc testFixture(fixtures: JsonNode, testStatusIMPL: var TestStatus) = createAddress = toAddress)) var computation = newBaseComputation(vmState, header.blockNumber, message) - computation.executeOpcodes() + try: + computation.executeOpcodes() + except VMError: + computation.error = Error(info: getCurrentExceptionMsg()) if not fixture{"post"}.isNil: # Success checks