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

No idl-build in default target #86

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: jito_steward.json
path: programs/steward/idl/jito_steward.json
path: programs/steward/idl/steward.json

# tests run on verified build
test:
Expand Down
2 changes: 1 addition & 1 deletion programs/steward/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ custom-heap = []
idl-build = ["anchor-lang/idl-build", "no-entrypoint"]

[dependencies]
anchor-lang = { features = ["idl-build"], version = "0.30.0" }
anchor-lang = "0.30.0"
bincode = "1.3.3"
blake3 = "1.3.1"
borsh = "0.10.0"
Expand Down
2 changes: 2 additions & 0 deletions programs/steward/src/events.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[cfg(feature = "idl-build")]
use anchor_lang::idl::{
types::{IdlEnumVariant, IdlTypeDef, IdlTypeDefTy},
IdlBuild,
Expand Down Expand Up @@ -70,6 +71,7 @@ pub enum RebalanceTypeTag {
Decrease,
}

#[cfg(feature = "idl-build")]
impl IdlBuild for RebalanceTypeTag {
fn create_type() -> Option<IdlTypeDef> {
Some(IdlTypeDef {
Expand Down
1 change: 0 additions & 1 deletion programs/steward/src/instructions/rebalance.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use std::num::NonZeroU32;

use anchor_lang::{
idl::*,
prelude::*,
solana_program::{
program::invoke_signed,
Expand Down
3 changes: 3 additions & 0 deletions programs/steward/src/instructions/set_new_authority.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(feature = "idl-build")]
use anchor_lang::idl::types::*;
use anchor_lang::prelude::*;
#[cfg(feature = "idl-build")]
use anchor_lang::IdlBuild;
use borsh::{BorshDeserialize, BorshSerialize};

Expand All @@ -20,6 +22,7 @@ impl AuthorityType {
}

// Implement IdlBuild for AuthorityType
#[cfg(feature = "idl-build")]
impl IdlBuild for AuthorityType {
fn create_type() -> Option<IdlTypeDef> {
Some(IdlTypeDef {
Expand Down
1 change: 1 addition & 0 deletions programs/steward/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![allow(clippy::redundant_pub_crate)]
use anchor_lang::prelude::*;
#[cfg(feature = "idl-build")]
use anchor_lang::IdlBuild;
use instructions::*;

Expand Down
5 changes: 3 additions & 2 deletions programs/steward/src/score.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#[cfg(feature = "idl-build")]
use anchor_lang::IdlBuild;
use anchor_lang::{
prelude::event, solana_program::pubkey::Pubkey, AnchorDeserialize, AnchorSerialize, IdlBuild,
Result,
prelude::event, solana_program::pubkey::Pubkey, AnchorDeserialize, AnchorSerialize, Result,
};
use validator_history::{ClusterHistory, ValidatorHistory};

Expand Down
6 changes: 3 additions & 3 deletions programs/steward/src/state/parameters.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anchor_lang::idl::types::*;
use anchor_lang::idl::*;
#[cfg(feature = "idl-build")]
use anchor_lang::idl::{types::*, *};
use anchor_lang::{prelude::Result, zero_copy};
use borsh::{BorshDeserialize, BorshSerialize};
use validator_history::utils::cast_epoch;
Expand Down Expand Up @@ -37,7 +37,7 @@ pub struct UpdateParametersArgs {
pub minimum_voting_epochs: Option<u64>,
}

// #[cfg(feature = "idl-build")]
#[cfg(feature = "idl-build")]
impl IdlBuild for UpdateParametersArgs {
fn create_type() -> Option<IdlTypeDef> {
Some(IdlTypeDef {
Expand Down
7 changes: 6 additions & 1 deletion programs/steward/src/state/steward_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ use crate::{
utils::{epoch_progress, get_target_lamports, stake_lamports_at_validator_list_index},
Config, Parameters,
};

#[cfg(feature = "idl-build")]
use anchor_lang::idl::types::*;
use anchor_lang::{prelude::*, IdlBuild};
use anchor_lang::prelude::*;
#[cfg(feature = "idl-build")]
use anchor_lang::IdlBuild;

use bytemuck::{Pod, Zeroable};
use spl_stake_pool::big_vec::BigVec;
Expand Down Expand Up @@ -192,6 +196,7 @@ impl Display for StewardStateEnum {
}
}

#[cfg(feature = "idl-build")]
impl IdlBuild for StewardStateEnum {
fn create_type() -> Option<IdlTypeDef> {
Some(IdlTypeDef {
Expand Down
5 changes: 4 additions & 1 deletion programs/steward/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::ops::{Deref, Not};

use anchor_lang::{idl::types::*, prelude::*};
#[cfg(feature = "idl-build")]
use anchor_lang::idl::types::*;
use anchor_lang::prelude::*;
use borsh::{BorshDeserialize, BorshSerialize};
use spl_pod::{bytemuck::pod_from_bytes, primitives::PodU64, solana_program::program_pack::Pack};
use spl_stake_pool::{
Expand Down Expand Up @@ -394,6 +396,7 @@ impl From<spl_stake_pool::instruction::PreferredValidatorType> for PreferredVali
}
}

#[cfg(feature = "idl-build")]
impl IdlBuild for PreferredValidatorType {
fn create_type() -> Option<IdlTypeDef> {
Some(IdlTypeDef {
Expand Down
2 changes: 1 addition & 1 deletion programs/validator-history/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ custom-heap = []
idl-build = ["anchor-lang/idl-build", "no-entrypoint"]

[dependencies]
anchor-lang = { features = ["idl-build"], version = "0.30.0" }
anchor-lang = "0.30.0"
bincode = "1.3.3"
bytemuck = { version = "1.13.1", features = ["derive", "min_const_generics"] }
cfg-if = "1.0.0"
Expand Down
Loading