mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-23 22:56:52 +01:00
Make wallet.dat
be the default wallet name for bitcoind in our codebase (#5543)
* Make 'wallet.dat' be the default wallet name in our codebase * Fix MultiWalletRpcTest
This commit is contained in:
parent
23e32652f3
commit
1d42de0977
4 changed files with 13 additions and 9 deletions
|
@ -70,6 +70,7 @@ class MultiWalletRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
_ <- PekkoUtil.nonBlockingSleep(1.second)
|
||||
started <- walletClient.start()
|
||||
_ <- walletClient.loadWallet(walletName)
|
||||
_ <- walletClient.loadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
|
||||
wallets <- walletClient.listWallets
|
||||
wallets2 <- client.listWallets
|
||||
|
|
|
@ -79,6 +79,7 @@ class WalletRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
// hasn't released its locks on the datadir. This is prevent that.
|
||||
_ <- PekkoUtil.nonBlockingSleep(1.second)
|
||||
_ <- walletClient.start()
|
||||
_ <- walletClient.loadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
} yield walletClient
|
||||
}
|
||||
|
||||
|
@ -91,8 +92,7 @@ class WalletRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
for {
|
||||
wallets <- client.listWallets
|
||||
} yield {
|
||||
|
||||
val expectedFileName = ""
|
||||
val expectedFileName = BitcoindRpcClient.DEFAULT_WALLET_NAME
|
||||
|
||||
assert(wallets == Vector(expectedFileName))
|
||||
}
|
||||
|
@ -651,11 +651,11 @@ class WalletRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
it should "create a descriptor wallet" in { nodePair: FixtureParam =>
|
||||
val client = nodePair.node1
|
||||
for {
|
||||
_ <- client.unloadWallet("")
|
||||
_ <- client.unloadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
_ <- client.createWallet("descriptorWallet", descriptors = true)
|
||||
descript <- client.getWalletInfo("descriptorWallet")
|
||||
_ <- client.unloadWallet("descriptorWallet")
|
||||
_ <- client.loadWallet("")
|
||||
_ <- client.loadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
} yield {
|
||||
descript match {
|
||||
case walletInfoPostV22: GetWalletInfoResultPostV22 =>
|
||||
|
@ -668,11 +668,11 @@ class WalletRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
nodePair: FixtureParam =>
|
||||
val client = nodePair.node1
|
||||
for {
|
||||
_ <- client.unloadWallet("")
|
||||
_ <- client.unloadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
_ <- client.createWallet("privKeyWallet", disablePrivateKeys = true)
|
||||
walletPriv <- client.getWalletInfo("privKeyWallet")
|
||||
_ <- client.unloadWallet("privKeyWallet")
|
||||
_ <- client.loadWallet("")
|
||||
_ <- client.loadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
} yield {
|
||||
walletPriv match {
|
||||
case walletInfoPostV22: GetWalletInfoResultPostV22 =>
|
||||
|
@ -724,12 +724,12 @@ class WalletRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
next = None
|
||||
)
|
||||
for {
|
||||
_ <- client.unloadWallet("")
|
||||
_ <- client.unloadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
_ <- client.createWallet(walletName, descriptors = true)
|
||||
_ <- client.importDescriptor(imp, Some(walletName))
|
||||
decoded <- client.decodeScript(p2wpkh)
|
||||
_ <- client.unloadWallet(walletName)
|
||||
_ <- client.loadWallet("")
|
||||
_ <- client.loadWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME)
|
||||
} yield {
|
||||
decoded match {
|
||||
case decodedV22: DecodeScriptResultV22 =>
|
||||
|
|
|
@ -303,6 +303,8 @@ object BitcoindRpcClient {
|
|||
implicit private lazy val system: ActorSystem =
|
||||
ActorSystem.create(ActorSystemName)
|
||||
|
||||
val DEFAULT_WALLET_NAME: String = "wallet.dat"
|
||||
|
||||
/** Creates an RPC client from the given instance.
|
||||
*
|
||||
* Behind the scenes, we create an actor system for you. You can use
|
||||
|
|
|
@ -314,7 +314,8 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger {
|
|||
val createWalletF = for {
|
||||
version <- server.version
|
||||
descriptors = true
|
||||
_ <- res.createWallet("", descriptors = descriptors)
|
||||
_ <- res.createWallet(BitcoindRpcClient.DEFAULT_WALLET_NAME,
|
||||
descriptors = descriptors)
|
||||
} yield res
|
||||
|
||||
createWalletF
|
||||
|
|
Loading…
Add table
Reference in a new issue