-
-
Notifications
You must be signed in to change notification settings - Fork 838
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
fix: add parseEip712Transaction util function #2948
base: main
Are you sure you want to change the base?
fix: add parseEip712Transaction util function #2948
Conversation
|
@nikola-bozin-txfusion is attempting to deploy a commit to the Wevm Team on Vercel. A member of the Team first needs to authorize it. |
export function parseEip712Transaction( | ||
transaction: Hex, | ||
): ZksyncTransactionSerializableEIP712 { | ||
{ |
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.
Is the scope required here (L14 + L21)?
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.
The scope is removed.
throw new BaseError('transaction type must be eip712') | ||
} | ||
|
||
return constructEip712Transaction(payload) |
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.
Can we inline the contents of constructEip712Transaction
into here?
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.
The constructEip712Transaction
method is inlined.
type PaymasterParams = { | ||
paymaster: Hex | ||
paymasterInput: Hex | ||
} |
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.
Do we need to explicitly define this type? The handleArrayToPaymaster
return type should be inferred.
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.
PaymasterParams
is not needed and it has been removed.
Can we please add an export & docs for this? Also needs a changeset. |
0620294
to
09689f7
Compare
09689f7
to
5f8b1d3
Compare
PR-Codex overview
This PR introduces the
parseEip712Transaction
function to handle EIP-712 transactions in thezksync
project. It includes validation for transaction types, parsing of paymaster parameters, and tests for various scenarios, ensuring robust handling of serialized transactions.Detailed summary
parseEip712Transaction
function insrc/zksync/utils/parseEip712Transaction.ts
.validHex
andparsePaymasterArray
.src/zksync/utils/parseEip712Transaction.test.ts
for: