Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Solana] Load balance treasury #1267

Merged
merged 22 commits into from
Feb 1, 2024
Prev Previous commit
Next Next commit
Another test
  • Loading branch information
guibescos committed Jan 30, 2024
commit e01e64b52ef8d78afe9d4e36a452da4adce5732f
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,29 @@ async fn test_post_updates_atomic_wrong_vaa() {
let poster = program_simulator.get_funded_keypair().await.unwrap();
let price_update_keypair = Keypair::new();

let mut vaa_buffer_copy: Vec<u8> = vaa.clone();
// Mess up with the length of signatures
vaa_buffer_copy[5] = 255;
assert_eq!(
program_simulator
.process_ix(
PostUpdatesAtomic::populate(
poster.pubkey(),
price_update_keypair.pubkey(),
BRIDGE_ID,
DEFAULT_GUARDIAN_SET_INDEX,
vaa_buffer_copy,
merkle_price_updates[0].clone(),
),
&vec![&poster, &price_update_keypair],
None,
)
.await
.unwrap_err()
.unwrap(),
into_transation_error(ReceiverError::DeserializeVaaFailed)
);

let vaa_wrong_num_signatures = serde_wormhole::to_vec(&trim_vaa_signatures(
serde_wormhole::from_slice(&vaa).unwrap(),
4,
Expand All @@ -167,6 +190,7 @@ async fn test_post_updates_atomic_wrong_vaa() {
into_transation_error(ReceiverError::InsufficientGuardianSignatures)
);


let mut vaa_copy: Vaa<&RawMessage> = serde_wormhole::from_slice(&vaa).unwrap();
vaa_copy.version = 0;

Expand Down
Loading