@@ -22,62 +22,61 @@ def set_test_params(self):
22
22
self .extra_args = [[],[]]
23
23
24
24
def run_test (self ):
25
-
26
25
self .checkpermission (
27
- # default permissions (no specific permissions)
28
- ["-whitelist=127.0.0.1" ],
29
- ["relay" , "noban" , "mempool" ],
30
- True )
26
+ # default permissions (no specific permissions)
27
+ ["-whitelist=127.0.0.1" ],
28
+ ["relay" , "noban" , "mempool" ],
29
+ True )
31
30
32
31
self .checkpermission (
33
- # relay permission removed (no specific permissions)
34
- ["-whitelist=127.0.0.1" , "-whitelistrelay=0" ],
35
- ["noban" , "mempool" ],
36
- True )
32
+ # relay permission removed (no specific permissions)
33
+ ["-whitelist=127.0.0.1" , "-whitelistrelay=0" ],
34
+ ["noban" , "mempool" ],
35
+ True )
37
36
38
37
self .checkpermission (
39
- # forcerelay and relay permission added
40
- # Legacy parameter interaction which set whitelistrelay to true
41
- # if whitelistforcerelay is true
42
- ["-whitelist=127.0.0.1" , "-whitelistforcerelay" ],
43
- ["forcerelay" , "relay" , "noban" , "mempool" ],
44
- True )
38
+ # forcerelay and relay permission added
39
+ # Legacy parameter interaction which set whitelistrelay to true
40
+ # if whitelistforcerelay is true
41
+ ["-whitelist=127.0.0.1" , "-whitelistforcerelay" ],
42
+ ["forcerelay" , "relay" , "noban" , "mempool" ],
43
+ True )
45
44
46
45
# Let's make sure permissions are merged correctly
47
46
# For this, we need to use whitebind instead of bind
48
47
# by modifying the configuration file.
49
48
ip_port = "127.0.0.1:{}" .format (p2p_port (1 ))
50
49
self .replaceinconfig (1 , "bind=127.0.0.1" , "whitebind=bloomfilter,forcerelay@" + ip_port )
51
50
self .checkpermission (
52
-
53
- # Check parameter interaction forcerelay should activate relay
54
- ["noban" , "bloomfilter" , "forcerelay" , "relay" ],
55
- False )
51
+
52
+ # Check parameter interaction forcerelay should activate relay
53
+ ["noban" , "bloomfilter" , "forcerelay" , "relay" ],
54
+ False )
56
55
self .replaceinconfig (1 , "whitebind=bloomfilter,forcerelay@" + ip_port , "bind=127.0.0.1" )
57
56
58
57
self .checkpermission (
59
- # legacy whitelistrelay should be ignored
60
- [
"-whitelist=noban,[email protected] " ,
"-whitelistrelay" ],
61
- ["noban" , "mempool" ],
62
- False )
58
+ # legacy whitelistrelay should be ignored
59
+ [
"-whitelist=noban,[email protected] " ,
"-whitelistrelay" ],
60
+ ["noban" , "mempool" ],
61
+ False )
63
62
64
63
self .checkpermission (
65
- # legacy whitelistforcerelay should be ignored
66
- [
"-whitelist=noban,[email protected] " ,
"-whitelistforcerelay" ],
67
- ["noban" , "mempool" ],
68
- False )
64
+ # legacy whitelistforcerelay should be ignored
65
+ [
"-whitelist=noban,[email protected] " ,
"-whitelistforcerelay" ],
66
+ ["noban" , "mempool" ],
67
+ False )
69
68
70
69
self .checkpermission (
71
- # missing mempool permission to be considered legacy whitelisted
72
-
73
- ["noban" ],
74
- False )
70
+ # missing mempool permission to be considered legacy whitelisted
71
+
72
+ ["noban" ],
73
+ False )
75
74
76
75
self .checkpermission (
77
- # all permission added
78
-
79
- ["forcerelay" , "noban" , "mempool" , "bloomfilter" , "relay" ],
80
- False )
76
+ # all permission added
77
+
78
+ ["forcerelay" , "noban" , "mempool" , "bloomfilter" , "relay" ],
79
+ False )
81
80
82
81
self .stop_node (1 )
83
82
self .
nodes [
1 ].
assert_start_raises_init_error ([
"[email protected] " ],
"Invalid P2P permission" ,
match = ErrorMatch .
PARTIAL_REGEX )
0 commit comments