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

TX70 RPC output missing details #278

Open
achamely opened this issue Feb 2, 2015 · 8 comments
Open

TX70 RPC output missing details #278

achamely opened this issue Feb 2, 2015 · 8 comments
Labels

Comments

@achamely
Copy link

achamely commented Feb 2, 2015

The RPC output of a valid TX70 is missing 2 vital pieces of information that would be needed by integrators, The reference address and propertyid being affected by the tx.

Ex:

./mastercored gettransaction_MP 0a7a3e6165a5d17be55214a3967834d0537cadb03cf8a840a3e3b6ea315175a1
{
"error": null,
"id": null,
"result": {
"amount": "0.00000000",
"blocktime": 1422917758,
"confirmations": 1,
"divisible": true,
"fee": 4.5e-05,
"ismine": false,
"propertyid": 0,
"sendingaddress": "mfmGJgiyX2W43ykhZzP2DgA782L9vKRGeC",
"txid": "0a7a3e6165a5d17be55214a3967834d0537cadb03cf8a840a3e3b6ea315175a1",
"type": "Change Issuer Address",
"type_int": 70,
"valid": true,
"version": 0
}
}

Discovered during Grant/Revoke/Tx70 testing https://docs.google.com/a/mastercoin.org/spreadsheets/d/1_DZ_sO2q9y2E5xmkVrqs2gkMjPER-awf7xV2tDt4U84/edit#gid=0

@achamely achamely added the bug label Feb 2, 2015
@zathras-crypto
Copy link

First issue, missing ref address - seems like the showReference bool wasn't added with the case:

                        case MSC_TYPE_GRANT_PROPERTY_TOKENS:
                             if (0 == mp_obj.step2_Value())
                             {
                                showReference = true;
                                propertyId = mp_obj.getProperty();
                                amount = mp_obj.getAmount();
                             }
                        break;
                        case MSC_TYPE_REVOKE_PROPERTY_TOKENS:
                             if (0 == mp_obj.step2_Value())
                             {
                                propertyId = mp_obj.getProperty();
                                amount = mp_obj.getAmount();
                             }
                        break;

Second issue (property ID zero) means that step2_Value is not allowing getProperty() to get the right detail - I didn't write grants/revokes so I'll need to dive into that. Leave it with me :)

Thanks
Z

@zathras-crypto
Copy link

Quick Q - in your mastercore output above, you have:

"fee": 4.5e-05,

Is there some interpretation layer there between what was returned and what you pasted? We shouldn't be passing out fees (from mastercore) formatted like that.

EDIT: I get "fee" : 0.00004500, for that tx.

@zathras-crypto
Copy link

Also, ignore my comment above re the missing showReference bool - that's quoting the revoke case - think I'm losing my mind!

Anyway, the actual issue is that there is no CASE for populateRPCTransactionObject whatsoever for the Change Issuer transaction, thus it's left to defaults. I'll add a CASE for this to 0.0.9.1.

@zathras-crypto
Copy link

That's better :)

zathras@coredev01:~/github/build/mastercore$ src/mastercored gettransaction_MP 0a7a3e6165a5d17be55214a3967834d0537cadb03cf8a840a3e3b6ea315175a1
{
    "txid" : "0a7a3e6165a5d17be55214a3967834d0537cadb03cf8a840a3e3b6ea315175a1",
    "sendingaddress" : "mfmGJgiyX2W43ykhZzP2DgA782L9vKRGeC",
    "referenceaddress" : "n1NZHR8pmp1mQWKxJ7LvgDqLkwT4P6cept",
    "ismine" : false,
    "confirmations" : 15,
    "fee" : 0.00004500,
    "blocktime" : 1422917758,
    "version" : 0,
    "type_int" : 70,
    "type" : "Change Issuer Address",
    "propertyid" : 2147483674,
    "divisible" : true,
    "amount" : "0.00000000",
    "valid" : true
}

@zathras-crypto
Copy link

#281

@achamely
Copy link
Author

achamely commented Feb 3, 2015

Thanks Z, i'm rebuilding now. Yes in my previous output that was from a python interpreter

@achamely
Copy link
Author

achamely commented Feb 3, 2015

@zathras-crypto this is pushed to the 0.0.9 branch i see. Shouldn't it also be pushed to 0.0.10 for consistency?

@zathras-crypto
Copy link

Yes it should - great spot - thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants