WIP: Update dust limit for nmc and bch, update nmc history data

This commit is contained in:
Likho 2022-09-19 19:38:32 +02:00
parent 20e8d0c114
commit 8bb6ba6ab7
5 changed files with 19 additions and 16 deletions

View file

@ -44,7 +44,7 @@ import 'package:uuid/uuid.dart';
import 'package:bitbox/bitbox.dart' as Bitbox;
const int MINIMUM_CONFIRMATIONS = 3;
const int DUST_LIMIT = 1000000;
const int DUST_LIMIT = 546;
const String GENESIS_HASH_MAINNET =
"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f";

View file

@ -44,7 +44,7 @@ import 'package:uuid/uuid.dart';
const int MINIMUM_CONFIRMATIONS = 2;
// Find real dust limit
const int DUST_LIMIT = 1000000;
const int DUST_LIMIT = 546;
const String GENESIS_HASH_MAINNET =
"000000000062b72c5e2ceb45fbc8587e807c155b0da735e6483dfba2f0a9c770";

View file

@ -29,7 +29,7 @@ void main() {
expect(MINIMUM_CONFIRMATIONS, 3);
});
test("bitcoincash dust limit", () async {
expect(DUST_LIMIT, 1000000);
expect(DUST_LIMIT, 546);
});
test("bitcoincash mainnet genesis block hash", () async {
expect(GENESIS_HASH_MAINNET,
@ -1891,7 +1891,7 @@ void main() {
bch = BitcoinCashWallet(
walletId: testWalletId,
walletName: testWalletName,
coin: Coin.bitcoincash,
coin: Coin.bitcoincashTestnet,
client: client!,
cachedClient: cachedClient!,
tracker: tracker!,

View file

@ -177,7 +177,10 @@ final Map<String, List<Map<String, dynamic>>> emptyHistoryBatchResponse = {
};
final List<String> activeScriptHashes = [
"83b744ccb88827d544081c1a03ea782a7d00d6224ff9fddb7d0fbad399e1cae7",
"dd63fc12f5e6c1ada2cf3c941d1648e6d561ce4024747bb2117d72112d83287c",
"587943864cefed4f1643a5ee2ce2b3c13a0c6ad7c435373f0ac328e144a15c1e",
"cd3dd4abe4f9efc7149ba334d2d6790020331805b0bd5c7ed89a3ac6a22f10b9",
"86906979fc9107d06d560275d7de8305b69d7189c3206ac9070ad76e6abff874",
"5baba32b1899d5e740838559ef39b7d8e9ba302bd24b732eeedd4c0e6ec65b51",
"c068e7fa4aa0b8a63114f6d11c047ca4be6a8fa333eb0dac48506e8f150af73b",
"42d6e40636f4740f9c7f95ef0bbc2a4c17f54da2bc98a32a622e2bf73eb675c3"
];

View file

@ -32,7 +32,7 @@ void main() {
expect(MINIMUM_CONFIRMATIONS, 2);
});
test("namecoin dust limit", () async {
expect(DUST_LIMIT, 1000000);
expect(DUST_LIMIT, 546);
});
test("namecoin mainnet genesis block hash", () async {
expect(GENESIS_HASH_MAINNET,
@ -761,14 +761,14 @@ void main() {
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
.thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs2))
// .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs3))
// .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs4))
// .thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs5))
// .thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs2))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs3))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs4))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs5))
.thenAnswer((_) async => historyBatchResponse);
List<dynamic> dynamicArgValues = [];
@ -1000,7 +1000,7 @@ void main() {
for (final arg in dynamicArgValues) {
final map = Map<String, List<dynamic>>.from(arg as Map);
verify(client?.getBatchHistory(args: map)).called(1);
verify(client?.getBatchHistory(args: map)).called(2);
expect(activeScriptHashes.contains(map.values.first.first as String),
true);
}