-
-
Notifications
You must be signed in to change notification settings - Fork 268
feat: Attach metadata when submitting a revocation to the permission provider snap #7503
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
Merged
jeffsmale90
merged 18 commits into
main
from
feat/attach-tx-metadata-when-submitting-revocation
Jan 21, 2026
Merged
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c4ef167
Attach metadata when submitting a revocation to the permission provid…
V00D00-child 8df3ad6
Update changelog
V00D00-child e065992
Update changelog
V00D00-child 970b799
bugfix: Undefined metadata sent in revocation params
V00D00-child 8b709c0
Update changelog
V00D00-child 85210a0
Update comment
V00D00-child 85570cf
Drop block timestamp and change name from metadata to revocationMetadata
V00D00-child 378443a
Change name from metadata to revocationMetadata in RevocationParams
V00D00-child 9002511
Update the change since the implementation no longer includes block t…
V00D00-child b345334
Always set revocationMetadata, but make txHash property optional
V00D00-child 52b2bef
Update changelog to reflect breaking addition
V00D00-child 50338af
Expose RevocationMetadata type
V00D00-child 6b0625d
Simplify revocationMetadata attachment logic
V00D00-child 5417702
Merge branch 'main' into feat/attach-tx-metadata-when-submitting-revo…
V00D00-child 2ea2304
Ensure test case asserts revocationMetadata txHash is undefined when …
V00D00-child a60ce58
Update revocation metadata to match snap implementation:
jeffsmale90 241152e
Fix linting errors, and remove lint suppressions
jeffsmale90 7183271
Update changelog entry
jeffsmale90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,10 @@ import { | |
| } from './errors'; | ||
| import { controllerLog } from './logger'; | ||
| import { GatorPermissionsSnapRpcMethod } from './types'; | ||
| import type { StoredGatorPermissionSanitized } from './types'; | ||
| import type { | ||
| RevocationMetadata, | ||
| StoredGatorPermissionSanitized, | ||
| } from './types'; | ||
| import type { | ||
| GatorPermissionsMap, | ||
| PermissionTypesWithCustom, | ||
|
|
@@ -948,9 +951,33 @@ export default class GatorPermissionsController extends BaseController< | |
| controllerLog('Transaction confirmed, submitting revocation', { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not strictly related to this PR - but do we need to check When a transaction is confirmed, do we explicitly guard against failed transactions? |
||
| txId, | ||
| permissionContext, | ||
| txHash: transactionMeta.hash, | ||
| }); | ||
|
|
||
| this.submitRevocation({ permissionContext }) | ||
| // Attach metadata by parsing the confirmed transactionMeta | ||
| let revocationMetadata: RevocationMetadata | undefined; | ||
| const { hash } = transactionMeta; | ||
| if (hash === undefined) { | ||
| controllerLog( | ||
| 'Failed to attach transaction hash after revocation transaction confirmed', | ||
| { | ||
| txId, | ||
| permissionContext, | ||
| error: new Error( | ||
| 'Confirmed transaction is missing transaction hash', | ||
| ), | ||
| }, | ||
| ); | ||
| } else { | ||
| revocationMetadata = { | ||
| txHash: hash as Hex, | ||
| }; | ||
| } | ||
|
|
||
| const revocationParams = revocationMetadata | ||
| ? { permissionContext, revocationMetadata } | ||
| : { permissionContext }; | ||
| this.submitRevocation(revocationParams) | ||
| .catch((error) => { | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| controllerLog( | ||
| 'Failed to submit revocation after transaction confirmed', | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.