Skip to content

Commit

Permalink
Attempt to make tests ignore fee state deploy while mainnet keeps the…
Browse files Browse the repository at this point in the history
… feature
  • Loading branch information
jgur-psyops committed Oct 17, 2024
1 parent af52497 commit babd8ed
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
10 changes: 4 additions & 6 deletions programs/brick/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "brick"

[features]
no-entrypoint = []
Expand All @@ -16,10 +15,9 @@ cpi = ["no-entrypoint"]
default = []
idl-build = ["anchor-lang/idl-build"]
test = []

[profile.release]
overflow-checks = true
ignore-fee-deploy = []

[dependencies]
solana-program.workspace = true
anchor-lang.workspace = true
# Remove workspace = true if already defined in the root Cargo.toml
anchor-lang = { workspace = true }
solana-program = { workspace = true }
2 changes: 1 addition & 1 deletion programs/marginfi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ devnet = []
mainnet-beta = []
debug = []
staging = []
fee-deploy = []
ignore-fee-deploy = []

[dependencies]
solana-program = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ pub fn initialize_fee_state(
) -> Result<()> {
let mut fee_state = ctx.accounts.fee_state.load_init()?;
cfg_if::cfg_if! {
if #[cfg(all(feature = "mainnet-beta", feature = "fee-deploy"))] {
if ctx.accounts.payer.key != &pubkey!("3HGdGLrnK9DsnHi1mCrUMLGfQHcu6xUrXhMY14GYjqvM"){
panic!("The mrgn program multisig must sign on mainnet.")
if #[cfg(all(feature = "mainnet-beta", not(feature = "ignore-fee-deploy")))] {
if ctx.accounts.payer.key != &pubkey!("3HGdGLrnK9DsnHi1mCrUMLGfQHcu6xUrXhMY14GYjqvM") {
panic!("The mrgn program multisig must sign on mainnet.");
}
}
}
Expand Down
1 change: 1 addition & 0 deletions programs/mocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ devnet = []
mainnet-beta = []
debug = []
staging = []
ignore-fee-deploy = []

[dependencies]
anchor-lang = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions programs/test_transfer_hook/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition = "2021"
[features]
idl-build = []
no-entrypoint = []
ignore-fee-deploy = []

[lib]
crate-type = ["cdylib", "lib"]
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ else
exit 1
fi

cmd="anchor build -p $program_lib_name -- $features"
cmd="anchor build -p $program_lib_name -- $features ignore-fee-deploy"
echo "Running: $cmd"
eval "$cmd"
2 changes: 1 addition & 1 deletion scripts/build-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
ROOT=$(git rev-parse --show-toplevel)
cd $ROOT

cmd="anchor build --no-idl"
cmd="anchor build --no-idl -- --features ignore-fee-deploy"
echo "Running: $cmd"
eval "$cmd"

0 comments on commit babd8ed

Please sign in to comment.