-
Notifications
You must be signed in to change notification settings - Fork 32
Implement sethdseed method and test #283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Had merge conflict, have to rebase. |
25ed5e9
to
ee82283
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK ee82283
() => Node::with_wallet(Wallet::Default, &[]), | ||
#[cfg(not(feature = "v22_and_below"))] | ||
() => { | ||
let node = Node::with_wallet(Wallet::None, &["-deprecatedrpc=create_bdb"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are you adding this flag for? I see you've done this a bunch of times and I never got round to asking, my bad. I got the test to pass without it.
When you force push perhaps add
// sethdseed is only used for non-descriptor wallets which are the default in v23 onwards.
because I had to go digging to find out why we need a legacy wallet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added -deprecatedrpc=create_bdb
because the test calls sethdseed
, which is only available on legacy wallets. From v23 onwards, Bitcoin Core uses descriptor wallets by default, and BDB wallet creation is deprecated unless explicitly re-enabled via this flag. Without it, I get the error below:
createlegacywallet: JsonRpc(Rpc(RpcError { code: -4, message: "BDB wallet creation is deprecated and will be removed in a future release. In this release it can be re-enabled temporarily with the -deprecatedrpc=create_bdb setting.", data: None }))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is why for v23 onwards, some of the rpc methods are only supported on legacy wallet, that is why I use legacy wallet, and to create_legacy_wallet, some of the methods also required passing in that flag to create a BDB wallet for them to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. Weirdly I swear I got the test to pass yesterday without the flag. Perhaps we could add a Legacy
variant to Wallet
then use with_wallet(Wallet::Legacy)
to hide all these details? Want to either have a crack at that or write up an issue explaining the problem? Just holla if you don't want to and I can write an issue.
Removed the feature gating and used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK cce7153
The JSON-RPC method
sethdseed
does not return anything. We want to test this to catch any changes in behavior in future Core versions.This PR adds a client function that errors if the return value is anything other than
null
, along with an integration test that calls this function.Ref: #116