-
Notifications
You must be signed in to change notification settings - Fork 190
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
feat: add status to classic messages #240
Conversation
src/lib/message/L1ToL2Message.ts
Outdated
return L1ToL2MessageStatus.CREATION_FAILED | ||
} | ||
|
||
return L1ToL2MessageStatus.REDEEMED |
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 discern between expired and redeemed? We derive the l2txHash from the retryablecreationid:
private static calculateL2DerivedHash(
retryableCreationId: string,
l2TxnType: L2TxnType
): string {
return keccak256(
concat([
zeroPad(retryableCreationId, 32),
zeroPad(BigNumber.from(l2TxnType).toHexString(), 32),
])
)
}
then check if that tx was successful:
if (l2TxReceipt && l2TxReceipt.status === 1) {
return L1ToL2MessageStatus.REDEEMED
}
otherwise the ticket would be EXPIRED.
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.
@yahgwai Is l2TxnType
taken from creationReceipt.type
? I'm using it to call calculateL2DerivedHash
, and then running l2Provider.getTransactionReceipt( l2DerivedHash )
but it's returning null
I think that's all that needs to be returned but lmk if I missed something