Merge branch 'main' into CW-252-Add-notice-when-connecting-to-.onion-node

This commit is contained in:
Serhii 2023-01-05 13:05:58 +02:00
commit 9d03330086
5 changed files with 29 additions and 17 deletions

View file

@ -72,7 +72,7 @@ abstract class ElectrumTransactionHistoryBase
txs.entries.forEach((entry) {
final val = entry.value;
if (val is Map<String, Object>) {
if (val is Map<String, dynamic>) {
final tx = ElectrumTransactionInfo.fromJson(val, walletInfo.type);
_updateOrInsert(tx);
}
@ -85,9 +85,6 @@ abstract class ElectrumTransactionHistoryBase
}
void _updateOrInsert(ElectrumTransactionInfo transaction) {
if (transaction.id == null) {
return;
}
if (transactions[transaction.id] == null) {
transactions[transaction.id] = transaction;
@ -98,6 +95,7 @@ abstract class ElectrumTransactionHistoryBase
originalTx?.height = transaction.height;
originalTx?.date ??= transaction.date;
originalTx?.isPending = transaction.isPending;
originalTx?.direction = transaction.direction;
}
}
}

View file

@ -228,9 +228,7 @@ class ElectrumTransactionInfo extends TransactionInfo {
m['id'] = id;
m['height'] = height;
m['amount'] = amount;
// FIX-ME: Hardcoded value
// m['direction'] = direction.index;
m['direction'] = 0;
m['direction'] = direction.index;
m['date'] = date.millisecondsSinceEpoch;
m['isPending'] = isPending;
m['confirmations'] = confirmations;

View file

@ -67,6 +67,22 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
CryptoCurrency.stx,
];
static const havenCurrencies = [
xag,
xau,
xaud,
xbtc,
xcad,
xchf,
xcny,
xeur,
xgbp,
xjpy,
xnok,
xnzd,
xusd,
];
static const xmr = CryptoCurrency(title: 'XMR', iconPath: 'assets/images/monero_icon.png', fullName: 'Monero', raw: 0, name: 'xmr');
static const ada = CryptoCurrency(title: 'ADA', iconPath: 'assets/images/ada_icon.png', fullName: 'Cardano', raw: 1, name: 'ada');
static const bch = CryptoCurrency(title: 'BCH', iconPath: 'assets/images/bch_icon.png',fullName: 'Bitcoin Cash', raw: 2, name: 'bch');
@ -134,16 +150,16 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
static const stx = CryptoCurrency(title: 'STX', iconPath: 'assets/images/stx_icon.png', raw: 61, name: 'stx');
static final Map<int, CryptoCurrency> _rawCurrencyMap =
all.fold<Map<int, CryptoCurrency>>(<int, CryptoCurrency>{}, (acc, item) {
acc.addAll({item.raw: item});
return acc;
});
[...all, ...havenCurrencies].fold<Map<int, CryptoCurrency>>(<int, CryptoCurrency>{}, (acc, item) {
acc.addAll({item.raw: item});
return acc;
});
static final Map<String, CryptoCurrency> _nameCurrencyMap =
all.fold<Map<String, CryptoCurrency>>(<String, CryptoCurrency>{}, (acc, item) {
acc.addAll({item.name: item});
return acc;
});
[...all, ...havenCurrencies].fold<Map<String, CryptoCurrency>>(<String, CryptoCurrency>{}, (acc, item) {
acc.addAll({item.name: item});
return acc;
});
static CryptoCurrency deserialize({required int raw}) {

View file

@ -1,7 +1,7 @@
#!/bin/sh
. ./config.sh
HAVEN_VERSION=tags/v2.2.2
HAVEN_VERSION=tags/v3.0.0
HAVEN_SRC_DIR=${WORKDIR}/haven
git clone https://github.com/haven-protocol-org/haven-main.git ${HAVEN_SRC_DIR}

View file

@ -4,7 +4,7 @@
HAVEN_URL="https://github.com/haven-protocol-org/haven-main.git"
HAVEN_DIR_PATH="${EXTERNAL_IOS_SOURCE_DIR}/haven"
HAVEN_VERSION=tags/v2.2.2
HAVEN_VERSION=tags/v3.0.0
BUILD_TYPE=release
PREFIX=${EXTERNAL_IOS_DIR}
DEST_LIB_DIR=${EXTERNAL_IOS_LIB_DIR}/haven