-
Notifications
You must be signed in to change notification settings - Fork 151
Migrate from web3's SecretKey to alloy's PrivateKeySigner #3989
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
MartinquaXD
left a comment
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.
Mostly nits.
| EcdsaSigningScheme::Eip712, | ||
| &onchain.contracts().domain_separator, | ||
| SecretKeyRef::from(&SecretKey::from_slice(trader_a.private_key()).unwrap()), | ||
| &PrivateKeySigner::from_slice(trader_a.private_key()).unwrap(), |
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.
Did you consider adjusting the private_key() function to already return a PrivateKeySigner? Don't know if we ever need to use the raw bytes NOT for initializing that type.
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.
This gets simplified in the following PR, I don't think it's worth changing it in this PR
https://github.com/cowprotocol/services/pull/3990/changes#diff-50c3d00f9ea51df4069a21538ee31003522aa16eb82084abb82ed6714ae91380L1078
Description
Start to set up the alloy signers etc, by removing the usage of SecretKey and SecretKeyRef
Changes
How to test
Existing tests