Skip to content

Commit 1030634

Browse files
committed
test: check creditOutputs format
1 parent b9e0eb6 commit 1030634

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/functional/feature_asset_locks.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
OP_RETURN,
3737
hash160,
3838
)
39+
from test_framework.script_util import key_to_p2pkh_script
3940
from test_framework.test_framework import DashTestFramework
4041
from test_framework.util import (
4142
assert_equal,
@@ -283,7 +284,10 @@ def test_asset_locks(self, node_wallet, node, pubkey):
283284
self.check_mempool_result(tx=asset_lock_tx, result_expected={'allowed': True, 'fees': {'base': Decimal(str(tiny_amount / COIN))}})
284285
self.validate_credit_pool_balance(0)
285286
txid_in_block = self.send_tx(asset_lock_tx)
286-
assert "assetLockTx" in node.getrawtransaction(txid_in_block, 1)
287+
rpc_tx = node.getrawtransaction(txid_in_block, 1)
288+
assert_equal(len(rpc_tx["assetLockTx"]["creditOutputs"]), 2)
289+
assert_equal(rpc_tx["assetLockTx"]["creditOutputs"][0]["valueSat"] + rpc_tx["assetLockTx"]["creditOutputs"][1]["valueSat"], locked_1)
290+
assert_equal(rpc_tx["assetLockTx"]["creditOutputs"][0]["scriptPubKey"]["hex"], key_to_p2pkh_script(pubkey).hex())
287291
self.validate_credit_pool_balance(0)
288292
node.generate(1)
289293
assert_equal(self.get_credit_pool_balance(node=node), locked_1)

0 commit comments

Comments
 (0)