Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 authored and ogabrielides committed Dec 24, 2023
1 parent 21b6326 commit 2528333
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/functional/rpc_verifychainlock.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def set_test_params(self):
self.set_dash_test_params(5, 3, [["-whitelist=127.0.0.1"], [], [], [], []], fast_dip3_enforcement=True)
self.set_dash_llmq_test_params(3, 2)

def cl_helper(self, height, chainlock, mempool):
return {'height': height, 'chainlock': chainlock, 'mempool': mempool}

def run_test(self):
node0 = self.nodes[0]
node1 = self.nodes[1]
Expand Down Expand Up @@ -63,15 +66,12 @@ def run_test(self):
height1 = node1.getblockcount()
tx0 = node0.getblock(node0.getbestblockhash())['tx'][0]
tx1 = node1.getblock(node1.getbestblockhash())['tx'][0]
locks0 = node0.gettxchainlocks([tx0, tx1])
locks1 = node1.gettxchainlocks([tx0, tx1])
unknown_cl_helper = {'height': -1, 'chainlock': False, 'mempool': False}
assert_equal(locks0, [{'mempool': False, 'height': height, 'chainlock': True}, unknown_cl_helper])
assert_equal(locks1, [unknown_cl_helper, {'mempool': False, 'height': height1, 'chainlock': False}])

tx3 = node0.sendtoaddress(node0.getnewaddress(), 1)
locks0 = node0.gettxchainlocks([tx3])
assert_equal(locks0, [{'height': -1, 'chainlock': False, 'mempool': True}])
tx2 = node0.sendtoaddress(node0.getnewaddress(), 1)
locks0 = node0.gettxchainlocks([tx0, tx1, tx2])
locks1 = node1.gettxchainlocks([tx0, tx1, tx2])
unknown_cl_helper = self.cl_helper(-1, False, False)
assert_equal(locks0, [self.cl_helper(height, True, False), unknown_cl_helper, self.cl_helper(-1, False, True)])
assert_equal(locks1, [unknown_cl_helper, self.cl_helper(height1, False, False), unknown_cl_helper])

if __name__ == '__main__':
RPCVerifyChainLockTest().main()

0 comments on commit 2528333

Please sign in to comment.