refactor: use key_to_p2pkh_script in more places

This commit is contained in:
UdjinM6 2024-08-24 00:51:21 +03:00
parent 3ed6246889
commit e54fe42ce8
No known key found for this signature in database
GPG Key ID: 83592BD1400D58D9

View File

@ -30,11 +30,7 @@ from test_framework.messages import (
from test_framework.script import ( from test_framework.script import (
CScript, CScript,
OP_CHECKSIG, OP_CHECKSIG,
OP_DUP,
OP_EQUALVERIFY,
OP_HASH160,
OP_RETURN, OP_RETURN,
hash160,
) )
from test_framework.script_util import key_to_p2pkh_script from test_framework.script_util import key_to_p2pkh_script
from test_framework.test_framework import DashTestFramework from test_framework.test_framework import DashTestFramework
@ -67,8 +63,8 @@ class AssetLocksTest(DashTestFramework):
tmp_amount = amount tmp_amount = amount
if tmp_amount > COIN: if tmp_amount > COIN:
tmp_amount -= COIN tmp_amount -= COIN
credit_outputs.append(CTxOut(COIN, CScript([OP_DUP, OP_HASH160, hash160(pubkey), OP_EQUALVERIFY, OP_CHECKSIG]))) credit_outputs.append(CTxOut(COIN, key_to_p2pkh_script(pubkey)))
credit_outputs.append(CTxOut(tmp_amount, CScript([OP_DUP, OP_HASH160, hash160(pubkey), OP_EQUALVERIFY, OP_CHECKSIG]))) credit_outputs.append(CTxOut(tmp_amount, key_to_p2pkh_script(pubkey)))
lockTx_payload = CAssetLockTx(1, credit_outputs) lockTx_payload = CAssetLockTx(1, credit_outputs)