Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Jan 18, 2026

Problem

Currently only the account owner is able to revoke a delegate, although there are use-cases where it would be interesting for a delegate to revoke itself.

Solution

Update the revoke implementation to allow a delegate to revoke itself.

@febo febo requested a review from joncinque January 20, 2026 10:59
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just two tiny nits, which you can take or leave

unsafe {
validate_owner(
if source_account.delegate() == Some(authority_info.key()) {
authority_info.key()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there's no actual difference, and I'm not sure if this impacts performance, but I find it slightly clearer to use source_account.delegate() here

Suggested change
authority_info.key()
source_account.delegate()

Comment on lines +170 to +172
assert!(account.is_some());

let account = account.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

micro-nit: there's no need to assert account.is_some() if we're unwrapping in the next line -- it'll panic either way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants