From 22cf5ca08b924b135595a5c2ef066a8cff97a770 Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Tue, 4 Feb 2020 18:47:42 +0200 Subject: [PATCH] CWA-169 | got hive box as dependency for MorphTokenExchangeProvider class, removed extraId from Trade --- .../exchange/morphtoken/morphtoken_exchange_provider.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart b/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart index 5b9cdf08f..363f37ba4 100644 --- a/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart +++ b/lib/src/domain/exchange/morphtoken/morphtoken_exchange_provider.dart @@ -55,6 +55,8 @@ class MorphTokenExchangeProvider extends ExchangeProvider { ExchangePair(from: CryptoCurrency.btc, to: CryptoCurrency.xmr), ]); + final trades = Hive.box(Trade.boxName); + static const apiUri = 'https://api.morphtoken.com'; static const _morphURISuffix = '/morph'; static const _limitsURISuffix = '/limits'; @@ -158,11 +160,10 @@ class MorphTokenExchangeProvider extends ExchangeProvider { final to = CryptoCurrency.fromString(toCurrency); final inputAddress = responseJSON['input']['refund_address'] as String; final status = responseJSON['state'] as String; - final state = TradeState.deserialize(raw: status); + final state = TradeState.deserialize(raw: status.toLowerCase()); String amount = ""; - final trades = Hive.box(Trade.boxName).values; - for (final trade in trades) { + for (final trade in trades.values) { if (trade.id == id) { amount = trade.amount; break; @@ -177,7 +178,6 @@ class MorphTokenExchangeProvider extends ExchangeProvider { inputAddress: inputAddress, amount: amount, state: state, - extraId: null, outputTransaction: null); }