Skip to content

Commit 82244b7

Browse files
Add test for GenericAddress.fromAsm with P2WPKH (#278)
* Add test for GenericAddress.fromAsm with P2WSH * Fix test for GenericAddress.fromAsm to use P2WPKH instead of P2WSH
1 parent 2969dbf commit 82244b7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/generic_address_test.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ void main() {
2121
expect(address.toString(), 'p77CZFn9jvg9waCzKBzkQfSvBBzPH1nRre');
2222
});
2323

24+
test('fromASM - P2WPKH', () {
25+
const asm = '0 2ea1d5637bf5b26fc442df1adca762ddd0479b45';
26+
final address = GenericAddress.fromAsm(asm, Network.mainnet);
27+
expect(address is P2WPKHAddress, true);
28+
expect(address.toString(), 'pc1q96sa2cmm7kexl3zzmuddefmzmhgy0x69pnp2wv');
29+
});
30+
2431
test('fromAsm - Unknown program type', () {
2532
const asm = 'OP_RETURN';
2633
expect(
@@ -29,6 +36,6 @@ void main() {
2936
);
3037
});
3138

32-
//TODO - Implement P2WPKH, P2WSH and P2TR
39+
//TODO - Implement P2WSH and P2TR
3340
});
3441
}

0 commit comments

Comments
 (0)