Skip to content

Don't allow to pass multiple times the same pubkey to the balance command

When requesting balance for many pubkeys, if the user makes a mistake and asks many times for the same pubkey, Silkaj adds this pubkey's balance many times. Example :

silkaj -gt balance d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN:FVm AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK:CWj 
╒══════════════════════════════╤═════════════════════════════════════════════════╕
│ Balance of pubkey            │ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN:FVm │
├──────────────────────────────┼─────────────────────────────────────────────────┤
│ Total amount (unit|relative) │ 2863602.0 ĞTest | 145.43 UD ĞTest               │
├──────────────────────────────┼─────────────────────────────────────────────────┤
│ Total relative to M/N        │ 1.22 x M/N                                      │
╘══════════════════════════════╧═════════════════════════════════════════════════╛
╒══════════════════════════════╤═════════════════════════════════════════════════╕
│ Balance of pubkey            │ d88fPFbDdJXJANHH7hedFMaRyGcnVZj9c5cDaE76LRN:FVm │
├──────────────────────────────┼─────────────────────────────────────────────────┤
│ Total amount (unit|relative) │ 2863602.0 ĞTest | 145.43 UD ĞTest               │
├──────────────────────────────┼─────────────────────────────────────────────────┤
│ Total relative to M/N        │ 1.22 x M/N                                      │
╘══════════════════════════════╧═════════════════════════════════════════════════╛
╒══════════════════════════════╤══════════════════════════════════════════════════╕
│ Balance of pubkey            │ AhRMHUxMPXSeG7qXZrE6qCdjwK9p2bu5Eqei7xAWVEDK:CWj │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Total amount (unit|relative) │ 28990.75 ĞTest | 1.47 UD ĞTest                   │
├──────────────────────────────┼──────────────────────────────────────────────────┤
│ Total relative to M/N        │ 0.01 x M/N                                       │
╘══════════════════════════════╧══════════════════════════════════════════════════╛
╒══════════════════════════════╤════════════════════════════════════╕
│ Balance of pubkey            │ Total                              │
├──────────────────────────────┼────────────────────────────────────┤
│ Total amount (unit|relative) │ 5756194.75 ĞTest | 292.34 UD ĞTest │
├──────────────────────────────┼────────────────────────────────────┤
│ Total relative to M/N        │ 2.44 x M/N                         │
╘══════════════════════════════╧════════════════════════════════════╛
Edited by Moul
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information