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

nigiri mint not always returning object keys in same order #114

Open
Janaka-Steph opened this issue Mar 2, 2021 · 2 comments
Open

nigiri mint not always returning object keys in same order #114

Janaka-Steph opened this issue Mar 2, 2021 · 2 comments

Comments

@Janaka-Steph
Copy link
Contributor

Example

$ nigiri mint $(nigiri rpc --liquid getnewaddress) 100000 A Aaa
asset: 9ea078c11a20f0d9494bc75548d0b7125605e5a5fca8ec372106c2275b159091
issuance_txin:
  txid: 859c1dd51e7c82fc53415cc31d14e903e7fbe8966c4a5fc5bd41bfc95a22224e
  vin: 0
txId: 2466c0bde0df998fda2f74ff5f671f90db45cc74281452aaff2750a3523e37fd
$ nigiri mint $(nigiri rpc --liquid getnewaddress) 100000 A Aaa
issuance_txin:
  txid: f8a8b14ce9b9799ec3efa277e5987fa9a1127420ed6e5680aef6d5aa853b3df1
  vin: 0
txId: b640c1d6a467812849d54787037c51ee28df42a684abba28ede68fbbd0762e04
asset: fd192a7f3884c7d0ee18afa3529a2019d2b77e5b63ea13c9b2e78e0e77395466

This is annoying when command is used in bash script.

@louisinger
Copy link
Contributor

I encountered the same problem: I used this command --> shitcoin=$(nigiri mint $addressmarket 100 | grep '^asset: ' | cut -d ':' -f 2 | tr -d ' ')

@tiero
Copy link
Member

tiero commented Mar 3, 2021

That's because we unmarshal the returning JSON (from chopsticks endpoint) in a golang map[string]interface{} which namely do not maintain order of keys.

Would be maybe easier to just return the asset hash information in the nigiri mint command

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

No branches or pull requests

3 participants