-
Notifications
You must be signed in to change notification settings - Fork 106
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
[bug]: Minting a normal asset with --decimal_display does not yield expected results #972
Comments
The bit with block height displayed as 0 has come up in the Slack as a surprise + issue that requires user workarounds. |
Looks like this is from not having any metadata set for this mint call; I assumed that a caller setting a decimal display would also include some other metadata. If no metadata exsists we end up skipping the logic to add the decimal display. IMO the correct behavior here is to have the |
Classic user error! I first tried adding metadata with the |
Hmm, adding metadata should have been allowed? If it was JSON, then decimal display should get added to that. |
This is the error I run into for the command:
|
@jharveyb so we should be assuming that if decimal display is set, then we use the json meta type. |
@Liongrass do things work if you add |
I wasn't able to set |
Quick tools to encode & decode JSON to hex. Encode:
Decode:
|
Hm I was using a tool similar to this, but my main question is whether I have to pass the hex encoded string to tapd or the raw string. I tried with the hex encoded string first and got an error, but roasbeef instructed me to use the raw string |
Ah true, I forgot that tapd will encode it to bytes internally. I guess with this you could decode JSON for an already minted asset. |
Background
I minted a new asset with the flag:
--decimal-display 3
but the created asset shows"decimal_display": 0
Your environment
litd integrated mode
branch:
0-19-staging
commit:
fa32097a4d0deee7e84872690194d18f108cf5a5
Steps to reproduce
Command used:
tapcli --tlscertpath ~/.lit/tls.cert --rpcserver=localhost:8443 --network=testnet assets mint --type normal --name beefbux --supply 1000000 --decimal_display 3 --new_grouped_asset --meta_type json
tapcli assets mint finalize
Expected behavior
When running
tapcli assets list
, I expect to see the asset with its defined decimal display.Actual behavior
The minted asset appears to have its decimal display set to 0:
Maybe unrelated, but I also don't understand why the block height appears to be zero (and the block hash is empty). The minting transaction had over 2000 confirmations at the time when I pulled the above data: f939a83cf71a7d8d743a989e81ad9c292f4e6c4f7c3bc5639313cd1739a15363
The text was updated successfully, but these errors were encountered: