reduce compiler warnings

This commit is contained in:
jangko 2023-06-12 11:29:03 +07:00
parent 0128c82c52
commit 8700d8b1e1
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
14 changed files with 20 additions and 21 deletions

View File

@ -28,8 +28,6 @@ from web3/ethtypes import Quantity
#from ../../../premix/downloader import request #from ../../../premix/downloader import request
#from ../../../premix/parser import prefixHex, parseBlockHeader, parseReceipt, parseTransaction #from ../../../premix/parser import prefixHex, parseBlockHeader, parseReceipt, parseTransaction
from eth/common import BlockHeader
# Trying to do things the new web3 way: # Trying to do things the new web3 way:
from ../../../nimbus_verified_proxy/validate_proof import getAccountFromProof from ../../../nimbus_verified_proxy/validate_proof import getAccountFromProof
@ -43,7 +41,7 @@ var fetchCounter*: int
func toHash*(s: string): Hash256 {.raises: [ValueError].} = func toHash*(s: string): Hash256 {.raises: [ValueError].} =
hexToPaddedByteArray[32](s).toHash hexToPaddedByteArray[32](s).toHash
func toHash*(h: BlockHash): Hash256 {.raises: [ValueError].} = func toHash*(h: BlockHash): Hash256 {.raises: [].} =
distinctBase(h).toHash distinctBase(h).toHash
func toWeb3BlockHash*(h: Hash256): BlockHash = func toWeb3BlockHash*(h: Hash256): BlockHash =

View File

@ -7,7 +7,7 @@
# This file may not be copied, modified, or distributed except according to # This file may not be copied, modified, or distributed except according to
# those terms. # 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, ../db/db_chain, strutils, algorithm, options, times, json,
../constants, stint, rpc_types, ../constants, stint, rpc_types,
../utils/utils, ../transaction, ../utils/utils, ../transaction,

View File

@ -18,7 +18,6 @@ import
chronicles, chronicles,
chronos, chronos,
eth/[common, p2p, p2p/private/p2p_types], eth/[common, p2p, p2p/private/p2p_types],
stew/byteutils,
./trace_config, ./trace_config,
./eth/eth_types, ./eth/eth_types,
../types, ../types,

View File

@ -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 treeNode(t: var TreeBuilder, depth: int = 0, storageMode = false): NodeKey
proc buildTree*(t: var TreeBuilder): KeccakHash proc buildTree*(t: var TreeBuilder): KeccakHash
{.raises: [ContractCodeError, IOError, ParsingError, Exception].} = {.raises: [ParsingError, Exception].} =
let version = t.safeReadByte().int let version = t.safeReadByte().int
if version != BlockWitnessVersion.int: if version != BlockWitnessVersion.int:
raise newException(ParsingError, "Wrong block witness version") 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 # chunks, modify this buildForest into chunked witness tree builder
proc buildForest*( proc buildForest*(
t: var TreeBuilder): seq[KeccakHash] t: var TreeBuilder): seq[KeccakHash]
{.raises: [ContractCodeError, IOError, ParsingError, Exception].} = {.raises: [ParsingError, Exception].} =
let version = t.safeReadByte().int let version = t.safeReadByte().int
if version != BlockWitnessVersion.int: if version != BlockWitnessVersion.int:
raise newException(ParsingError, "Wrong block witness version") raise newException(ParsingError, "Wrong block witness version")

View File

@ -1,6 +1,6 @@
import import
strutils, strutils,
json_serialization/std/[sets, net], serialization/errors, json_serialization/std/[sets, net],
json_rpc/[client, jsonmarshal], json_rpc/[client, jsonmarshal],
web3/conversions, web3/conversions,
eth/common, eth/common,

View File

@ -9,7 +9,7 @@
# according to those terms. # according to those terms.
import import
std/[json, os, tables, strutils, options, times], std/[json, os, tables, strutils, options],
unittest2, unittest2,
eth/rlp, eth/trie/trie_defs, eth/common/eth_types_rlp, eth/rlp, eth/trie/trie_defs, eth/common/eth_types_rlp,
stew/byteutils, stew/byteutils,
@ -224,7 +224,7 @@ proc importBlock(tester: var Tester, com: CommonRef,
proc applyFixtureBlockToChain(tester: var Tester, tb: var TestBlock, proc applyFixtureBlockToChain(tester: var Tester, tb: var TestBlock,
com: CommonRef, checkSeal, validation: bool) = 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) tester.importBlock(com, tb, checkSeal, validation)
func shouldCheckSeal(tester: Tester): bool = 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 "error message: ", res.error
debugEcho "consensusType: ", com.consensus debugEcho "consensusType: ", com.consensus
except: except CatchableError as ex:
debugEcho "FATAL ERROR(WE HAVE BUG): ", getCurrentExceptionMsg() debugEcho "FATAL ERROR(WE HAVE BUG): ", ex.msg
else: else:
var noError = true var noError = true

View File

@ -6,7 +6,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import import
std/[strutils, tables, json, os, sets, options, times], std/[strutils, tables, json, os, sets, options],
./test_helpers, ./test_allowed_to_fail, ./test_helpers, ./test_allowed_to_fail,
../nimbus/core/executor, test_config, ../nimbus/core/executor, test_config,
../nimbus/transaction, ../nimbus/transaction,

View File

@ -9,7 +9,7 @@
import import
std/[os, json], std/[os, json],
stew/byteutils, unittest2, stew/byteutils,
eth/[p2p, rlp], eth/[p2p, rlp],
graphql, ../nimbus/graphql/ethapi, graphql/test_common, graphql, ../nimbus/graphql/ethapi, graphql/test_common,
../nimbus/sync/protocol, ../nimbus/sync/protocol,

View File

@ -97,7 +97,7 @@ proc setupEnv(com: CommonRef, signer, ks2: EthAddress, ctx: EthContext): TestEnv
let let
receiptRoot = com.db.persistReceipts(vmState.receipts) receiptRoot = com.db.persistReceipts(vmState.receipts)
date = initDateTime(30, mMar, 2017, 00, 00, 00, 00, utc()) date = dateTime(2017, mMar, 30)
timeStamp = date.toTime timeStamp = date.toTime
difficulty = com.calcDifficulty(timeStamp, parent) difficulty = com.calcDifficulty(timeStamp, parent)

View File

@ -5,8 +5,10 @@
# * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) # * 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. # at your option. This file may not be copied, modified, or distributed except according to those terms.
import unittest2, eth/trie/[hexary, db], import
../nimbus/db/state_db, stew/[byteutils, endians2], eth/common unittest2,
../nimbus/db/state_db,
stew/[byteutils, endians2]
include ../nimbus/db/accounts_cache include ../nimbus/db/accounts_cache

View File

@ -131,7 +131,7 @@ proc pp*(tx: Transaction): string =
result &= ",gasLimit=" & tx.gasLimit.toKMG result &= ",gasLimit=" & tx.gasLimit.toKMG
if tx.to.isSome: if tx.to.isSome:
result &= ",to=" & tx.to.get.toXX result &= ",to=" & tx.to.get.toXX
if tx.value != 0: if tx.value.isZero.not:
result &= ",value=" & tx.value.toKMG result &= ",value=" & tx.value.toKMG
if 0 < tx.payload.len: if 0 < tx.payload.len:
result &= ",payload=" & tx.payload.toXX result &= ",payload=" & tx.payload.toXX

2
vendor/nim-chronos vendored

@ -1 +1 @@
Subproject commit 2ef34c7339c5d8e59f212d7af72a06e0d3e8327c Subproject commit 0035f4fa6692e85756aa192b4df84c21d3cacacb

2
vendor/nim-web3 vendored

@ -1 +1 @@
Subproject commit 7a835d71683cd60f111b8de4ff047068e4fbda0e Subproject commit 1f9fa11d0e63c16aa4ec30e1f7328ae61254d7d0

2
vendor/nimbus-eth2 vendored

@ -1 +1 @@
Subproject commit d358aa67cbacc22e77773f4af9fa2aa641f57efc Subproject commit 22208836b18aaafaafd7c6308ea15b08ff64e323