mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-06 14:19:59 -05:00
Merge bitcoin/bitcoin#29460: test: assert rpc error for addnode v2transport not enabled
345169a752
test: assert rpc error for addnode v2transport not enabled (kevkevin) Pull request description: Added coverage for the `addnode` rpc when v2transport is not enabled, but is set as true when calling `addnode` rpc. I ran the following to check if this rpc error message was covered in the functional tests. `grep -nr "v2transport requested but not enabled" ./test/functional --binary-files=without-match` Adds test coverage to this line. https://github.com/bitcoin/bitcoin/blob/master/src/rpc/net.cpp#L339 ACKs for top commit: maflcko: lgtm ACK345169a752
brunoerg: utACK345169a752
BrandonOdiwuor: Code Review ACK345169a752
theStack: Code-review ACK345169a752
Tree-SHA512: fb82409485efe25a1193b1dafca8ae694b397a301bb8bcb33c7572d21ff244ee45fbbd4364141e9421733873b343554a34614a59b1450ce0cac5c420203c3d35
This commit is contained in:
commit
2ac41ef15f
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,7 @@ from test_framework.test_framework import BitcoinTestFramework
|
|||
from test_framework.util import (
|
||||
assert_equal,
|
||||
p2p_port,
|
||||
assert_raises_rpc_error
|
||||
)
|
||||
|
||||
|
||||
|
@ -59,6 +60,11 @@ class V2TransportTest(BitcoinTestFramework):
|
|||
# V1 nodes can sync with each other
|
||||
assert_equal(self.nodes[2].getblockcount(), 0)
|
||||
assert_equal(self.nodes[3].getblockcount(), 0)
|
||||
|
||||
# addnode rpc error when v2transport requested but not enabled
|
||||
ip_port = "127.0.0.1:{}".format(p2p_port(3))
|
||||
assert_raises_rpc_error(-8, "Error: v2transport requested but not enabled (see -v2transport)", self.nodes[2].addnode, node=ip_port, command='add', v2transport=True)
|
||||
|
||||
with self.nodes[2].assert_debug_log(expected_msgs=[],
|
||||
unexpected_msgs=[sending_handshake, downgrading_to_v1]):
|
||||
self.connect_nodes(2, 3, peer_advertises_v2=False)
|
||||
|
|
Loading…
Add table
Reference in a new issue