Skip to content

Commit

Permalink
Missing emits and final program address (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
ebatsell authored Jul 29, 2024
1 parent f4ea93a commit f83602d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolution = false
skip-lint = false
[programs.localnet]
validator_history = "HistoryJTGbKQD2mRgLZ3XhqHnN811Qpez8X9kCcGHoa"
steward = "sssh4zkKhX8jXTNQz1xDHyGpygzgu2UhcRcUvZihBjP"
steward = "Stewardf95sJbmtcZsyagb2dg4Mo8eVQho8gpECvLx8"

[workspace]
members = [
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions programs/steward/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ name = "jito_steward"
no-entrypoint = []
no-idl = []
no-log-ix-name = []
mainnet-beta = []
testnet = []
cpi = ["no-entrypoint"]
default = ["custom-heap"]
custom-heap = []
Expand Down
2 changes: 1 addition & 1 deletion programs/steward/idl/steward.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"address": "sssh4zkKhX8jXTNQz1xDHyGpygzgu2UhcRcUvZihBjP",
"address": "Stewardf95sJbmtcZsyagb2dg4Mo8eVQho8gpECvLx8",
"metadata": {
"name": "steward",
"version": "0.1.0",
Expand Down
6 changes: 4 additions & 2 deletions programs/steward/src/instructions/compute_score.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ pub fn handler(ctx: Context<ComputeScore>, validator_list_index: usize) -> Resul
state_account.state.state_tag,
StewardStateEnum::ComputeScores
) {
maybe_transition(
if let Some(event) = maybe_transition(
&mut state_account.state,
&clock,
&config.parameters,
&epoch_schedule,
)?;
)? {
emit!(event);
}
}

require!(
Expand Down
6 changes: 4 additions & 2 deletions programs/steward/src/instructions/idle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ pub fn handler(ctx: Context<Idle>) -> Result<()> {
Some(StewardStateEnum::Idle),
)?;

maybe_transition(
if let Some(event) = maybe_transition(
&mut state_account.state,
&clock,
&config.parameters,
&epoch_schedule,
)?;
)? {
emit!(event);
}

Ok(())
}
2 changes: 1 addition & 1 deletion programs/steward/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub mod utils;

pub use state::*;

declare_id!("sssh4zkKhX8jXTNQz1xDHyGpygzgu2UhcRcUvZihBjP");
declare_id!("Stewardf95sJbmtcZsyagb2dg4Mo8eVQho8gpECvLx8");

/*
This program manages the selection of validators and delegation of stake for a SPL Stake Pool.
Expand Down
2 changes: 2 additions & 0 deletions programs/validator-history/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ name = "validator_history"
no-entrypoint = []
no-idl = []
no-log-ix-name = []
mainnet-beta = []
testnet = []
cpi = ["no-entrypoint"]
default = ["custom-heap"]
custom-heap = []
Expand Down

0 comments on commit f83602d

Please sign in to comment.