nim-eth/tests/p2p
Jordan Hrycaj 00ed6ad312
Dedicated RLP reader for `DisconnectionReason` (#507)
* Provide dedicated `DisconnectionReason` enum type RLP reader

why:
  Without this reader, the program communicating via RLPX will crash when
  receiving out of bound reason codes disconnect message.

  Out of bound value assignments to an enum causes a `RangeError`defect
  and consequently the program to terminate. This `RangeError` is avoided
  here and a `MalformedRlpError` catchable error raised.

* Using default exception type in bespoke `read(DisconnectionReason)`

why:
  This should not differ from the default enum parser. The particular
  message is different and more targeted, here.

  Note: The default RLP parser was not used because `
  `array[1,DisconnectionReason]` is currently not properly handled and
  should give a siliar error message as a `DisconnectionReason` error.

* De-clutter, custom read() was not needed

Co-authored-by: jordan <jordan@curd.mjh-it.com>
2022-05-26 10:23:40 +01:00
..
les CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
all_discv5_tests.nim Add raises annotations to discovery.nim 2021-04-27 21:11:54 +02:00
all_tests.nim Remove portal wire code which was moved to nimbus-eth1 repo (#370) 2021-07-09 22:14:31 +02:00
config.nims CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
disabled_test_shh_connect_mocked.nim CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
discv5_test_helper.nim Add DiscoveryConfig to tune routing table ip limits and bitPerHops (#471) 2022-02-02 15:29:45 +01:00
p2p_test_helper.nim Add bind ip and bind port for eth1 rlpx and discovery protocols (#485) 2022-03-15 18:08:15 +01:00
shh_basic_client.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00
test_auth.nim Handle the decodeAuthMessage error case separatly and log to trace (#498) 2022-04-04 22:31:09 +02:00
test_crypt.nim Handle the decodeAuthMessage error case separatly and log to trace (#498) 2022-04-04 22:31:09 +02:00
test_discovery.nim Add bind ip and bind port for eth1 rlpx and discovery protocols (#485) 2022-03-15 18:08:15 +01:00
test_discoveryv5.nim Add discv5 max packet size limit (#505) 2022-05-02 16:49:19 +02:00
test_discoveryv5_encoding.nim More --styleCheck fixes for discoveryv5 and eth/common (#473) 2022-02-03 15:51:08 +01:00
test_ecies.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
test_enode.nim add bootnodes test 2022-02-27 11:53:11 +07:00
test_enr.nim Don't use exceptions for enr get call (#453) 2021-12-21 15:09:32 +01:00
test_hkdf.nim CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
test_ip_vote.nim CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
test_lru.nim CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
test_protocol_handlers.nim Adjust for chronosStrictException usage in rest of eth/p2p 2021-05-06 17:20:54 +02:00
test_rlpx_thunk.json Dedicated RLP reader for `DisconnectionReason` (#507) 2022-05-26 10:23:40 +01:00
test_rlpx_thunk.nim CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
test_routing_table.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
test_shh.nim Style fixes according to --styleCheck:usages (#452) 2021-12-20 13:14:50 +01:00
test_shh_config.nim CI: test with multiple Nim version (#429) 2021-12-11 19:12:55 +01:00
test_shh_connect.nim Adjust for chronosStrictException usage in rest of eth/p2p 2021-05-06 17:20:54 +02:00
tserver.nim Add build_dcli target and add it to CI (#344) 2021-04-06 13:33:24 +02:00