mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-22 06:28:39 +02:00
feat: migrate Trade data to SQLite with TradeLegacy for backward compatibility (#3106)
* feat: migrate Trade data to SQLite with TradeLegacy for backward compatibility * feat: persist full currency snapshots in sql storage, not raw-only [WIP] * feat: persist full trade currency snapshots in sql storage * refactor trade and currency handling for migration * Minor fixes --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Omar Hatem
parent
813aa348bc
commit
9f6396f5d8
@@ -166,9 +166,9 @@ class TransactionsPage extends StatelessWidget {
|
||||
final trade = item.trade;
|
||||
|
||||
final tradeFrom =
|
||||
trade.fromRaw >= 0 ? trade.from : trade.userCurrencyFrom;
|
||||
trade.from;
|
||||
|
||||
final tradeTo = trade.toRaw >= 0 ? trade.to : trade.userCurrencyTo;
|
||||
final tradeTo = trade.to;
|
||||
|
||||
return tradeFrom != null && tradeTo != null
|
||||
? Observer(
|
||||
|
||||
@@ -31,7 +31,7 @@ void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext
|
||||
final trade = exchangeTradeViewModel.trade;
|
||||
final walletName = exchangeTradeViewModel.wallet.name;
|
||||
|
||||
final from = trade.from?.toString() ?? trade.userCurrencyFrom.toString();
|
||||
final from = trade.from?.toString() ?? '';
|
||||
|
||||
final information = exchangeTradeViewModel.isSendable
|
||||
? S.current.exchange_trade_result_confirm(trade.amount, from, walletName) +
|
||||
|
||||
@@ -319,14 +319,14 @@ class _SwapDetailsContent extends StatelessWidget {
|
||||
_SwapDetailsTile(
|
||||
label: 'You Send',
|
||||
value:
|
||||
'${trade.amount} ${trade.from?.title ?? trade.userCurrencyFrom?.title ?? ''}',
|
||||
'${trade.amount} ${trade.from?.title ?? ''}',
|
||||
valueFiatFormatted: exchangeTradeViewModel.sendAmountFiatFormatted,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
_SwapDetailsTile(
|
||||
label: 'You Get',
|
||||
value:
|
||||
'${trade.receiveAmount ?? '0'} ${trade.to?.title ?? trade.userCurrencyTo?.title ?? ''}',
|
||||
'${trade.receiveAmount ?? '0'} ${trade.to?.title ?? ''}',
|
||||
valueFiatFormatted: exchangeTradeViewModel
|
||||
.getReceiveAmountFiatFormatted(trade.receiveAmount ?? '0.0'),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user