-
Notifications
You must be signed in to change notification settings - Fork 14
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
feature/migrate-utils-to-ethers6 #188
feature/migrate-utils-to-ethers6 #188
Conversation
…de-part1' into feature/migrate-utils-to-ethers6
…for various scripts and utility files
…nto feature/migrate-utils-to-ethers6
@@ -292,7 +292,7 @@ export async function signOrder( | |||
domain: TypedDataDomain, | |||
order: Record<string, any>, | |||
signer: SignerWithAddress, | |||
): Promise<void> { | |||
): Promise<Record<string, any>> { |
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.
Why is it needed?
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.
It should be compatible with the signStruct function, which does not return a void Promise.
signStruct(primaryType: string, message: Record<string, any>, domain: TypedDataDomain, wallet: WalletInfo): Promise<Record<string, any>>
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 don't see the return values of signStruct
, signOrder
, signOrderOperation
used anywhere.
I think we need to refactor these functions to either make them pure or remove the return value. Ofc not necessarily for this PR.
if (split.v == 1 || split.v == 28) { | ||
const split = ethers.Signature.from(signature); | ||
let vs = ethers.getBytes(split.s); | ||
if (split.v == 27 || split.v == 28) { |
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'm not sure to understand here why we need to replace 1 by 27. To be validated !
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.
It seems that signature.v is the legacy method and signature.yParity is the new method.
But we should be careful before changing it and check first if we need to support legacy signatures.
Co-authored-by: Zied Guesmi <[email protected]>
No description provided.