Skip to content

Commit

Permalink
fix feature_asset_locks.py
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Sep 29, 2023
1 parent 2469443 commit 22ab019
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/functional/feature_asset_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
assert_equal,
assert_greater_than,
assert_greater_than_or_equal,
hex_str_to_bytes,
)

llmq_type_test = 100
Expand Down Expand Up @@ -164,8 +165,15 @@ def create_and_check_block(self, txes, expected_error = None):
block_time = best_block["time"] + 1

cbb = create_coinbase(height, dip4_activated=True, v20_activated=True)
cbb.calc_sha256()
gbt = node_wallet.getblocktemplate()
cbb.vExtraPayload = hex_str_to_bytes(gbt["coinbase_payload"])
cbb.rehash()
block = create_block(tip, cbb, block_time, version=4)
# Add quorum commitments from block template
for tx_obj in gbt["transactions"]:
tx = FromHex(CTransaction(), tx_obj["data"])
if tx.nType == 6:
block.vtx.append(tx)
for tx in txes:
block.vtx.append(tx)
block.hashMerkleRoot = block.calc_merkle_root()
Expand Down Expand Up @@ -281,6 +289,7 @@ def run_test(self):
self.sync_all()

self.log.info('Mine block with incorrect credit-pool value...')
coin = coins.pop()
extra_lock_tx = self.create_assetlock(coin, COIN, pubkey)
self.create_and_check_block([extra_lock_tx], expected_error = 'bad-cbtx-assetlocked-amount')

Expand Down

0 comments on commit 22ab019

Please sign in to comment.