File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
lib/src/test/kotlin/org/bitcoindevkit Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,15 @@ class CreatingWalletTest {
29
29
)
30
30
}
31
31
32
+ @Test
33
+ fun `Create a wallet with a single descriptor` () {
34
+ Wallet .createSingle(
35
+ descriptor = TEST_BIP84_DESCRIPTOR ,
36
+ network = Network .TESTNET4 ,
37
+ persister = conn
38
+ )
39
+ }
40
+
32
41
@Test
33
42
fun `Create a wallet with a non-extended descriptor` () {
34
43
Wallet (
Original file line number Diff line number Diff line change @@ -40,4 +40,24 @@ class WalletTest {
40
40
actual = wallet.balance().total.toSat()
41
41
)
42
42
}
43
+
44
+ // Single-descriptor wallets return an address on the external keychain even if a change descriptor is not provided
45
+ // and the wallet.revealNextAddress(KeychainKind.INTERNAL) or wallet.peekAddress(KeychainKind.EXTERNAL, 0u) APIs are
46
+ // used.
47
+ @Test
48
+ fun `Single-descriptor wallets can create addresses` () {
49
+ val wallet: Wallet = Wallet .createSingle(
50
+ descriptor = TEST_BIP84_DESCRIPTOR ,
51
+ network = Network .TESTNET4 ,
52
+ persister = conn
53
+ )
54
+ val address1 = wallet.peekAddress(KeychainKind .EXTERNAL , 0u )
55
+ val address2 = wallet.peekAddress(KeychainKind .INTERNAL , 0u )
56
+
57
+ assertEquals(
58
+ expected = address1.address,
59
+ actual = address2.address,
60
+ message = " Addresses should be the same"
61
+ )
62
+ }
43
63
}
You can’t perform that action at this time.
0 commit comments