Skip to content

Commit edbb89e

Browse files
committed
solana: use confirmed finality in tilt
1 parent 70adb10 commit edbb89e

File tree

1 file changed

+11
-1
lines changed
  • solana/programs/example-native-token-transfers/src/transceivers/wormhole

1 file changed

+11
-1
lines changed

solana/programs/example-native-token-transfers/src/transceivers/wormhole/accounts.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ use anchor_lang::prelude::*;
33
use wormhole_anchor_sdk::wormhole;
44
use wormhole_io::TypePrefixedPayload;
55

6+
cfg_if::cfg_if! {
7+
if #[cfg(feature = "tilt-devnet2")] {
8+
const FINALITY: wormhole::Finality = wormhole::Finality::Confirmed;
9+
} else if #[cfg(feature = "tilt-devnet")] {
10+
const FINALITY: wormhole::Finality = wormhole::Finality::Confirmed;
11+
} else {
12+
const FINALITY: wormhole::Finality = wormhole::Finality::Finalized;
13+
}
14+
}
15+
616
// TODO: should we add emitter in here too?
717
#[derive(Accounts)]
818
pub struct WormholeAccounts<'info> {
@@ -62,7 +72,7 @@ pub fn post_message<'info, A: TypePrefixedPayload>(
6272
CpiContext::new_with_signer(wormhole.program.to_account_info(), ix, &seeds.concat()),
6373
batch_id,
6474
TypePrefixedPayload::to_vec_payload(payload),
65-
wormhole::Finality::Finalized,
75+
FINALITY,
6676
)?;
6777

6878
Ok(())

0 commit comments

Comments
 (0)