Conversation
5a4ac52 to
3948b27
Compare
I definitely agree with this.
This I don't entirely agree with. I prefer to use as little primitive types as possible, so I'd rather we didn't just pass a I prefer an approach where we keep the type definition on the rust side (whether that's extension Display on ApiAmount {
String asBtc() { ... }
String asSatoshis() { ... }
} |
|
Yeah I made some back and forth around As far as I understand the main raison d'être of |
3948b27 to
5c6a926
Compare
|
(rebased on top of dev) |
|
Moved the fiat currency commit into a new PR #306 as I think that |
|
Superseded by #307, closing |
When discussing #288 it appeared that we are using the rust library for
FiatCurrencyand bitcoin amount formatting. I think it's improper, doesn't respect separation of concerns, and make the changes proposed in #288 harder to implement.This PR:
FiatCurrencyfrom the rust library, and recreate it inlib/modelsApiAmount, which was just a wrapper around rust-bitcoinAmounttypeApiAmountin the rust library with u64BtcAmountforBigIntin dart, and uses type extension to implement proper display for amountsThe change for
FiatCurrencywas extremely simple, and I think that piece of code makes so much more sense in dart than in rust.ApiAmountwas a little harder to remove but in the end I think it's better this way too, and it should make the change proposed in #288 really simple to implement.