mirror of https://github.com/status-im/nim-eth.git
--styleCheck:error (#520)
* --styleCheck:error * testcase -> testCase * more testcase -> testCase * remove unused imports * MessageKind enum name consistency in tests * rest of fuzz_decode_message * rlpEncodeEIP155 -> rlpEncodeEip155
This commit is contained in:
parent
cbb233d8a9
commit
92b14b43eb
10
eth.nimble
10
eth.nimble
|
@ -18,9 +18,15 @@ requires "nim >= 1.2.0",
|
|||
"testutils",
|
||||
"unittest2"
|
||||
|
||||
let styleCheckStyle =
|
||||
if (NimMajor, NimMinor) < (1, 6):
|
||||
"hint"
|
||||
else:
|
||||
"error"
|
||||
|
||||
let commonParams = " --verbosity:0 --hints:off --skipUserCfg:on " &
|
||||
"--warning[ObservableStores]:off --styleCheck:usages --styleCheck:hint " &
|
||||
getEnv("NIMFLAGS") & " "
|
||||
"--warning[ObservableStores]:off --styleCheck:usages --styleCheck:" &
|
||||
styleCheckStyle & " " & getEnv("NIMFLAGS") & " "
|
||||
|
||||
proc runTest(path: string, release: bool = true, chronosStrict = true) =
|
||||
echo "\nBuilding and running: ", path
|
||||
|
|
|
@ -64,7 +64,7 @@ func rlpEncode*(tx: Transaction): auto =
|
|||
case tx.txType
|
||||
of TxLegacy:
|
||||
if tx.V >= EIP155_CHAIN_ID_OFFSET:
|
||||
tx.rlpEncodeEIP155
|
||||
tx.rlpEncodeEip155
|
||||
else:
|
||||
tx.rlpEncodeLegacy
|
||||
of TxEip2930:
|
||||
|
|
|
@ -13,11 +13,11 @@ test:
|
|||
of unused: break
|
||||
of ping: encoded = encodeMessage(message.ping, message.reqId)
|
||||
of pong: encoded = encodeMessage(message.pong, message.reqId)
|
||||
of findnode: encoded = encodeMessage(message.findNode, message.reqId)
|
||||
of findNode: encoded = encodeMessage(message.findNode, message.reqId)
|
||||
of nodes: encoded = encodeMessage(message.nodes, message.reqId)
|
||||
of talkreq: encoded = encodeMessage(message.talkreq, message.reqId)
|
||||
of talkresp: encoded = encodeMessage(message.talkresp, message.reqId)
|
||||
of regtopic, ticket, regconfirmation, topicquery:
|
||||
of talkReq: encoded = encodeMessage(message.talkReq, message.reqId)
|
||||
of talkResp: encoded = encodeMessage(message.talkResp, message.reqId)
|
||||
of regTopic, ticket, regConfirmation, topicQuery:
|
||||
break
|
||||
|
||||
# This will hit assert because of issue:
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
import
|
||||
unittest2,
|
||||
nimcrypto/[utils, sysrand, keccak],
|
||||
nimcrypto/[utils, sysrand],
|
||||
../../eth/keys, ../../eth/p2p/[auth, rlpxcrypt]
|
||||
|
||||
const data = [
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
# Copyright (c) 2019-2022 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||
|
||||
{.used.}
|
||||
|
||||
import
|
||||
std/[options, sequtils],
|
||||
unittest2,
|
||||
nimcrypto/utils, stew/shims/net,
|
||||
stew/shims/net,
|
||||
../../eth/p2p/discoveryv5/enr, ../../eth/[keys, rlp]
|
||||
|
||||
let rng = newRng()
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
# Copyright (c) 2019-2022 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0).
|
||||
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
||||
|
||||
{.used.}
|
||||
|
||||
import
|
||||
unittest2,
|
||||
stew/byteutils, nimcrypto/[keccak, hash],
|
||||
../../eth/trie/[db, binary, binaries, trie_utils, branches]
|
||||
../../eth/trie/[db, binary, binaries, branches]
|
||||
|
||||
suite "examples":
|
||||
|
||||
|
|
|
@ -132,7 +132,7 @@ procSuite "Utp protocol over udp tests with loss and delays":
|
|||
clientProtocol,
|
||||
clientSocket,
|
||||
serverProtocol,
|
||||
serverSocket) = await testScenario(testCase.maxDelay, testCase.dropRate, testcase.cfg)
|
||||
serverSocket) = await testScenario(testCase.maxDelay, testCase.dropRate, testCase.cfg)
|
||||
|
||||
let smallBytes = 10
|
||||
let smallBytesToTransfer = rng[].generateBytes(smallBytes)
|
||||
|
@ -188,7 +188,7 @@ procSuite "Utp protocol over udp tests with loss and delays":
|
|||
clientProtocol,
|
||||
clientSocket,
|
||||
serverProtocol,
|
||||
serverSocket) = await testScenario(testCase.maxDelay, testCase.dropRate, testcase.cfg)
|
||||
serverSocket) = await testScenario(testCase.maxDelay, testCase.dropRate, testCase.cfg)
|
||||
|
||||
let smallBytes = 10
|
||||
let smallBytesToTransfer = rng[].generateBytes(smallBytes)
|
||||
|
@ -233,7 +233,7 @@ procSuite "Utp protocol over udp tests with loss and delays":
|
|||
clientProtocol,
|
||||
clientSocket,
|
||||
serverProtocol,
|
||||
serverSocket) = await testScenario(testCase.maxDelay, testCase.dropRate, testcase.cfg)
|
||||
serverSocket) = await testScenario(testCase.maxDelay, testCase.dropRate, testCase.cfg)
|
||||
|
||||
|
||||
let numBytes = testCase.bytesToTransfer
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2020-2021 Status Research & Development GmbH
|
||||
# Copyright (c) 2020-2022 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
@ -8,7 +8,7 @@
|
|||
|
||||
import
|
||||
std/[algorithm, random, sequtils, options],
|
||||
chronos, chronicles,
|
||||
chronos,
|
||||
testutils/unittests,
|
||||
./test_utils,
|
||||
../../eth/utp/utp_router,
|
||||
|
@ -1089,7 +1089,7 @@ procSuite "Utp socket unit test":
|
|||
let writeResult = await writeFut
|
||||
|
||||
check:
|
||||
writeResult.isOK()
|
||||
writeResult.isOk()
|
||||
|
||||
await outgoingSocket.destroyWait()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2021 Status Research & Development GmbH
|
||||
# Copyright (c) 2021-2022 Status Research & Development GmbH
|
||||
# Licensed and distributed under either of
|
||||
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
||||
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
@ -8,7 +8,7 @@
|
|||
|
||||
import
|
||||
std/[options, sequtils],
|
||||
chronos, chronicles,
|
||||
chronos,
|
||||
stew/bitops2,
|
||||
testutils/unittests,
|
||||
./test_utils,
|
||||
|
|
Loading…
Reference in New Issue