solana-labs / solana-program-library

A collection of Solana programs maintained by Solana Labs
https://solanalabs.com
Apache License 2.0
3.44k stars 2.02k forks source link

token-cli: when using spl-token --output json-compact key fields are missing #2343

Closed mectors closed 2 weeks ago

mectors commented 3 years ago

When using spl-token create-multisig for instance the normal output is: Creating 2/2 multisig 8MGCFELN4fm4UqtEmTcUzfDgew41WxEp1SGVPySaRduH

Signature: sNBhtcns5EfSYAxE8GXEuFdroPCejS8YBYks1EijpuyfUd8iNLvUoE4VYC8bywUzMFrkBJSzL9t6eHcYBRVZHTf

But when using --output json-compact the output is: {"signature":"TqyHw6fwZBSAe9ZUKhJXSDe9QpR9R54iXpsJnxxZr7Ba7WFPaeCi3ocxEA5JUAGXaSkzmeQC7K7PcdP4fc2o1Dv"} The multisig account is missing in the JSON output which makes spl-token create-multisig [and other options which also do not include the key info] unusable in scripts, e.g. you cannot do | jq -r '.multisig' and you are forced to start parsing the normal output with sed/awk/... which is error prone.

atharmohammad commented 2 years ago

Working in the current master branch ,so looks like this issue is already resolved and can be closed. :) res

joncinque commented 2 years ago

Oops, sorry -- this is still an issue:

$ spl-token create-multisig 1 ~/test.json --output json
{
  "signature": "3G9qrSsJqrRcQCm2FC4qfLCpKGdASGWG5vcM4nJbPts5bj7KUHBDsVZARjLBkg8Y6Wx3jhgkLe6iDCupq5cNk7ZC"
}
atharmohammad commented 2 years ago

create-multisig 1 ~/test.json --output json

sorry! didn't check for other commands , looks like format_output is used in case of create-token to format the additional information beside signature