Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rawissueasset and issueasset have different behaviors for #643

Closed
allenpiscitello opened this issue Jun 4, 2019 · 0 comments · Fixed by #649
Closed

rawissueasset and issueasset have different behaviors for #643

allenpiscitello opened this issue Jun 4, 2019 · 0 comments · Fixed by #649

Comments

@allenpiscitello
Copy link
Contributor

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.

stevenroose added a commit that referenced this issue Jun 5, 2019
…nded later

d710cb5 rawissueasset: don't make explicit 0-value which gets blinded later (Gregory Sanders)

Pull request description:

  This matches the behavior of `issueasset`.

  Resolves #643

Tree-SHA512: 655d84a45c686f31867eccaa423279bb81481b9321eb061a85af78f12a6652899ddd1c25357e36f1257e61af6c6d9b5b007d1615c18d7a4a826844102649fe45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant