WIP: Convert min stake and max stake values in zwalletcli to ZCN ,mZCN and other formats
- Dominant language
- Go
- Stars
- 21
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
Hello @vudn95 here is a sample output for `./zwallet mn-info` command.
```
{
"simple_miner":{
"id":"110b07984a6592ae67f1830366f47c835f6f5f262be19ee4aedd1b9acf870aee",
"n2n_host":"five.devnet-0chain.net",
"host":"five.devnet-0chain.net",
"port":31202,
"path":"miner02",
"public_key":"7f7a0515ae68eadee6eac5915519802911c7c7341d1ef23d913728aed47dc8090548a56031732d16916e203c4e41c2a32d022fe56758ba3956cc73b112f0961c",
"short_name":"localhost.m02",
"build_tag":"40058cb8b6aeeb95e61229702f29de4c7118ebaf",
"total_stake":0,
"delegate_wallet":"110b07984a6592ae67f1830366f47c835f6f5f262be19ee4aedd1b9acf870aee",
"service_charge":0.1,
"number_of_delegates":10,
"min_stake":0,
"max_stake":1000000000000,
"stat":{
"generator_rewards":187795440000000
},
"node_type":"miner",
"last_health_check":1620947267
}
}
Here min_stake and max_stake values have to be converted into ZCN and other formats
Also, in any other places or responses or flags in zwalletcli where these value types are used,they have to be converted to ZCN and other formats.
the value conversion table is as follows:
1 ZCN = 1,000 mZCN = 1,000,000 µZCN
0.1 ZCN = 100 mZCN = 100,000 µZCN
0.01 ZCN = 10 mZCN = 10,000 µZCN
0.001 ZCN = 1 mZCN = 1,000 µZCN
0.0001 ZCN = 0.1 mZCN = 100 µZCN
0.00001 ZCN = 0.01 mZCN = 10 µZCN
0.000001 ZCN = 0.001 mZCN = 1 µZCN
0.0000001 ZCN = 0.0001 mZCN = 0.1 µZCN
0.00000001 ZCN = 0.00001 mZCN = 0.01 µZCN
0.000000001 ZCN = 0.000001 mZCN = 0.001 µZCN
0.0000000001 ZCN = 0.0000001 mZCN = 0.0001 µZCN = 1 sas (Saswata, smallest unit, nickname) (edited)
Contributor guide
No contributing guide indexed for this repository
Research direction
Look at the zwalletcli codebase for where min_stake and max_stake values are displayed, such as in the mn-info command output. Identify the data structures and formatting functions. Implement a conversion function that transforms the raw integer values into ZCN, mZCN, and µZCN formats based on the provided conversion table. Test by running the zwalletcli commands to ensure the new formats appear correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain, cli
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100