diff --git a/nimbus/evm/async/data_sources/json_rpc_data_source.nim b/nimbus/evm/async/data_sources/json_rpc_data_source.nim index 13612d58a..b01f8413c 100644 --- a/nimbus/evm/async/data_sources/json_rpc_data_source.nim +++ b/nimbus/evm/async/data_sources/json_rpc_data_source.nim @@ -28,8 +28,6 @@ from web3/ethtypes import Quantity #from ../../../premix/downloader import request #from ../../../premix/parser import prefixHex, parseBlockHeader, parseReceipt, parseTransaction -from eth/common import BlockHeader - # Trying to do things the new web3 way: from ../../../nimbus_verified_proxy/validate_proof import getAccountFromProof @@ -43,7 +41,7 @@ var fetchCounter*: int func toHash*(s: string): Hash256 {.raises: [ValueError].} = hexToPaddedByteArray[32](s).toHash -func toHash*(h: BlockHash): Hash256 {.raises: [ValueError].} = +func toHash*(h: BlockHash): Hash256 {.raises: [].} = distinctBase(h).toHash func toWeb3BlockHash*(h: Hash256): BlockHash = diff --git a/nimbus/rpc/rpc_utils.nim b/nimbus/rpc/rpc_utils.nim index 4f85d913f..32a24586b 100644 --- a/nimbus/rpc/rpc_utils.nim +++ b/nimbus/rpc/rpc_utils.nim @@ -7,7 +7,7 @@ # This file may not be copied, modified, or distributed except according to # those terms. -import hexstrings, eth/[common, rlp, keys, trie/db], stew/byteutils, +import hexstrings, eth/[common, keys, trie/db], stew/byteutils, ../db/db_chain, strutils, algorithm, options, times, json, ../constants, stint, rpc_types, ../utils/utils, ../transaction, diff --git a/nimbus/sync/protocol/eth67.nim b/nimbus/sync/protocol/eth67.nim index 101f42dd3..56f3a2738 100644 --- a/nimbus/sync/protocol/eth67.nim +++ b/nimbus/sync/protocol/eth67.nim @@ -18,7 +18,6 @@ import chronicles, chronos, eth/[common, p2p, p2p/private/p2p_types], - stew/byteutils, ./trace_config, ./eth/eth_types, ../types, diff --git a/stateless/tree_from_witness.nim b/stateless/tree_from_witness.nim index cccaa4956..5d5a986c3 100644 --- a/stateless/tree_from_witness.nim +++ b/stateless/tree_from_witness.nim @@ -194,7 +194,7 @@ proc hashNode(t: var TreeBuilder, depth: int, storageMode: bool): NodeKey proc treeNode(t: var TreeBuilder, depth: int = 0, storageMode = false): NodeKey proc buildTree*(t: var TreeBuilder): KeccakHash - {.raises: [ContractCodeError, IOError, ParsingError, Exception].} = + {.raises: [ParsingError, Exception].} = let version = t.safeReadByte().int if version != BlockWitnessVersion.int: raise newException(ParsingError, "Wrong block witness version") @@ -216,7 +216,7 @@ proc buildTree*(t: var TreeBuilder): KeccakHash # chunks, modify this buildForest into chunked witness tree builder proc buildForest*( t: var TreeBuilder): seq[KeccakHash] - {.raises: [ContractCodeError, IOError, ParsingError, Exception].} = + {.raises: [ParsingError, Exception].} = let version = t.safeReadByte().int if version != BlockWitnessVersion.int: raise newException(ParsingError, "Wrong block witness version") diff --git a/tests/rpcclient/eth_api.nim b/tests/rpcclient/eth_api.nim index 7685680c5..576279bc9 100644 --- a/tests/rpcclient/eth_api.nim +++ b/tests/rpcclient/eth_api.nim @@ -1,6 +1,6 @@ import strutils, - json_serialization/std/[sets, net], serialization/errors, + json_serialization/std/[sets, net], json_rpc/[client, jsonmarshal], web3/conversions, eth/common, diff --git a/tests/test_blockchain_json.nim b/tests/test_blockchain_json.nim index daa816052..8fbf4457c 100644 --- a/tests/test_blockchain_json.nim +++ b/tests/test_blockchain_json.nim @@ -9,7 +9,7 @@ # according to those terms. import - std/[json, os, tables, strutils, options, times], + std/[json, os, tables, strutils, options], unittest2, eth/rlp, eth/trie/trie_defs, eth/common/eth_types_rlp, stew/byteutils, @@ -224,7 +224,7 @@ proc importBlock(tester: var Tester, com: CommonRef, proc applyFixtureBlockToChain(tester: var Tester, tb: var TestBlock, com: CommonRef, checkSeal, validation: bool) = - decompose(tb.blockRLP, tb.header, tb.body) + decompose(tb.blockRLP, tb.header, tb.body) tester.importBlock(com, tb, checkSeal, validation) func shouldCheckSeal(tester: Tester): bool = @@ -268,8 +268,8 @@ proc runTester(tester: var Tester, com: CommonRef, testStatusIMPL: var TestStatu debugEcho "error message: ", res.error debugEcho "consensusType: ", com.consensus - except: - debugEcho "FATAL ERROR(WE HAVE BUG): ", getCurrentExceptionMsg() + except CatchableError as ex: + debugEcho "FATAL ERROR(WE HAVE BUG): ", ex.msg else: var noError = true diff --git a/tests/test_generalstate_json.nim b/tests/test_generalstate_json.nim index ff84a7c03..2543a24f1 100644 --- a/tests/test_generalstate_json.nim +++ b/tests/test_generalstate_json.nim @@ -6,7 +6,7 @@ # at your option. This file may not be copied, modified, or distributed except according to those terms. import - std/[strutils, tables, json, os, sets, options, times], + std/[strutils, tables, json, os, sets, options], ./test_helpers, ./test_allowed_to_fail, ../nimbus/core/executor, test_config, ../nimbus/transaction, diff --git a/tests/test_graphql.nim b/tests/test_graphql.nim index e04d63b36..d608386d3 100644 --- a/tests/test_graphql.nim +++ b/tests/test_graphql.nim @@ -9,7 +9,7 @@ import std/[os, json], - stew/byteutils, unittest2, + stew/byteutils, eth/[p2p, rlp], graphql, ../nimbus/graphql/ethapi, graphql/test_common, ../nimbus/sync/protocol, diff --git a/tests/test_rpc.nim b/tests/test_rpc.nim index c0ef5e3bb..e7ae66538 100644 --- a/tests/test_rpc.nim +++ b/tests/test_rpc.nim @@ -97,7 +97,7 @@ proc setupEnv(com: CommonRef, signer, ks2: EthAddress, ctx: EthContext): TestEnv let receiptRoot = com.db.persistReceipts(vmState.receipts) - date = initDateTime(30, mMar, 2017, 00, 00, 00, 00, utc()) + date = dateTime(2017, mMar, 30) timeStamp = date.toTime difficulty = com.calcDifficulty(timeStamp, parent) diff --git a/tests/test_state_db.nim b/tests/test_state_db.nim index 2953463e3..97cd17e75 100644 --- a/tests/test_state_db.nim +++ b/tests/test_state_db.nim @@ -5,8 +5,10 @@ # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # at your option. This file may not be copied, modified, or distributed except according to those terms. -import unittest2, eth/trie/[hexary, db], - ../nimbus/db/state_db, stew/[byteutils, endians2], eth/common +import + unittest2, + ../nimbus/db/state_db, + stew/[byteutils, endians2] include ../nimbus/db/accounts_cache diff --git a/tests/test_txpool/helpers.nim b/tests/test_txpool/helpers.nim index b402777b7..271ca77a6 100644 --- a/tests/test_txpool/helpers.nim +++ b/tests/test_txpool/helpers.nim @@ -131,7 +131,7 @@ proc pp*(tx: Transaction): string = result &= ",gasLimit=" & tx.gasLimit.toKMG if tx.to.isSome: result &= ",to=" & tx.to.get.toXX - if tx.value != 0: + if tx.value.isZero.not: result &= ",value=" & tx.value.toKMG if 0 < tx.payload.len: result &= ",payload=" & tx.payload.toXX diff --git a/vendor/nim-chronos b/vendor/nim-chronos index 2ef34c733..0035f4fa6 160000 --- a/vendor/nim-chronos +++ b/vendor/nim-chronos @@ -1 +1 @@ -Subproject commit 2ef34c7339c5d8e59f212d7af72a06e0d3e8327c +Subproject commit 0035f4fa6692e85756aa192b4df84c21d3cacacb diff --git a/vendor/nim-web3 b/vendor/nim-web3 index 7a835d716..1f9fa11d0 160000 --- a/vendor/nim-web3 +++ b/vendor/nim-web3 @@ -1 +1 @@ -Subproject commit 7a835d71683cd60f111b8de4ff047068e4fbda0e +Subproject commit 1f9fa11d0e63c16aa4ec30e1f7328ae61254d7d0 diff --git a/vendor/nimbus-eth2 b/vendor/nimbus-eth2 index d358aa67c..22208836b 160000 --- a/vendor/nimbus-eth2 +++ b/vendor/nimbus-eth2 @@ -1 +1 @@ -Subproject commit d358aa67cbacc22e77773f4af9fa2aa641f57efc +Subproject commit 22208836b18aaafaafd7c6308ea15b08ff64e323