Skip to content
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: deprecating changing vest ownership #3

Merged
merged 4 commits into from
Sep 25, 2024
Merged

Conversation

wei3erHase
Copy link
Member

@wei3erHase wei3erHase commented Sep 19, 2024

  • deprecates the changing of ownership of a vest / lockup (not needed and causes edge-cases)
  • also erases related JS codebase to call it

@@ -176,15 +163,12 @@ impl VestingInstruction {
schedules,
}
}
2 | 3 => {
2 => {
let seeds: [u8; 32] = rest
Copy link
Member

Choose a reason for hiding this comment

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

this seeds unwrapping process is repeated quite a bit, is this some gas thing, or would we be good abstracting it into a small fn?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmmm, i'd prefer to change less than aim for a gas efficient method

2 => Self::Unlock { seeds },
_ => Self::ChangeDestination { seeds },
}
Self::Unlock { seeds }
Copy link
Member

Choose a reason for hiding this comment

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

again im not super familiar with either rust nor solana code but the 3 match cases are quite long, do you think it justifies extracting each one of them into a small function and so something like:

match tag {
    0 => Self::init,
    1 => Self::create,
    2 => Self::unlock
    _ => any error handling?
}

@wei3erHase wei3erHase marked this pull request as ready for review September 25, 2024 13:45
@wei3erHase wei3erHase merged commit 5c50f7f into dev Sep 25, 2024
2 checks passed
@wei3erHase wei3erHase deleted the feat/deprecate-transfer branch September 25, 2024 13:52
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.

2 participants