Skip to content

Commit

Permalink
test: check creditOutputs format
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Aug 23, 2024
1 parent ba0e645 commit 3ed6246
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/functional/feature_asset_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
OP_RETURN,
hash160,
)
from test_framework.script_util import key_to_p2pkh_script
from test_framework.test_framework import DashTestFramework
from test_framework.util import (
assert_equal,
Expand Down Expand Up @@ -283,7 +284,11 @@ def test_asset_locks(self, node_wallet, node, pubkey):
self.check_mempool_result(tx=asset_lock_tx, result_expected={'allowed': True, 'fees': {'base': Decimal(str(tiny_amount / COIN))}})
self.validate_credit_pool_balance(0)
txid_in_block = self.send_tx(asset_lock_tx)
assert "assetLockTx" in node.getrawtransaction(txid_in_block, 1)
rpc_tx = node.getrawtransaction(txid_in_block, 1)
assert_equal(len(rpc_tx["assetLockTx"]["creditOutputs"]), 2)
assert_equal(rpc_tx["assetLockTx"]["creditOutputs"][0]["valueSat"] + rpc_tx["assetLockTx"]["creditOutputs"][1]["valueSat"], locked_1)
assert_equal(rpc_tx["assetLockTx"]["creditOutputs"][0]["scriptPubKey"]["hex"], key_to_p2pkh_script(pubkey).hex())
assert_equal(rpc_tx["assetLockTx"]["creditOutputs"][1]["scriptPubKey"]["hex"], key_to_p2pkh_script(pubkey).hex())
self.validate_credit_pool_balance(0)
node.generate(1)
assert_equal(self.get_credit_pool_balance(node=node), locked_1)
Expand Down

0 comments on commit 3ed6246

Please sign in to comment.