mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-08 19:59:29 +00:00
fix bitcoin cash tests
This commit is contained in:
parent
2a3997e837
commit
27c2e38311
2 changed files with 10 additions and 18 deletions
|
@ -265,9 +265,11 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
|||
DerivePathType addressType({required String address}) {
|
||||
Uint8List? decodeBase58;
|
||||
Segwit? decodeBech32;
|
||||
if (Bitbox.Address.detectFormat(address) == 0) {
|
||||
address = Bitbox.Address.toLegacyAddress(address);
|
||||
}
|
||||
try {
|
||||
if (Bitbox.Address.detectFormat(address) == 0) {
|
||||
address = Bitbox.Address.toLegacyAddress(address);
|
||||
}
|
||||
} catch (e, s) {}
|
||||
try {
|
||||
decodeBase58 = bs58check.decode(address);
|
||||
} catch (err) {
|
||||
|
|
|
@ -26,7 +26,7 @@ import 'bitcoincash_wallet_test_parameters.dart';
|
|||
void main() {
|
||||
group("bitcoincash constants", () {
|
||||
test("bitcoincash minimum confirmations", () async {
|
||||
expect(MINIMUM_CONFIRMATIONS, 3);
|
||||
expect(MINIMUM_CONFIRMATIONS, 1);
|
||||
});
|
||||
test("bitcoincash dust limit", () async {
|
||||
expect(DUST_LIMIT, 546);
|
||||
|
@ -831,18 +831,9 @@ void main() {
|
|||
|
||||
await bch?.initializeNew();
|
||||
await bch?.initializeExisting();
|
||||
expect(
|
||||
Address.validateAddress(
|
||||
await bch!.currentReceivingAddress, bitcoincashtestnet),
|
||||
true);
|
||||
expect(
|
||||
Address.validateAddress(
|
||||
await bch!.currentReceivingAddress, bitcoincashtestnet),
|
||||
true);
|
||||
expect(
|
||||
Address.validateAddress(
|
||||
await bch!.currentReceivingAddress, bitcoincashtestnet),
|
||||
true);
|
||||
expect(bch?.validateAddress(await bch!.currentReceivingAddress), true);
|
||||
expect(bch?.validateAddress(await bch!.currentReceivingAddress), true);
|
||||
expect(bch?.validateAddress(await bch!.currentReceivingAddress), true);
|
||||
|
||||
verifyNever(client?.ping()).called(0);
|
||||
verify(client?.getServerFeatures()).called(1);
|
||||
|
@ -884,8 +875,7 @@ void main() {
|
|||
expect(addresses?.length, 2);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
expect(
|
||||
Address.validateAddress(addresses![i], bitcoincashtestnet), true);
|
||||
expect(bch?.validateAddress(addresses![i]), true);
|
||||
}
|
||||
|
||||
verifyNever(client?.ping()).called(0);
|
||||
|
|
Loading…
Reference in a new issue