Skip to content

Commit

Permalink
solana: use confirmed finality in tilt
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-gray committed Dec 4, 2024
1 parent 70adb10 commit edbb89e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ use anchor_lang::prelude::*;
use wormhole_anchor_sdk::wormhole;
use wormhole_io::TypePrefixedPayload;

cfg_if::cfg_if! {
if #[cfg(feature = "tilt-devnet2")] {
const FINALITY: wormhole::Finality = wormhole::Finality::Confirmed;
} else if #[cfg(feature = "tilt-devnet")] {
const FINALITY: wormhole::Finality = wormhole::Finality::Confirmed;
} else {
const FINALITY: wormhole::Finality = wormhole::Finality::Finalized;
}
}

// TODO: should we add emitter in here too?
#[derive(Accounts)]
pub struct WormholeAccounts<'info> {
Expand Down Expand Up @@ -62,7 +72,7 @@ pub fn post_message<'info, A: TypePrefixedPayload>(
CpiContext::new_with_signer(wormhole.program.to_account_info(), ix, &seeds.concat()),
batch_id,
TypePrefixedPayload::to_vec_payload(payload),
wormhole::Finality::Finalized,
FINALITY,
)?;

Ok(())
Expand Down

0 comments on commit edbb89e

Please sign in to comment.