Skip to content

Commit

Permalink
Conditionally declare ids. (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
segfaultdoc authored Sep 25, 2023
1 parent 4fc3689 commit 568ca40
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mev-programs/Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ tip_distribution = "F2Zu7QZiTYUhPd7u9ukRVwxh7B71oA3NMJcHuCHc29P2"
tip_payment = "DCN82qDxJAQuSqHhv2BJuAgi41SPeKZB5ioBCTMNDrCC"

[programs.localnet]
tip_distribution = "4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7"
tip_payment = "T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt"
tip_distribution = "3PX9z1qPj37eNZqH7e5fyaVDyG7ARqkjkYEe1a4xsBkA"
tip_payment = "6veFRUKJBNGMR58LEcKn5Bc6MR17WZF4rsgD4Lqq7fsU"

[workspace]
members = [
Expand Down
10 changes: 10 additions & 0 deletions mev-programs/programs/tip-distribution/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,18 @@ pub mod merkle_proof;
pub mod sdk;
pub mod state;

#[cfg(all(not(mainnet), not(testnet), not(localnet)))]
declare_id!("4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7");

#[cfg(all(mainnet, not(testnet), not(localnet)))]
declare_id!("4R3gSG8BpU4t19KYj8CfnbtRpnT8gtk4dvTHxVRwc2r7");

#[cfg(all(testnet, not(mainnet), not(localnet)))]
declare_id!("F2Zu7QZiTYUhPd7u9ukRVwxh7B71oA3NMJcHuCHc29P2");

#[cfg(all(localnet, not(mainnet), not(testnet)))]
declare_id!("3PX9z1qPj37eNZqH7e5fyaVDyG7ARqkjkYEe1a4xsBkA");

#[program]
pub mod tip_distribution {
use jito_programs_vote_state::VoteState;
Expand Down
10 changes: 10 additions & 0 deletions mev-programs/programs/tip-payment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,18 @@ use anchor_lang::prelude::*;

use crate::TipPaymentError::ArithmeticError;

#[cfg(all(not(mainnet), not(testnet), not(localnet)))]
declare_id!("T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt");

#[cfg(all(mainnet, not(testnet), not(localnet)))]
declare_id!("T1pyyaTNZsKv2WcRAB8oVnk93mLJw2XzjtVYqCsaHqt");

#[cfg(all(testnet, not(mainnet), not(localnet)))]
declare_id!("DCN82qDxJAQuSqHhv2BJuAgi41SPeKZB5ioBCTMNDrCC");

#[cfg(all(localnet, not(mainnet), not(testnet)))]
declare_id!("6veFRUKJBNGMR58LEcKn5Bc6MR17WZF4rsgD4Lqq7fsU");

/// We've decided to hardcode the seeds, effectively meaning
/// the following PDAs owned by this program are singleton.
/// This ensures that `initialize` can only be invoked once,
Expand Down

0 comments on commit 568ca40

Please sign in to comment.