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 {
2929 )
3030 }
3131
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+
3241 @Test
3342 fun `Create a wallet with a non-extended descriptor` () {
3443 Wallet (
Original file line number Diff line number Diff line change @@ -40,4 +40,24 @@ class WalletTest {
4040 actual = wallet.balance().total.toSat()
4141 )
4242 }
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+ }
4363}
You can’t perform that action at this time.
0 commit comments