-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Align personal_unlockAccount behaviour when permanent unlock is disabled #10060
Conversation
> If permanent unlocking is disabled (the default) then the duration argument will be ignored, and the account will be unlocked for a single signing. Current behaviour throws an error that is no longer relevant.
It looks like @joshua-mir signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
Flashbacks: #6777 |
I can change this so it throws a different error, we no longer have geth compatibility mode so the error wasn't helpful. In addition I feel that the documentation is clear enough that we are ignoring duration. |
I'd prefer an error, cause in the past we had issues with some implicit, but unexpected behaviour (even if documented). |
rpc/src/v1/impls/personal.rs
Outdated
"Time-unlocking is only supported in --geth compatibility mode.", | ||
Some("Restart your client with --geth flag or use personal_sendTransaction instead."), | ||
"Time-unlocking is not supported when permanent unlock is disabled.", | ||
Some("Use personal_sendTransaction or enable permanent unlocking, instead."), |
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.
trailing whitespaces
rpc/src/v1/tests/mocked/personal.rs
Outdated
let response = r#"{"jsonrpc":"2.0","error":{"code":-32000,"message":"Time-unlocking is not supported when permanent unlock is disabled.","data":"Use personal_sendTransaction or enable permanent unlocking, instead."},"id":1}"#; | ||
assert_eq!(tester.io.handle_request_sync(&request), Some(response.into())); | ||
assert!(tester.accounts.sign(address, None, Default::default()).is_err(), "Should not unlock account."); |
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.
please configure your editor to handle whitespaces properly
(I was working with the documentation script, which is why github claims that the previous commit was made by devops, oops, please ignore.) |
Current behaviour throws an error.