mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-12 09:27:01 +00:00
coin tests code error cleanup
This commit is contained in:
parent
35f6ffd4fc
commit
722a884553
7 changed files with 106 additions and 164 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -55,3 +55,4 @@ libcw_monero.dll
|
||||||
libcw_wownero.dll
|
libcw_wownero.dll
|
||||||
libepic_cash_wallet.dll
|
libepic_cash_wallet.dll
|
||||||
libmobileliblelantus.dll
|
libmobileliblelantus.dll
|
||||||
|
/libisar.so
|
||||||
|
|
|
@ -8,9 +8,9 @@ import 'package:mockito/annotations.dart';
|
||||||
import 'package:mockito/mockito.dart';
|
import 'package:mockito/mockito.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
||||||
|
import 'package:stackwallet/hive/db.dart';
|
||||||
|
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||||
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
||||||
import 'package:stackwallet/models/paymint/transactions_model.dart';
|
|
||||||
import 'package:stackwallet/models/paymint/utxo_model.dart';
|
|
||||||
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart';
|
||||||
import 'package:stackwallet/services/price.dart';
|
import 'package:stackwallet/services/price.dart';
|
||||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||||
|
@ -612,18 +612,6 @@ void main() async {
|
||||||
if (!hiveAdaptersRegistered) {
|
if (!hiveAdaptersRegistered) {
|
||||||
hiveAdaptersRegistered = true;
|
hiveAdaptersRegistered = true;
|
||||||
|
|
||||||
// Registering Transaction Model Adapters
|
|
||||||
Hive.registerAdapter(TransactionDataAdapter());
|
|
||||||
Hive.registerAdapter(TransactionChunkAdapter());
|
|
||||||
Hive.registerAdapter(TransactionAdapter());
|
|
||||||
Hive.registerAdapter(InputAdapter());
|
|
||||||
Hive.registerAdapter(OutputAdapter());
|
|
||||||
|
|
||||||
// Registering Utxo Model Adapters
|
|
||||||
Hive.registerAdapter(UtxoDataAdapter());
|
|
||||||
Hive.registerAdapter(UtxoObjectAdapter());
|
|
||||||
Hive.registerAdapter(StatusAdapter());
|
|
||||||
|
|
||||||
final wallets = await Hive.openBox<dynamic>('wallets');
|
final wallets = await Hive.openBox<dynamic>('wallets');
|
||||||
await wallets.put('currentWalletName', testWalletName);
|
await wallets.put('currentWalletName', testWalletName);
|
||||||
}
|
}
|
||||||
|
@ -1295,50 +1283,48 @@ void main() async {
|
||||||
//
|
//
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// test("get utxos fails", () async {
|
test("get utxos fails", () async {
|
||||||
// btc = BitcoinWallet(
|
btc = BitcoinWallet(
|
||||||
// walletId: testWalletId,
|
walletId: testWalletId,
|
||||||
// walletName: testWalletName,
|
walletName: testWalletName,
|
||||||
// coin: Coin.bitcoinTestNet,
|
coin: Coin.bitcoinTestNet,
|
||||||
// client: client!,
|
client: client!,
|
||||||
// cachedClient: cachedClient!,
|
cachedClient: cachedClient!,
|
||||||
// tracker: tracker!,
|
tracker: tracker!,
|
||||||
//
|
secureStore: secureStore,
|
||||||
// secureStore: secureStore,
|
);
|
||||||
// );
|
when(client?.ping()).thenAnswer((_) async => true);
|
||||||
// when(client?.ping()).thenAnswer((_) async => true);
|
when(client?.getServerFeatures()).thenAnswer((_) async => {
|
||||||
// when(client?.getServerFeatures()).thenAnswer((_) async => {
|
"hosts": <dynamic, dynamic>{},
|
||||||
// "hosts": <dynamic, dynamic>{},
|
"pruning": null,
|
||||||
// "pruning": null,
|
"server_version": "Unit tests",
|
||||||
// "server_version": "Unit tests",
|
"protocol_min": "1.4",
|
||||||
// "protocol_min": "1.4",
|
"protocol_max": "1.4.2",
|
||||||
// "protocol_max": "1.4.2",
|
"genesis_hash": GENESIS_HASH_TESTNET,
|
||||||
// "genesis_hash": GENESIS_HASH_TESTNET,
|
"hash_function": "sha256",
|
||||||
// "hash_function": "sha256",
|
"services": <dynamic>[]
|
||||||
// "services": <dynamic>[]
|
});
|
||||||
// });
|
|
||||||
//
|
await Hive.openBox<dynamic>(testWalletId);
|
||||||
// when(client?.getBatchUTXOs(args: anyNamed("args")))
|
await Hive.openBox<dynamic>(DB.boxNamePrefs);
|
||||||
// .thenThrow(Exception("some exception"));
|
|
||||||
//
|
when(client?.getBatchUTXOs(args: anyNamed("args")))
|
||||||
// await btc?.initializeWallet();
|
.thenThrow(Exception("some exception"));
|
||||||
// final utxoData = await btc?.utxoData;
|
|
||||||
// expect(utxoData, isA<UtxoData>());
|
await btc?.initializeNew();
|
||||||
// expect(utxoData.toString(),
|
await btc?.initializeExisting();
|
||||||
// r"{totalUserCurrency: $0.00, satoshiBalance: 0, bitcoinBalance: 0, unspentOutputArray: []}");
|
|
||||||
//
|
final outputs = await btc!.utxos;
|
||||||
// final outputs = await btc?.unspentOutputs;
|
expect(outputs, isA<List<UTXO>>());
|
||||||
// expect(outputs, isA<List<UtxoObject>>());
|
expect(outputs.length, 0);
|
||||||
// expect(outputs?.length, 0);
|
|
||||||
//
|
verify(client?.ping()).called(1);
|
||||||
// verify(client?.ping()).called(1);
|
verify(client?.getServerFeatures()).called(1);
|
||||||
// verify(client?.getServerFeatures()).called(1);
|
verify(client?.getBatchUTXOs(args: anyNamed("args"))).called(1);
|
||||||
// verify(client?.getBatchUTXOs(args: anyNamed("args"))).called(1);
|
|
||||||
//
|
verifyNoMoreInteractions(client);
|
||||||
// verifyNoMoreInteractions(client);
|
verifyNoMoreInteractions(cachedClient);
|
||||||
// verifyNoMoreInteractions(cachedClient);
|
});
|
||||||
//
|
|
||||||
// });
|
|
||||||
//
|
//
|
||||||
// test("chain height fetch, update, and get", () async {
|
// test("chain height fetch, update, and get", () async {
|
||||||
// btc = BitcoinWallet(
|
// btc = BitcoinWallet(
|
||||||
|
|
|
@ -2,14 +2,14 @@ import 'package:decimal/decimal.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:hive_test/hive_test.dart';
|
import 'package:hive_test/hive_test.dart';
|
||||||
|
import 'package:isar/isar.dart';
|
||||||
import 'package:mockito/annotations.dart';
|
import 'package:mockito/annotations.dart';
|
||||||
import 'package:mockito/mockito.dart';
|
import 'package:mockito/mockito.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
||||||
import 'package:stackwallet/hive/db.dart';
|
import 'package:stackwallet/hive/db.dart';
|
||||||
|
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||||
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
||||||
import 'package:stackwallet/models/paymint/transactions_model.dart';
|
|
||||||
import 'package:stackwallet/models/paymint/utxo_model.dart';
|
|
||||||
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
|
import 'package:stackwallet/services/coins/bitcoincash/bitcoincash_wallet.dart';
|
||||||
import 'package:stackwallet/services/price.dart';
|
import 'package:stackwallet/services/price.dart';
|
||||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||||
|
@ -22,7 +22,9 @@ import 'bitcoincash_wallet_test_parameters.dart';
|
||||||
|
|
||||||
@GenerateMocks(
|
@GenerateMocks(
|
||||||
[ElectrumX, CachedElectrumX, PriceAPI, TransactionNotificationTracker])
|
[ElectrumX, CachedElectrumX, PriceAPI, TransactionNotificationTracker])
|
||||||
void main() {
|
void main() async {
|
||||||
|
await Isar.initializeIsarCore(download: true);
|
||||||
|
|
||||||
group("bitcoincash constants", () {
|
group("bitcoincash constants", () {
|
||||||
test("bitcoincash minimum confirmations", () async {
|
test("bitcoincash minimum confirmations", () async {
|
||||||
expect(MINIMUM_CONFIRMATIONS, 1);
|
expect(MINIMUM_CONFIRMATIONS, 1);
|
||||||
|
@ -580,18 +582,6 @@ void main() {
|
||||||
if (!hiveAdaptersRegistered) {
|
if (!hiveAdaptersRegistered) {
|
||||||
hiveAdaptersRegistered = true;
|
hiveAdaptersRegistered = true;
|
||||||
|
|
||||||
// Registering Transaction Model Adapters
|
|
||||||
Hive.registerAdapter(TransactionDataAdapter());
|
|
||||||
Hive.registerAdapter(TransactionChunkAdapter());
|
|
||||||
Hive.registerAdapter(TransactionAdapter());
|
|
||||||
Hive.registerAdapter(InputAdapter());
|
|
||||||
Hive.registerAdapter(OutputAdapter());
|
|
||||||
|
|
||||||
// Registering Utxo Model Adapters
|
|
||||||
Hive.registerAdapter(UtxoDataAdapter());
|
|
||||||
Hive.registerAdapter(UtxoObjectAdapter());
|
|
||||||
Hive.registerAdapter(StatusAdapter());
|
|
||||||
|
|
||||||
final wallets = await Hive.openBox<dynamic>('wallets');
|
final wallets = await Hive.openBox<dynamic>('wallets');
|
||||||
await wallets.put('currentWalletName', testWalletName);
|
await wallets.put('currentWalletName', testWalletName);
|
||||||
}
|
}
|
||||||
|
@ -1162,14 +1152,9 @@ void main() {
|
||||||
await bch?.initializeNew();
|
await bch?.initializeNew();
|
||||||
await bch?.initializeExisting();
|
await bch?.initializeExisting();
|
||||||
|
|
||||||
final utxoData = await bch?.utxoData;
|
final outputs = await bch!.utxos;
|
||||||
expect(utxoData, isA<UtxoData>());
|
expect(outputs, isA<List<UTXO>>());
|
||||||
expect(utxoData.toString(),
|
expect(outputs.length, 0);
|
||||||
r"{totalUserCurrency: 0.00, satoshiBalance: 0, bitcoinBalance: 0, unspentOutputArray: []}");
|
|
||||||
|
|
||||||
final outputs = await bch?.unspentOutputs;
|
|
||||||
expect(outputs, isA<List<UtxoObject>>());
|
|
||||||
expect(outputs?.length, 0);
|
|
||||||
|
|
||||||
verifyNever(client?.ping()).called(0);
|
verifyNever(client?.ping()).called(0);
|
||||||
verify(client?.getServerFeatures()).called(1);
|
verify(client?.getServerFeatures()).called(1);
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// import 'dart:typed_data';
|
|
||||||
|
|
||||||
import 'package:bitcoindart/bitcoindart.dart';
|
import 'package:bitcoindart/bitcoindart.dart';
|
||||||
import 'package:decimal/decimal.dart';
|
import 'package:decimal/decimal.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
@ -10,9 +8,8 @@ import 'package:mockito/mockito.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
||||||
import 'package:stackwallet/hive/db.dart';
|
import 'package:stackwallet/hive/db.dart';
|
||||||
|
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||||
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
||||||
import 'package:stackwallet/models/paymint/transactions_model.dart';
|
|
||||||
import 'package:stackwallet/models/paymint/utxo_model.dart';
|
|
||||||
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/dogecoin/dogecoin_wallet.dart';
|
||||||
import 'package:stackwallet/services/price.dart';
|
import 'package:stackwallet/services/price.dart';
|
||||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||||
|
@ -473,18 +470,6 @@ void main() {
|
||||||
if (!hiveAdaptersRegistered) {
|
if (!hiveAdaptersRegistered) {
|
||||||
hiveAdaptersRegistered = true;
|
hiveAdaptersRegistered = true;
|
||||||
|
|
||||||
// Registering Transaction Model Adapters
|
|
||||||
Hive.registerAdapter(TransactionDataAdapter());
|
|
||||||
Hive.registerAdapter(TransactionChunkAdapter());
|
|
||||||
Hive.registerAdapter(TransactionAdapter());
|
|
||||||
Hive.registerAdapter(InputAdapter());
|
|
||||||
Hive.registerAdapter(OutputAdapter());
|
|
||||||
|
|
||||||
// Registering Utxo Model Adapters
|
|
||||||
Hive.registerAdapter(UtxoDataAdapter());
|
|
||||||
Hive.registerAdapter(UtxoObjectAdapter());
|
|
||||||
Hive.registerAdapter(StatusAdapter());
|
|
||||||
|
|
||||||
final wallets = await Hive.openBox<dynamic>('wallets');
|
final wallets = await Hive.openBox<dynamic>('wallets');
|
||||||
await wallets.put('currentWalletName', testWalletName);
|
await wallets.put('currentWalletName', testWalletName);
|
||||||
}
|
}
|
||||||
|
@ -1064,14 +1049,9 @@ void main() {
|
||||||
await doge?.initializeNew();
|
await doge?.initializeNew();
|
||||||
await doge?.initializeExisting();
|
await doge?.initializeExisting();
|
||||||
|
|
||||||
final utxoData = await doge?.utxoData;
|
final outputs = await doge!.utxos;
|
||||||
expect(utxoData, isA<UtxoData>());
|
expect(outputs, isA<List<UTXO>>());
|
||||||
expect(utxoData.toString(),
|
expect(outputs.length, 0);
|
||||||
r"{totalUserCurrency: 0.00, satoshiBalance: 0, bitcoinBalance: 0, unspentOutputArray: []}");
|
|
||||||
|
|
||||||
final outputs = await doge?.unspentOutputs;
|
|
||||||
expect(outputs, isA<List<UtxoObject>>());
|
|
||||||
expect(outputs?.length, 0);
|
|
||||||
|
|
||||||
verifyNever(client?.ping()).called(0);
|
verifyNever(client?.ping()).called(0);
|
||||||
verify(client?.getServerFeatures()).called(1);
|
verify(client?.getServerFeatures()).called(1);
|
||||||
|
|
|
@ -11,7 +11,11 @@ import 'package:mockito/annotations.dart';
|
||||||
import 'package:mockito/mockito.dart';
|
import 'package:mockito/mockito.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
||||||
import 'package:stackwallet/models/models.dart';
|
import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart';
|
||||||
|
import 'package:stackwallet/models/isar/models/blockchain_data/utxo.dart';
|
||||||
|
import 'package:stackwallet/models/lelantus_coin.dart';
|
||||||
|
import 'package:stackwallet/models/lelantus_fee_data.dart';
|
||||||
|
import 'package:stackwallet/models/paymint/transactions_model.dart' as old;
|
||||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||||
import 'package:stackwallet/services/price.dart';
|
import 'package:stackwallet/services/price.dart';
|
||||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||||
|
@ -41,7 +45,7 @@ void main() {
|
||||||
|
|
||||||
test("isolateRestore success", () async {
|
test("isolateRestore success", () async {
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumX();
|
||||||
final txData = TransactionData.fromJson(dateTimeChunksJson);
|
final txDataOLD = old.TransactionData.fromJson(dateTimeChunksJson);
|
||||||
final Map<dynamic, dynamic> setData = {};
|
final Map<dynamic, dynamic> setData = {};
|
||||||
setData[1] = GetAnonymitySetSampleData.data;
|
setData[1] = GetAnonymitySetSampleData.data;
|
||||||
final usedSerials = GetUsedSerialsSampleData.serials["serials"] as List;
|
final usedSerials = GetUsedSerialsSampleData.serials["serials"] as List;
|
||||||
|
@ -74,6 +78,34 @@ void main() {
|
||||||
firoNetwork,
|
firoNetwork,
|
||||||
);
|
);
|
||||||
const currentHeight = 100000000000;
|
const currentHeight = 100000000000;
|
||||||
|
|
||||||
|
final txData = txDataOLD
|
||||||
|
.getAllTransactions()
|
||||||
|
.values
|
||||||
|
.map(
|
||||||
|
(t) => Transaction(
|
||||||
|
walletId: "walletId",
|
||||||
|
txid: t.txid,
|
||||||
|
timestamp: t.timestamp,
|
||||||
|
type: t.txType == "Sent"
|
||||||
|
? TransactionType.outgoing
|
||||||
|
: TransactionType.incoming,
|
||||||
|
subType: t.subType == "mint"
|
||||||
|
? TransactionSubType.mint
|
||||||
|
: t.subType == "join"
|
||||||
|
? TransactionSubType.join
|
||||||
|
: TransactionSubType.none,
|
||||||
|
amount: t.amount,
|
||||||
|
fee: t.fees,
|
||||||
|
height: t.height,
|
||||||
|
isCancelled: t.isCancelled,
|
||||||
|
isLelantus: null,
|
||||||
|
slateId: t.slateId,
|
||||||
|
otherData: t.otherData,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
.toList();
|
||||||
|
|
||||||
final result = await staticProcessRestore(txData, message, currentHeight);
|
final result = await staticProcessRestore(txData, message, currentHeight);
|
||||||
|
|
||||||
expect(result, isA<Map<String, dynamic>>());
|
expect(result, isA<Map<String, dynamic>>());
|
||||||
|
@ -512,18 +544,6 @@ void main() {
|
||||||
if (!hiveAdaptersRegistered) {
|
if (!hiveAdaptersRegistered) {
|
||||||
hiveAdaptersRegistered = true;
|
hiveAdaptersRegistered = true;
|
||||||
|
|
||||||
// Registering Transaction Model Adapters
|
|
||||||
Hive.registerAdapter(TransactionDataAdapter());
|
|
||||||
Hive.registerAdapter(TransactionChunkAdapter());
|
|
||||||
Hive.registerAdapter(TransactionAdapter());
|
|
||||||
Hive.registerAdapter(InputAdapter());
|
|
||||||
Hive.registerAdapter(OutputAdapter());
|
|
||||||
|
|
||||||
// Registering Utxo Model Adapters
|
|
||||||
Hive.registerAdapter(UtxoDataAdapter());
|
|
||||||
Hive.registerAdapter(UtxoObjectAdapter());
|
|
||||||
Hive.registerAdapter(StatusAdapter());
|
|
||||||
|
|
||||||
// Registering Lelantus Model Adapters
|
// Registering Lelantus Model Adapters
|
||||||
Hive.registerAdapter(LelantusCoinAdapter());
|
Hive.registerAdapter(LelantusCoinAdapter());
|
||||||
}
|
}
|
||||||
|
@ -1181,21 +1201,19 @@ void main() {
|
||||||
const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
.setMockMethodCallHandler((methodCall) async => 'en_US');
|
.setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
|
|
||||||
List<UtxoObject> utxos = [
|
List<UTXO> utxos = [
|
||||||
UtxoObject(
|
UTXO(
|
||||||
txid: BuildMintTxTestParams.utxoInfo["txid"] as String,
|
txid: BuildMintTxTestParams.utxoInfo["txid"] as String,
|
||||||
vout: BuildMintTxTestParams.utxoInfo["vout"] as int,
|
vout: BuildMintTxTestParams.utxoInfo["vout"] as int,
|
||||||
value: BuildMintTxTestParams.utxoInfo["value"] as int,
|
value: BuildMintTxTestParams.utxoInfo["value"] as int,
|
||||||
txName: '',
|
|
||||||
status: Status(
|
|
||||||
confirmed: false,
|
|
||||||
blockHash: "",
|
|
||||||
blockHeight: -1,
|
|
||||||
blockTime: 42,
|
|
||||||
confirmations: 0),
|
|
||||||
isCoinbase: false,
|
isCoinbase: false,
|
||||||
blocked: false,
|
walletId: '',
|
||||||
fiatWorth: '',
|
name: '',
|
||||||
|
isBlocked: false,
|
||||||
|
blockedReason: '',
|
||||||
|
blockHash: '',
|
||||||
|
blockHeight: -1,
|
||||||
|
blockTime: 42,
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
const sats = 9658;
|
const sats = 9658;
|
||||||
|
@ -3023,7 +3041,7 @@ void main() {
|
||||||
expect(firo.balance.getTotal(), Decimal.parse("0.00021594"));
|
expect(firo.balance.getTotal(), Decimal.parse("0.00021594"));
|
||||||
});
|
});
|
||||||
|
|
||||||
test("get transactionData", () async {
|
test("get transactions", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumX();
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumX();
|
||||||
final secureStore = FakeSecureStorage();
|
final secureStore = FakeSecureStorage();
|
||||||
|
@ -3118,9 +3136,9 @@ void main() {
|
||||||
'receivingAddresses', RefreshTestParams.receivingAddresses);
|
'receivingAddresses', RefreshTestParams.receivingAddresses);
|
||||||
await wallet.put('changeAddresses', RefreshTestParams.changeAddresses);
|
await wallet.put('changeAddresses', RefreshTestParams.changeAddresses);
|
||||||
|
|
||||||
final txData = await firo.transactionData;
|
final txData = await firo.transactions;
|
||||||
|
|
||||||
expect(txData, isA<TransactionData>());
|
expect(txData, isA<List<Transaction>>());
|
||||||
|
|
||||||
// kill timer and listener
|
// kill timer and listener
|
||||||
await firo.exit();
|
await firo.exit();
|
||||||
|
|
|
@ -8,8 +8,6 @@ import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
||||||
import 'package:stackwallet/hive/db.dart';
|
import 'package:stackwallet/hive/db.dart';
|
||||||
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
||||||
import 'package:stackwallet/models/paymint/transactions_model.dart';
|
|
||||||
import 'package:stackwallet/models/paymint/utxo_model.dart';
|
|
||||||
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
import 'package:stackwallet/services/coins/namecoin/namecoin_wallet.dart';
|
||||||
import 'package:stackwallet/services/price.dart';
|
import 'package:stackwallet/services/price.dart';
|
||||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||||
|
@ -18,7 +16,6 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
|
||||||
|
|
||||||
import 'namecoin_history_sample_data.dart';
|
import 'namecoin_history_sample_data.dart';
|
||||||
import 'namecoin_transaction_data_samples.dart';
|
import 'namecoin_transaction_data_samples.dart';
|
||||||
import 'namecoin_utxo_sample_data.dart';
|
|
||||||
import 'namecoin_wallet_test.mocks.dart';
|
import 'namecoin_wallet_test.mocks.dart';
|
||||||
import 'namecoin_wallet_test_parameters.dart';
|
import 'namecoin_wallet_test_parameters.dart';
|
||||||
|
|
||||||
|
@ -442,18 +439,6 @@ void main() {
|
||||||
if (!hiveAdaptersRegistered) {
|
if (!hiveAdaptersRegistered) {
|
||||||
hiveAdaptersRegistered = true;
|
hiveAdaptersRegistered = true;
|
||||||
|
|
||||||
// Registering Transaction Model Adapters
|
|
||||||
Hive.registerAdapter(TransactionDataAdapter());
|
|
||||||
Hive.registerAdapter(TransactionChunkAdapter());
|
|
||||||
Hive.registerAdapter(TransactionAdapter());
|
|
||||||
Hive.registerAdapter(InputAdapter());
|
|
||||||
Hive.registerAdapter(OutputAdapter());
|
|
||||||
|
|
||||||
// Registering Utxo Model Adapters
|
|
||||||
Hive.registerAdapter(UtxoDataAdapter());
|
|
||||||
Hive.registerAdapter(UtxoObjectAdapter());
|
|
||||||
Hive.registerAdapter(StatusAdapter());
|
|
||||||
|
|
||||||
final wallets = await Hive.openBox<dynamic>('wallets');
|
final wallets = await Hive.openBox<dynamic>('wallets');
|
||||||
await wallets.put('currentWalletName', testWalletName);
|
await wallets.put('currentWalletName', testWalletName);
|
||||||
}
|
}
|
||||||
|
@ -1354,7 +1339,7 @@ void main() {
|
||||||
"bc1qggtj4ka8jsaj44hhd5mpamx7mp34m2d3w7k0m0",
|
"bc1qggtj4ka8jsaj44hhd5mpamx7mp34m2d3w7k0m0",
|
||||||
"bc1q42lja79elem0anu8q8s3h2n687re9jax556pcc"));
|
"bc1q42lja79elem0anu8q8s3h2n687re9jax556pcc"));
|
||||||
|
|
||||||
nmc?.outputsList = utxoList;
|
// nmc?.outputsList = utxoList;
|
||||||
|
|
||||||
bool didThrow = false;
|
bool didThrow = false;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import 'package:mockito/annotations.dart';
|
||||||
import 'package:mockito/mockito.dart';
|
import 'package:mockito/mockito.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
|
||||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
||||||
import 'package:stackwallet/models/models.dart';
|
import 'package:stackwallet/models/paymint/fee_object_model.dart';
|
||||||
import 'package:stackwallet/services/coins/particl/particl_wallet.dart';
|
import 'package:stackwallet/services/coins/particl/particl_wallet.dart';
|
||||||
import 'package:stackwallet/services/price.dart';
|
import 'package:stackwallet/services/price.dart';
|
||||||
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
import 'package:stackwallet/services/transaction_notification_tracker.dart';
|
||||||
|
@ -15,7 +15,6 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
|
||||||
|
|
||||||
import 'particl_history_sample_data.dart';
|
import 'particl_history_sample_data.dart';
|
||||||
import 'particl_transaction_data_samples.dart';
|
import 'particl_transaction_data_samples.dart';
|
||||||
import 'particl_utxo_sample_data.dart';
|
|
||||||
import 'particl_wallet_test.mocks.dart';
|
import 'particl_wallet_test.mocks.dart';
|
||||||
import 'particl_wallet_test_parameters.dart';
|
import 'particl_wallet_test_parameters.dart';
|
||||||
|
|
||||||
|
@ -489,18 +488,6 @@ void main() {
|
||||||
if (!hiveAdaptersRegistered) {
|
if (!hiveAdaptersRegistered) {
|
||||||
hiveAdaptersRegistered = true;
|
hiveAdaptersRegistered = true;
|
||||||
|
|
||||||
// Registering Transaction Model Adapters
|
|
||||||
Hive.registerAdapter(TransactionDataAdapter());
|
|
||||||
Hive.registerAdapter(TransactionChunkAdapter());
|
|
||||||
Hive.registerAdapter(TransactionAdapter());
|
|
||||||
Hive.registerAdapter(InputAdapter());
|
|
||||||
Hive.registerAdapter(OutputAdapter());
|
|
||||||
|
|
||||||
// Registering Utxo Model Adapters
|
|
||||||
Hive.registerAdapter(UtxoDataAdapter());
|
|
||||||
Hive.registerAdapter(UtxoObjectAdapter());
|
|
||||||
Hive.registerAdapter(StatusAdapter());
|
|
||||||
|
|
||||||
final wallets = await Hive.openBox<dynamic>('wallets');
|
final wallets = await Hive.openBox<dynamic>('wallets');
|
||||||
await wallets.put('currentWalletName', testWalletName);
|
await wallets.put('currentWalletName', testWalletName);
|
||||||
}
|
}
|
||||||
|
@ -1282,7 +1269,7 @@ void main() {
|
||||||
"pw1qvr6ehcm44vvqe96mxy9zw9aa5sa5yezvr2r94s",
|
"pw1qvr6ehcm44vvqe96mxy9zw9aa5sa5yezvr2r94s",
|
||||||
"pw1q66xtkhqzcue808nlg8tp48uq7fshmaddljtkpy"));
|
"pw1q66xtkhqzcue808nlg8tp48uq7fshmaddljtkpy"));
|
||||||
|
|
||||||
part?.outputsList = utxoList;
|
// part?.outputsList = utxoList;
|
||||||
|
|
||||||
bool didThrow = false;
|
bool didThrow = false;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue