-
Notifications
You must be signed in to change notification settings - Fork 399
Closed
Description
In the following code:
from bitcoinrpc.authproxy import AuthServiceProxy
user = "rpcuser"
password = "rpcpassword"
port=7040
liquid_rpc = AuthServiceProxy("http://{}:{}@localhost:{}".format(user, password, port))
def issue_asset(reissue):
if reissue:
return liquid_rpc.issueasset(3, 4, True)
else:
return liquid_rpc.issueasset(1, 0, True)
def test_issuance(reissue):
print("Issuance - Reissuance: {0}".format(reissue))
asset_result = issue_asset(reissue)
print_issuance(asset_result['txid'])
def print_issuance(txid):
raw_tx = liquid_rpc.getrawtransaction(txid, 1)
print(raw_tx['vin'][0]['issuance'].keys())
def test_raw_issue_asset(reissue):
print("Raw Issuance - Reissuance: {0}".format(reissue))
addr1 = liquid_rpc.getnewaddress()
addr2 = liquid_rpc.getnewaddress()
addr3 = liquid_rpc.getnewaddress()
rawtx = liquid_rpc.createrawtransaction([], {addr1: 0.0001})
fundedtx = liquid_rpc.fundrawtransaction(rawtx)
if not reissue:
tx = liquid_rpc.rawissueasset(fundedtx['hex'], [{'asset_amount':7, 'asset_address': addr2, 'blind': True}])
else:
tx = liquid_rpc.rawissueasset(fundedtx['hex'], [{'asset_amount':5, 'asset_address': addr2, 'token_amount': 6, 'token_address': addr3, 'blind': True}])
brtx = liquid_rpc.blindrawtransaction(tx[0]['hex'])
signed = liquid_rpc.signrawtransactionwithwallet(brtx)
tx_sent = liquid_rpc.sendrawtransaction(signed['hex'])
print_issuance(tx_sent)
return tx_sent
test_issuance(True)
tx = test_raw_issue_asset(True)
test_issuance(False)
tx = test_raw_issue_asset(False)
I attempt to call both issueasset and rawissueasset with a blinded issuance, and either a reissuance token and without.
In the last two cases, I would expect similar results, but in the raw_issue_asset case, I still get a tokenamountcommitment. I would expect this to be not included if I am not issuing a reissuance token.
Metadata
Metadata
Assignees
Labels
No labels