-
Notifications
You must be signed in to change notification settings - Fork 29
Implement encryptwallet method and test #250
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
base: master
Are you sure you want to change the base?
Conversation
Use node wallet for v20_and_below
f473e1e
to
e9bf939
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 e9bf939
Nice, you're on a roll. |
Thank you! |
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.
Everything looks good. If you don't want to do the auth thing just throw a comment in the code, something like // TODO: This match shoud really be handled by the crate not in each individual test like this
.
Cheers
let client = match () { | ||
#[cfg(feature = "v20_and_below")] | ||
() => node.create_wallet(wallet_name).expect("createwallet"), | ||
#[cfg(not(feature = "v20_and_below"))] | ||
() => { | ||
node.client.create_wallet(wallet_name).expect("createwallet"); | ||
&node.client | ||
}, |
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.
Are you feeling adventurous? It would be nice to investigate why this is needed and move the feature gating logic to node/src/lib.rs
in the create_wallet
function so that every test author does not have to think about it. FTR I did not investigate, I vaguely remember hitting this before though so my suggestion is just a hunch.
The JSON-RPC method
encryptwallet
does return a type. 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 the type it returns, along with an integration test that calls this function.
Ref: #116