Skip to content

Commit 629efb2

Browse files
author
Lee Miller
committed
Update the test for disseminatePreEncryptedMsg API command
1 parent f6bd154 commit 629efb2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/tests/test_api_thread.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
from six.moves import queue, xmlrpc_client
99

1010
from pybitmessage import protocol
11-
from pybitmessage.defaults import (
12-
networkDefaultProofOfWorkNonceTrialsPerByte,
13-
networkDefaultPayloadLengthExtraBytes)
11+
from pybitmessage.highlevelcrypto import calculateInventoryHash
1412

1513
from .partial import TestPartialRun
1614
from .samples import sample_statusbar_msg, sample_object_data
@@ -80,12 +78,14 @@ def test_disseminate_preencrypted(self):
8078
from inventory import Inventory
8179

8280
proofofwork.init()
83-
update_object = pack(
81+
self.assertEqual(
82+
unhexlify(self.api.disseminatePreparedObject(
83+
hexlify(sample_object_data).decode())),
84+
calculateInventoryHash(sample_object_data))
85+
update_object = b'\x00' * 8 + pack(
8486
'>Q', int(time.time() + 7200)) + sample_object_data[16:]
8587
invhash = unhexlify(self.api.disseminatePreEncryptedMsg(
86-
hexlify(update_object).decode(),
87-
networkDefaultProofOfWorkNonceTrialsPerByte,
88-
networkDefaultPayloadLengthExtraBytes
88+
hexlify(update_object).decode()
8989
))
9090
obj_type, obj_stream, obj_data = Inventory()[invhash][:3]
9191
self.assertEqual(obj_type, 42)

0 commit comments

Comments
 (0)