Skip to content

Commit

Permalink
update program id (#1)
Browse files Browse the repository at this point in the history
* update program id

* re-export autobahn id

* Executor: fix log discriminant

---------

Co-authored-by: Serge Farny <[email protected]>
  • Loading branch information
mschneider and farnyser authored Oct 2, 2024
1 parent 20fd5e7 commit dd34dbf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
3 changes: 1 addition & 2 deletions bin/autobahn-router/src/ix_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ impl<T: SwapStepInstructionBuilder> SwapInstructionsBuilder for SwapInstructions
let mut setup_instructions = vec![];
let mut cleanup_instructions = vec![];

let exec_program_id: Pubkey =
Pubkey::from_str("EXECM4wjzdCnrtQjHx5hy1r5k31tdvWBPYbqsjSoPfAh").unwrap();
let exec_program_id: Pubkey = autobahn_executor::id();
let sol_mint: Pubkey =
Pubkey::from_str("So11111111111111111111111111111111111111112").unwrap();

Expand Down
2 changes: 1 addition & 1 deletion lib/dex-openbook-v2/src/openbook_v2_ix_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub fn build_swap_ix(
);

let instruction = Instruction {
program_id: Pubkey::from_str("EXECM4wjzdCnrtQjHx5hy1r5k31tdvWBPYbqsjSoPfAh").unwrap(),
program_id: router_lib::autobahn_executor::id(),
accounts: account_metas,
data,
};
Expand Down
4 changes: 2 additions & 2 deletions lib/router-feed-lib/src/grpc_tx_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async fn feed_tx_geyser(
vote: Some(false),
failed: None,
signature: None,
account_include: vec!["EXECM4wjzdCnrtQjHx5hy1r5k31tdvWBPYbqsjSoPfAh".to_string()],
account_include: vec![autobahn_executor::id().to_string()],
account_exclude: vec![],
account_required: vec![],
},
Expand Down Expand Up @@ -144,7 +144,7 @@ pub async fn handle_tx(tx: &SubscribeUpdateTransaction, sender: &async_channel::
continue;
};

if program_id != Pubkey::from_str("EXECM4wjzdCnrtQjHx5hy1r5k31tdvWBPYbqsjSoPfAh").unwrap() {
if program_id != autobahn_executor::id() {
continue;
}

Expand Down
5 changes: 5 additions & 0 deletions lib/router-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ pub mod retry_counter;
pub mod router_client;
pub mod test_tools;
pub mod utils;

pub mod autobahn_executor {
use solana_sdk::declare_id;
declare_id!("AutobNFLMzX1rFCDgwWpwr3ztG5c1oDbSrGq7Jj2LgE");
}
8 changes: 1 addition & 7 deletions programs/autobahn-executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ use solana_program::{account_info::AccountInfo, pubkey::Pubkey};
#[cfg(not(feature = "no-entrypoint"))]
use solana_program::entrypoint;

declare_id!("EXECM4wjzdCnrtQjHx5hy1r5k31tdvWBPYbqsjSoPfAh");

mod mango_owner {
use solana_program::declare_id;

declare_id!("EXECM4wjzdCnrtQjHx5hy1r5k31tdvWBPYbqsjSoPfAh"); // TODO
}
declare_id!("AutobNFLMzX1rFCDgwWpwr3ztG5c1oDbSrGq7Jj2LgE");

#[cfg(not(feature = "no-entrypoint"))]
entrypoint!(process_instruction);
Expand Down
8 changes: 4 additions & 4 deletions programs/autobahn-executor/src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ pub struct ReferrerWithdrawLog {
pub amount: u64,
}

pub const PLATFORM_FEE_LOG_DISCRIMINANT: [u8; 8] = [119, 229, 218, 14, 28, 173, 136, 115];
pub const REFERRER_FEE_LOG_DISCRIMINANT: [u8; 8] = [39, 182, 211, 59, 132, 55, 92, 254];
pub const REFERRER_WITHDRAW_LOG_DISCRIMINANT: [u8; 8] = [104, 148, 159, 252, 157, 185, 225, 186];
pub const SWAP_EVENT_DISCRIMINANT: [u8; 8] = [240, 219, 172, 202, 36, 10, 7, 123];
pub const PLATFORM_FEE_LOG_DISCRIMINANT: [u8; 8] = [160, 183, 104, 34, 255, 190, 119, 188];
pub const REFERRER_FEE_LOG_DISCRIMINANT: [u8; 8] = [198, 149, 221, 27, 28, 103, 76, 95];
pub const REFERRER_WITHDRAW_LOG_DISCRIMINANT: [u8; 8] = [25, 7, 239, 41, 67, 36, 141, 92];
pub const SWAP_EVENT_DISCRIMINANT: [u8; 8] = [56, 178, 48, 245, 42, 152, 27, 75];

discriminant!(
PlatformFeeLog,
Expand Down

0 comments on commit dd34dbf

Please sign in to comment.