eoscanada / eosc

Cross-platform EOSIO command-line swiss-army-knife (EOS, BOS, Telos, Worbli, etc.)
https://eosc.app
MIT License
134 stars 59 forks source link

Allow delegatebw/undelegatebw with no-native EOS blockchain #114

Closed DenisCarriere closed 5 years ago

DenisCarriere commented 5 years ago
$ eosc -u http://<API> system delegatebw <ACCOUNT> <ACCOUNT> "10.0000 SYS" "10.0000 SYS"
ERROR: "network bw stake qty" invalid: EOS has only 4 decimals
abourget commented 5 years ago

I think the best solution to this would be to default all asset fields to EOS with precision=4 unless the symbol is specified.

Right now, we have two funcs: NewEOSAssetFromString and NewAsset. We'd need a third one: NewEOSDefaultAsset() or something.

Specifying 2.5 would mean 2.5000 EOS, whereas specifying 2.5 EOS would mean specifying an amount of 25 with a precision of 1 and the symbol name EOS (which isn't compatible with the native mainnet token).

Would that work?

abourget commented 5 years ago

Fixed in 9821c71e36a0cff82821a9842459373ba6c98c24 .. we'll release some time soon

DenisCarriere commented 5 years ago

I believe so, as long as "EOS" is not hardcoded and it can be modified somehow by the user settings or auto-detected by eosc