From 9fb55a75d69a7bc6b9566e3889d1201a6808a4cc Mon Sep 17 00:00:00 2001 From: Moudy Date: Fri, 3 Apr 2026 15:40:55 +0200 Subject: [PATCH] fix: ordering of items and allow large_enum_variant in test module --- nssa/src/state.rs | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/nssa/src/state.rs b/nssa/src/state.rs index 9b56bcc1..51db4144 100644 --- a/nssa/src/state.rs +++ b/nssa/src/state.rs @@ -3469,22 +3469,12 @@ pub mod tests { } } - #[test] - fn state_serialization_roundtrip() { - let account_id_1 = AccountId::new([1; 32]); - let account_id_2 = AccountId::new([2; 32]); - let initial_data = [(account_id_1, 100_u128), (account_id_2, 151_u128)]; - let state = V03State::new_with_genesis_accounts(&initial_data, &[]).with_test_programs(); - let bytes = borsh::to_vec(&state).unwrap(); - let state_from_bytes: V03State = borsh::from_slice(&bytes).unwrap(); - assert_eq!(state, state_from_bytes); - } - // ── Flash Swap integration tests ────────────────────────────────────────── /// Mirror of the guest `FlashSwapInstruction` enum so we can serialise /// instructions on the host side. #[derive(serde::Serialize, serde::Deserialize)] + #[allow(clippy::large_enum_variant)] enum FlashSwapInstruction { Initiate { token_program_id: ProgramId, @@ -3531,6 +3521,17 @@ pub mod tests { PublicTransaction::new(message, witness_set) } + #[test] + fn state_serialization_roundtrip() { + let account_id_1 = AccountId::new([1; 32]); + let account_id_2 = AccountId::new([2; 32]); + let initial_data = [(account_id_1, 100_u128), (account_id_2, 151_u128)]; + let state = V03State::new_with_genesis_accounts(&initial_data, &[]).with_test_programs(); + let bytes = borsh::to_vec(&state).unwrap(); + let state_from_bytes: V03State = borsh::from_slice(&bytes).unwrap(); + assert_eq!(state, state_from_bytes); + } + #[test] fn flash_swap_successful() { let initiator = Program::flash_swap_initiator();