-
Notifications
You must be signed in to change notification settings - Fork 5
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
Realloc instructions #20
Conversation
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.
A couple things to finish up
program/src/realloc_ballot_box.rs
Outdated
realloc(ballot_box, new_size, payer, &Rent::get()?)?; | ||
} | ||
|
||
if ballot_box.data_len() >= BallotBox::SIZE |
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.
nit suggestion - which could be applied to all realloc functions:
let should_initailize = ballot_box.data_len() >= BallotBox::SIZE && ballot_box.try_borrow_data()?[0] != BallotBox::DISCRIMINATOR
if should_initailize {
ballot_box.initalize()
}
let current_slot = Clock::get()?.slot; | ||
let (_, ncn_epoch_length) = load_ncn_epoch(restaking_config, current_slot, None)?; | ||
|
||
//TODO move to helper function |
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 is a good argument for the suggested nit above.
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.
nit: TODO
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.
A few nits otherwise lgtm
let current_slot = Clock::get()?.slot; | ||
let (_, ncn_epoch_length) = load_ncn_epoch(restaking_config, current_slot, None)?; | ||
|
||
//TODO move to helper function |
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.
nit: TODO
program/src/route_ncn_rewards.rs
Outdated
@@ -65,8 +63,12 @@ pub fn process_route_ncn_rewards( | |||
|
|||
let rent_cost = ncn_reward_router_account.rent_cost(&Rent::get()?)?; | |||
|
|||
msg!("A"); |
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.
Nit: Remove
notes to self