Merge pull request #6253 from daira/fix-show-help

Fix `show_help` and `receivedby` RPC tests
This commit is contained in:
Daira Hopwood 2022-11-15 20:15:51 +00:00 committed by GitHub
commit 22d262f67d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -13,7 +13,7 @@ from test_framework.util import assert_equal, assert_true, zcashd_binary
import subprocess
import tempfile
help_message = """
help_message_1 = """
In order to ensure you are adequately protecting your privacy when using Zcash,
please see <https://z.cash/support/security/>.
@ -85,7 +85,8 @@ Options:
Keep at most <n> unconnectable transactions in memory (default: 100)
-par=<n>
Set the number of script verification threads (-8 to 16, 0 = auto, <0 =
Set the number of script verification threads (""" # nondeterministic part here
help_message_2 = """, 0 = auto, <0 =
leave that many cores free, default: 0)
-pid=<file>
@ -492,7 +493,8 @@ class ShowHelpTest(BitcoinTestFramework):
assert_equal(process.returncode, 0)
log_stdout.seek(0)
stdout = log_stdout.read().decode('utf-8')
assert_true(help_message in stdout)
assert_true(help_message_1 in stdout)
assert_true(help_message_2 in stdout)
def run_test(self):
self.show_help()

View File

@ -107,7 +107,7 @@ def all_interfaces():
max_possible *= 2
else:
break
namestr = names.tostring()
namestr = names.tobytes()
return [(namestr[i:i+16].split(b'\0', 1)[0],
socket.inet_ntoa(namestr[i+20:i+24]))
for i in range(0, outbytes, struct_size)]