-
Notifications
You must be signed in to change notification settings - Fork 78
Allow compiled messages with no lifetime #587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintaine 8000 rs 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
Allow compiled messages with no lifetime #587
Conversation
🦋 Changeset detectedLatest commit: ab5f81e The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
BundleMonFiles updated (7)
Unchanged files (120)
Total files change +392B +0.11% Final result: ✅ View report in BundleMon website ➡️ |
f2899ee
to
a3524dd
Compare
@steveluscher @mcintyre94 If we're happy with this approach, I can insert it in the main PR stack. |
Documentation Preview: https://kit-docs-dkvblhm86-anza-tech.vercel.app |
a3524dd
to
ab5f81e
Compare
if (!('lifetimeConstraint' in decompiledTransactionMessage)) { | ||
throw new Error('We expect a lifetime'); | ||
} |
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 showcases how this PR affects the developer experience. Here we know there will always be a lifetime constraint since we're fetching a transaction that landed so we need to assert the correct type.
Closing in favour of #594 |
This PR allows
CompiledTransactionMessages
to have no lifetime constraint.It does it by filling the lifetime token with zeroes when encoding the message — that is, at the very last possible moment.
In order to have reciprocity when decoding
CompiledTransactionMessages
, the decoder also recognises a lifetime token filled with zeroes and translate this as anundefined
lifetime token.