diff --git a/artifacts/program_methods/amm.bin b/artifacts/program_methods/amm.bin index f058acd6..0bce4ce1 100644 Binary files a/artifacts/program_methods/amm.bin and b/artifacts/program_methods/amm.bin differ diff --git a/artifacts/program_methods/authenticated_transfer.bin b/artifacts/program_methods/authenticated_transfer.bin index 88ddb2c5..d3952da8 100644 Binary files a/artifacts/program_methods/authenticated_transfer.bin and b/artifacts/program_methods/authenticated_transfer.bin differ diff --git a/artifacts/program_methods/pinata.bin b/artifacts/program_methods/pinata.bin index bf6b7a5e..2e802fc0 100644 Binary files a/artifacts/program_methods/pinata.bin and b/artifacts/program_methods/pinata.bin differ diff --git a/artifacts/program_methods/pinata_token.bin b/artifacts/program_methods/pinata_token.bin index c4b23989..d8818101 100644 Binary files a/artifacts/program_methods/pinata_token.bin and b/artifacts/program_methods/pinata_token.bin differ diff --git a/artifacts/program_methods/privacy_preserving_circuit.bin b/artifacts/program_methods/privacy_preserving_circuit.bin index 4a7b82c0..eed66cc3 100644 Binary files a/artifacts/program_methods/privacy_preserving_circuit.bin and b/artifacts/program_methods/privacy_preserving_circuit.bin differ diff --git a/artifacts/program_methods/token.bin b/artifacts/program_methods/token.bin index 7c116318..92132980 100644 Binary files a/artifacts/program_methods/token.bin and b/artifacts/program_methods/token.bin differ diff --git a/artifacts/test_program_methods/burner.bin b/artifacts/test_program_methods/burner.bin index 514166ff..4deadc9b 100644 Binary files a/artifacts/test_program_methods/burner.bin and b/artifacts/test_program_methods/burner.bin differ diff --git a/artifacts/test_program_methods/chain_caller.bin b/artifacts/test_program_methods/chain_caller.bin index 6e3c3ae4..edc65622 100644 Binary files a/artifacts/test_program_methods/chain_caller.bin and b/artifacts/test_program_methods/chain_caller.bin differ diff --git a/artifacts/test_program_methods/changer_claimer.bin b/artifacts/test_program_methods/changer_claimer.bin index 9e3a452d..feaff12a 100644 Binary files a/artifacts/test_program_methods/changer_claimer.bin and b/artifacts/test_program_methods/changer_claimer.bin differ diff --git a/artifacts/test_program_methods/claimer.bin b/artifacts/test_program_methods/claimer.bin index 8b7c04b0..1f7896fa 100644 Binary files a/artifacts/test_program_methods/claimer.bin and b/artifacts/test_program_methods/claimer.bin differ diff --git a/artifacts/test_program_methods/data_changer.bin b/artifacts/test_program_methods/data_changer.bin index 861b7be4..0a17f04a 100644 Binary files a/artifacts/test_program_methods/data_changer.bin and b/artifacts/test_program_methods/data_changer.bin differ diff --git a/artifacts/test_program_methods/extra_output.bin b/artifacts/test_program_methods/extra_output.bin index 758ae8a2..5575c386 100644 Binary files a/artifacts/test_program_methods/extra_output.bin and b/artifacts/test_program_methods/extra_output.bin differ diff --git a/artifacts/test_program_methods/malicious_authorization_changer.bin b/artifacts/test_program_methods/malicious_authorization_changer.bin index 33e01400..99466620 100644 Binary files a/artifacts/test_program_methods/malicious_authorization_changer.bin and b/artifacts/test_program_methods/malicious_authorization_changer.bin differ diff --git a/artifacts/test_program_methods/minter.bin b/artifacts/test_program_methods/minter.bin index 20781cba..f8e0e771 100644 Binary files a/artifacts/test_program_methods/minter.bin and b/artifacts/test_program_methods/minter.bin differ diff --git a/artifacts/test_program_methods/missing_output.bin b/artifacts/test_program_methods/missing_output.bin index 95b412b6..1396706f 100644 Binary files a/artifacts/test_program_methods/missing_output.bin and b/artifacts/test_program_methods/missing_output.bin differ diff --git a/artifacts/test_program_methods/modified_transfer.bin b/artifacts/test_program_methods/modified_transfer.bin index 7b7438ee..d9a68638 100644 Binary files a/artifacts/test_program_methods/modified_transfer.bin and b/artifacts/test_program_methods/modified_transfer.bin differ diff --git a/artifacts/test_program_methods/nonce_changer.bin b/artifacts/test_program_methods/nonce_changer.bin index 97b23f93..acbcaf38 100644 Binary files a/artifacts/test_program_methods/nonce_changer.bin and b/artifacts/test_program_methods/nonce_changer.bin differ diff --git a/artifacts/test_program_methods/noop.bin b/artifacts/test_program_methods/noop.bin index e487da6b..aa9d7f38 100644 Binary files a/artifacts/test_program_methods/noop.bin and b/artifacts/test_program_methods/noop.bin differ diff --git a/artifacts/test_program_methods/program_owner_changer.bin b/artifacts/test_program_methods/program_owner_changer.bin index d318cbda..de689c22 100644 Binary files a/artifacts/test_program_methods/program_owner_changer.bin and b/artifacts/test_program_methods/program_owner_changer.bin differ diff --git a/artifacts/test_program_methods/simple_balance_transfer.bin b/artifacts/test_program_methods/simple_balance_transfer.bin index ca22e0f5..e02e649d 100644 Binary files a/artifacts/test_program_methods/simple_balance_transfer.bin and b/artifacts/test_program_methods/simple_balance_transfer.bin differ diff --git a/integration_tests/src/config.rs b/integration_tests/src/config.rs index b88fd65c..4d8539cc 100644 --- a/integration_tests/src/config.rs +++ b/integration_tests/src/config.rs @@ -86,7 +86,7 @@ impl InitialData { balance: 10_000, data: Data::default(), program_owner: DEFAULT_PROGRAM_ID, - nonce: 0u128.into(), + nonce: 0_u128.into(), }, ), ( @@ -95,7 +95,7 @@ impl InitialData { balance: 20_000, data: Data::default(), program_owner: DEFAULT_PROGRAM_ID, - nonce: 0u128.into(), + nonce: 0_u128.into(), }, ), ], diff --git a/integration_tests/tests/wallet_ffi.rs b/integration_tests/tests/wallet_ffi.rs index 277a2da2..a32e4d98 100644 --- a/integration_tests/tests/wallet_ffi.rs +++ b/integration_tests/tests/wallet_ffi.rs @@ -528,7 +528,7 @@ fn test_wallet_ffi_get_account_private() -> Result<()> { ); assert_eq!(account.balance, 10000); assert!(account.data.is_empty()); - assert_eq!(account.nonce, 0u128.into()); + assert_eq!(account.nonce, 0_u128.into()); unsafe { wallet_ffi_free_account_data(&raw mut out_account); diff --git a/nssa/core/src/account.rs b/nssa/core/src/account.rs index fd62628f..b7dc8cc7 100644 --- a/nssa/core/src/account.rs +++ b/nssa/core/src/account.rs @@ -256,7 +256,7 @@ mod tests { .to_vec() .try_into() .unwrap(), - nonce: Nonce(0xdeadbeef), + nonce: Nonce(0xdead_beef), }; let fingerprint = AccountId::new([8; 32]); let new_acc_with_metadata = AccountWithMetadata::new(account.clone(), true, fingerprint); @@ -308,22 +308,22 @@ mod tests { fn initialize_private_nonce() { let npk = NullifierPublicKey([42; 32]); let nonce = Nonce::private_account_nonce_init(&npk); - let expected_nonce = Nonce(37937661125547691021612781941709513486); + let expected_nonce = Nonce(37_937_661_125_547_691_021_612_781_941_709_513_486); assert_eq!(nonce, expected_nonce); } #[test] fn increment_private_nonce() { - let nsk: NullifierSecretKey = [42u8; 32]; + let nsk: NullifierSecretKey = [42_u8; 32]; let nonce = - Nonce(37937661125547691021612781941709513486).private_account_nonce_increment(&nsk); - let expected_nonce = Nonce(327300903218789900388409116014290259894); + Nonce(37_937_661_125_547_691_021_612_781_941_709_513_486).private_account_nonce_increment(&nsk); + let expected_nonce = Nonce(327_300_903_218_789_900_388_409_116_014_290_259_894); assert_eq!(nonce, expected_nonce); } #[test] fn increment_public_nonce() { - let value = 42u128; + let value = 42_u128; let mut nonce = Nonce(value); nonce.public_account_nonce_increment(); let expected_nonce = Nonce(value + 1); @@ -331,8 +331,8 @@ mod tests { } #[test] - fn test_serde_roundtrip_for_nonce() { - let nonce: Nonce = 7u128.into(); + fn serde_roundtrip_for_nonce() { + let nonce: Nonce = 7_u128.into(); let serde_serialized_nonce = serde_json::to_vec(&nonce).unwrap(); @@ -342,8 +342,8 @@ mod tests { } #[test] - fn test_borsh_roundtrip_for_nonce() { - let nonce: Nonce = 7u128.into(); + fn borsh_roundtrip_for_nonce() { + let nonce: Nonce = 7_u128.into(); let borsh_serialized_nonce = borsh::to_vec(&nonce).unwrap(); diff --git a/nssa/core/src/circuit_io.rs b/nssa/core/src/circuit_io.rs index b916b3b1..56d63022 100644 --- a/nssa/core/src/circuit_io.rs +++ b/nssa/core/src/circuit_io.rs @@ -67,7 +67,7 @@ mod tests { program_owner: [1, 2, 3, 4, 5, 6, 7, 8], balance: 12_345_678_901_234_567_890, data: b"test data".to_vec().try_into().unwrap(), - nonce: Nonce(18446744073709551614), + nonce: Nonce(0xFFFF_FFFF_FFFF_FFFE), }, true, AccountId::new([0; 32]), @@ -77,7 +77,7 @@ mod tests { program_owner: [9, 9, 9, 8, 8, 8, 7, 7], balance: 123_123_123_456_456_567_112, data: b"test data".to_vec().try_into().unwrap(), - nonce: Nonce(9999999999999999999999), + nonce: Nonce(9_999_999_999_999_999_999_999), }, false, AccountId::new([1; 32]), @@ -87,7 +87,7 @@ mod tests { program_owner: [1, 2, 3, 4, 5, 6, 7, 8], balance: 100, data: b"post state data".to_vec().try_into().unwrap(), - nonce: Nonce(18446744073709551615), + nonce: Nonce(0xFFFF_FFFF_FFFF_FFFF), }], ciphertexts: vec![Ciphertext(vec![255, 255, 1, 1, 2, 2])], new_commitments: vec![Commitment::new( diff --git a/nssa/core/src/encoding.rs b/nssa/core/src/encoding.rs index f4c7931d..ac9317c2 100644 --- a/nssa/core/src/encoding.rs +++ b/nssa/core/src/encoding.rs @@ -188,8 +188,8 @@ mod tests { fn enconding() { let account = Account { program_owner: [1, 2, 3, 4, 5, 6, 7, 8], - balance: 123456789012345678901234567890123456, - nonce: 42u128.into(), + balance: 123_456_789_012_345_678_901_234_567_890_123_456, + nonce: 42_u128.into(), data: b"hola mundo".to_vec().try_into().unwrap(), }; @@ -249,8 +249,8 @@ mod tests { fn account_to_bytes_roundtrip() { let account = Account { program_owner: [1, 2, 3, 4, 5, 6, 7, 8], - balance: 123456789012345678901234567890123456, - nonce: 42u128.into(), + balance: 123_456_789_012_345_678_901_234_567_890_123_456, + nonce: 42_u128.into(), data: b"hola mundo".to_vec().try_into().unwrap(), }; let bytes = account.to_bytes(); diff --git a/nssa/core/src/program.rs b/nssa/core/src/program.rs index a519d989..31b76b0f 100644 --- a/nssa/core/src/program.rs +++ b/nssa/core/src/program.rs @@ -348,7 +348,7 @@ mod tests { program_owner: [1, 2, 3, 4, 5, 6, 7, 8], balance: 1337, data: vec![0xde, 0xad, 0xbe, 0xef].try_into().unwrap(), - nonce: 10u128.into(), + nonce: 10_u128.into(), }; let account_post_state = AccountPostState::new_claimed(account.clone()); @@ -363,7 +363,7 @@ mod tests { program_owner: [1, 2, 3, 4, 5, 6, 7, 8], balance: 1337, data: vec![0xde, 0xad, 0xbe, 0xef].try_into().unwrap(), - nonce: 10u128.into(), + nonce: 10_u128.into(), }; let account_post_state = AccountPostState::new(account.clone()); @@ -378,7 +378,7 @@ mod tests { program_owner: [1, 2, 3, 4, 5, 6, 7, 8], balance: 1337, data: vec![0xde, 0xad, 0xbe, 0xef].try_into().unwrap(), - nonce: 10u128.into(), + nonce: 10_u128.into(), }; let mut account_post_state = AccountPostState::new(account.clone()); diff --git a/nssa/src/privacy_preserving_transaction/circuit.rs b/nssa/src/privacy_preserving_transaction/circuit.rs index ee312dc5..2ab141a3 100644 --- a/nssa/src/privacy_preserving_transaction/circuit.rs +++ b/nssa/src/privacy_preserving_transaction/circuit.rs @@ -63,7 +63,7 @@ impl From for ProgramWithDependencies { /// Generates a proof of the execution of a NSSA program inside the privacy preserving execution /// circuit. -#[expect(clippy::too_many_arguments, reason = "TODO: fix later")] +/// TODO: too many parameters. pub fn execute_and_prove( pre_states: Vec, instruction_data: InstructionData, @@ -220,7 +220,7 @@ mod tests { let expected_recipient_post = Account { program_owner: program.id(), balance: balance_to_move, - nonce: Nonce(0xdead_beef), + nonce: Nonce::private_account_nonce_init(&recipient_keys.npk()), data: Data::default(), }; diff --git a/nssa/src/public_transaction/transaction.rs b/nssa/src/public_transaction/transaction.rs index a6ab5fba..a2460e49 100644 --- a/nssa/src/public_transaction/transaction.rs +++ b/nssa/src/public_transaction/transaction.rs @@ -269,7 +269,7 @@ pub mod tests { fn transaction_for_tests() -> PublicTransaction { let (key1, key2, addr1, addr2) = keys_for_tests(); - let nonces = vec![0u128.into(), 0u128.into()]; + let nonces = vec![0_u128.into(), 0_u128.into()]; let instruction = 1337; let message = Message::try_new( Program::authenticated_transfer_program().id(), @@ -347,7 +347,7 @@ pub mod tests { fn account_id_list_cant_have_duplicates() { let (key1, _, addr1, _) = keys_for_tests(); let state = state_for_tests(); - let nonces = vec![0u128.into(), 0u128.into()]; + let nonces = vec![0_u128.into(), 0_u128.into()]; let instruction = 1337; let message = Message::try_new( Program::authenticated_transfer_program().id(), @@ -367,7 +367,7 @@ pub mod tests { fn number_of_nonces_must_match_number_of_signatures() { let (key1, key2, addr1, addr2) = keys_for_tests(); let state = state_for_tests(); - let nonces = vec![0u128.into()]; + let nonces = vec![0_u128.into()]; let instruction = 1337; let message = Message::try_new( Program::authenticated_transfer_program().id(), @@ -387,7 +387,7 @@ pub mod tests { fn all_signatures_must_be_valid() { let (key1, key2, addr1, addr2) = keys_for_tests(); let state = state_for_tests(); - let nonces = vec![0u128.into(), 0u128.into()]; + let nonces = vec![0_u128.into(), 0_u128.into()]; let instruction = 1337; let message = Message::try_new( Program::authenticated_transfer_program().id(), @@ -408,7 +408,7 @@ pub mod tests { fn nonces_must_match_the_state_current_nonces() { let (key1, key2, addr1, addr2) = keys_for_tests(); let state = state_for_tests(); - let nonces = vec![0u128.into(), 1u128.into()]; + let nonces = vec![0_u128.into(), 1u128.into()]; let instruction = 1337; let message = Message::try_new( Program::authenticated_transfer_program().id(), @@ -428,7 +428,7 @@ pub mod tests { fn program_id_must_belong_to_bulitin_program_ids() { let (key1, key2, addr1, addr2) = keys_for_tests(); let state = state_for_tests(); - let nonces = vec![0u128.into(), 0u128.into()]; + let nonces = vec![0_u128.into(), 0_u128.into()]; let instruction = 1337; let unknown_program_id = [0xdead_beef; 8]; let message = diff --git a/nssa/src/state.rs b/nssa/src/state.rs index f45d7aa3..8ae26e74 100644 --- a/nssa/src/state.rs +++ b/nssa/src/state.rs @@ -2117,10 +2117,12 @@ pub mod tests { #[test] fn private_accounts_can_only_be_initialized_once() { let sender_keys = test_private_account_keys_1(); + let sender_nonce = Nonce(0xdead_beef); + let sender_private_account = Account { program_owner: Program::authenticated_transfer_program().id(), balance: 100, - nonce: Nonce(0xdead_beef), + nonce: sender_nonce, data: Data::default(), }; let recipient_keys = test_private_account_keys_2(); @@ -2129,6 +2131,7 @@ pub mod tests { .with_private_account(&sender_keys, &sender_private_account); let balance_to_move = 37; + let balance_to_move_2 = 30; let tx = private_balance_transfer_for_tests( &sender_keys, @@ -2144,8 +2147,8 @@ pub mod tests { let sender_private_account = Account { program_owner: Program::authenticated_transfer_program().id(), - balance: 100 - balance_to_move, - nonce: Nonce(0xdeaf_beef), + balance: 100, + nonce: sender_nonce, data: Data::default(), }; @@ -2153,7 +2156,7 @@ pub mod tests { &sender_keys, &sender_private_account, &recipient_keys, - balance_to_move, + balance_to_move_2, &state, ); diff --git a/program_methods/guest/src/bin/privacy_preserving_circuit.rs b/program_methods/guest/src/bin/privacy_preserving_circuit.rs index c2b07ef8..bddf2121 100644 --- a/program_methods/guest/src/bin/privacy_preserving_circuit.rs +++ b/program_methods/guest/src/bin/privacy_preserving_circuit.rs @@ -278,7 +278,7 @@ fn compute_circuit_output( let new_nonce = pre_state .account .nonce - .private_account_nonce_increment(&nsk); + .private_account_nonce_increment(nsk); (new_nullifier, new_nonce) } else { diff --git a/programs/amm/src/tests.rs b/programs/amm/src/tests.rs index ac2090f5..e1e8698d 100644 --- a/programs/amm/src/tests.rs +++ b/programs/amm/src/tests.rs @@ -446,7 +446,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_a_definition_id(), balance: BalanceForTests::user_token_a_balance(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::user_token_a_id(), @@ -462,7 +462,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_b_definition_id(), balance: BalanceForTests::user_token_b_balance(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::user_token_b_id(), @@ -478,7 +478,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_a_definition_id(), balance: BalanceForTests::vault_a_reserve_init(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_a_id(), @@ -494,7 +494,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_b_definition_id(), balance: BalanceForTests::vault_b_reserve_init(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_b_id(), @@ -510,7 +510,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_a_definition_id(), balance: BalanceForTests::vault_a_reserve_high(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_a_id(), @@ -526,7 +526,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_b_definition_id(), balance: BalanceForTests::vault_b_reserve_high(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_b_id(), @@ -542,7 +542,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_a_definition_id(), balance: BalanceForTests::vault_a_reserve_low(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_a_id(), @@ -558,7 +558,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_b_definition_id(), balance: BalanceForTests::vault_b_reserve_low(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_b_id(), @@ -574,7 +574,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_a_definition_id(), balance: 0, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_a_id(), @@ -590,7 +590,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_b_definition_id(), balance: 0, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_b_id(), @@ -607,7 +607,7 @@ impl AccountWithMetadataForTests { total_supply: BalanceForTests::lp_supply_init(), metadata_id: None, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::token_lp_definition_id(), @@ -624,7 +624,7 @@ impl AccountWithMetadataForTests { total_supply: BalanceForTests::lp_supply_init(), metadata_id: None, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::vault_a_id(), @@ -640,7 +640,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_lp_definition_id(), balance: 0, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::user_token_lp_id(), @@ -656,7 +656,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_lp_definition_id(), balance: BalanceForTests::user_token_lp_balance(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::user_token_lp_id(), @@ -680,7 +680,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -704,7 +704,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -728,7 +728,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -752,7 +752,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -776,7 +776,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -800,7 +800,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -824,7 +824,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -848,7 +848,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -872,7 +872,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -896,7 +896,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -920,7 +920,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: false, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -944,7 +944,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: false, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: AccountId::new([4; 32]), @@ -960,7 +960,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_a_definition_id(), balance: BalanceForTests::vault_a_reserve_init(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: AccountId::new([4; 32]), @@ -976,7 +976,7 @@ impl AccountWithMetadataForTests { definition_id: IdForTests::token_b_definition_id(), balance: BalanceForTests::vault_b_reserve_init(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: AccountId::new([4; 32]), @@ -1000,7 +1000,7 @@ impl AccountWithMetadataForTests { fees: 0_u128, active: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -1239,7 +1239,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::user_token_a_holding_init(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1251,7 +1251,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::user_token_b_holding_init(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1271,7 +1271,7 @@ impl AccountsForExeTests { fees: 0_u128, active: true, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1284,7 +1284,7 @@ impl AccountsForExeTests { total_supply: BalanceForExeTests::token_a_supply(), metadata_id: None, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1297,7 +1297,7 @@ impl AccountsForExeTests { total_supply: BalanceForExeTests::token_b_supply(), metadata_id: None, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1310,7 +1310,7 @@ impl AccountsForExeTests { total_supply: BalanceForExeTests::token_lp_supply(), metadata_id: None, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1322,7 +1322,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::vault_a_balance_init(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1334,7 +1334,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::vault_b_balance_init(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1346,7 +1346,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_lp_definition_id(), balance: BalanceForExeTests::user_token_lp_holding_init(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1358,7 +1358,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::vault_a_balance_swap_1(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1370,7 +1370,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::vault_b_balance_swap_1(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1390,7 +1390,7 @@ impl AccountsForExeTests { fees: 0_u128, active: true, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1402,7 +1402,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::user_token_a_holding_swap_1(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1414,7 +1414,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::user_token_b_holding_swap_1(), }), - nonce: 1, + nonce: 1_u128.into(), } } @@ -1426,7 +1426,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::vault_a_balance_swap_2(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1438,7 +1438,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::vault_b_balance_swap_2(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1458,7 +1458,7 @@ impl AccountsForExeTests { fees: 0_u128, active: true, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1470,7 +1470,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::user_token_a_holding_swap_2(), }), - nonce: 1, + nonce: 1_u128.into(), } } @@ -1482,7 +1482,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::user_token_b_holding_swap_2(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1494,7 +1494,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::vault_a_balance_add(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1506,7 +1506,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::vault_b_balance_add(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1526,7 +1526,7 @@ impl AccountsForExeTests { fees: 0_u128, active: true, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1538,7 +1538,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::user_token_a_holding_add(), }), - nonce: 1, + nonce: 1_u128.into(), } } @@ -1550,7 +1550,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::user_token_b_holding_add(), }), - nonce: 1, + nonce: 1_u128.into(), } } @@ -1562,7 +1562,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_lp_definition_id(), balance: BalanceForExeTests::user_token_lp_holding_add(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1575,7 +1575,7 @@ impl AccountsForExeTests { total_supply: BalanceForExeTests::token_lp_supply_add(), metadata_id: None, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1587,7 +1587,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::vault_a_balance_remove(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1599,7 +1599,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::vault_b_balance_remove(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1619,7 +1619,7 @@ impl AccountsForExeTests { fees: 0_u128, active: true, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1631,7 +1631,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::user_token_a_holding_remove(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1643,7 +1643,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::user_token_b_holding_remove(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1655,7 +1655,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_lp_definition_id(), balance: BalanceForExeTests::user_token_lp_holding_remove(), }), - nonce: 1, + nonce: 1_u128.into(), } } @@ -1668,7 +1668,7 @@ impl AccountsForExeTests { total_supply: BalanceForExeTests::token_lp_supply_remove(), metadata_id: None, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1681,7 +1681,7 @@ impl AccountsForExeTests { total_supply: 0, metadata_id: None, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1693,7 +1693,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: 0, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1705,7 +1705,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: 0, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1725,7 +1725,7 @@ impl AccountsForExeTests { fees: 0_u128, active: false, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1737,7 +1737,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_a_definition_id(), balance: BalanceForExeTests::user_token_a_holding_new_definition(), }), - nonce: 1, + nonce: 1_u128.into(), } } @@ -1749,7 +1749,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_b_definition_id(), balance: BalanceForExeTests::user_token_b_holding_new_definition(), }), - nonce: 1, + nonce: 1_u128.into(), } } @@ -1761,7 +1761,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_lp_definition_id(), balance: BalanceForExeTests::lp_supply_init(), }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1774,7 +1774,7 @@ impl AccountsForExeTests { total_supply: BalanceForExeTests::lp_supply_init(), metadata_id: None, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1794,7 +1794,7 @@ impl AccountsForExeTests { fees: 0_u128, active: true, }), - nonce: 0, + nonce: 0_u128.into(), } } @@ -1806,7 +1806,7 @@ impl AccountsForExeTests { definition_id: IdForExeTests::token_lp_definition_id(), balance: 0, }), - nonce: 0, + nonce: 0_u128.into(), } } } @@ -2730,7 +2730,7 @@ fn simple_amm_remove() { IdForExeTests::user_token_b_id(), IdForExeTests::user_token_lp_id(), ], - vec![0], + vec![0_u128.into()], instruction, ) .unwrap(); @@ -2808,7 +2808,7 @@ fn simple_amm_new_definition_inactive_initialized_pool_and_uninit_user_lp() { IdForExeTests::user_token_b_id(), IdForExeTests::user_token_lp_id(), ], - vec![0, 0], + vec![0_u128.into(), 0_u128.into()], instruction, ) .unwrap(); @@ -2893,7 +2893,7 @@ fn simple_amm_new_definition_inactive_initialized_pool_init_user_lp() { IdForExeTests::user_token_b_id(), IdForExeTests::user_token_lp_id(), ], - vec![0, 0], + vec![0_u128.into(), 0_u128.into()], instruction, ) .unwrap(); @@ -2966,7 +2966,7 @@ fn simple_amm_new_definition_uninitialized_pool() { IdForExeTests::user_token_b_id(), IdForExeTests::user_token_lp_id(), ], - vec![0, 0], + vec![0_u128.into(), 0_u128.into()], instruction, ) .unwrap(); @@ -3029,7 +3029,7 @@ fn simple_amm_add() { IdForExeTests::user_token_b_id(), IdForExeTests::user_token_lp_id(), ], - vec![0, 0], + vec![0_u128.into(), 0_u128.into()], instruction, ) .unwrap(); @@ -3090,7 +3090,7 @@ fn simple_amm_swap_1() { IdForExeTests::user_token_a_id(), IdForExeTests::user_token_b_id(), ], - vec![0], + vec![0_u128.into()], instruction, ) .unwrap(); @@ -3141,7 +3141,7 @@ fn simple_amm_swap_2() { IdForExeTests::user_token_a_id(), IdForExeTests::user_token_b_id(), ], - vec![0], + vec![0_u128.into()], instruction, ) .unwrap(); diff --git a/programs/token/src/tests.rs b/programs/token/src/tests.rs index 29bcd90b..640d6d76 100644 --- a/programs/token/src/tests.rs +++ b/programs/token/src/tests.rs @@ -37,7 +37,7 @@ impl AccountForTests { total_supply: BalanceForTests::init_supply(), metadata_id: None, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -54,7 +54,7 @@ impl AccountForTests { total_supply: BalanceForTests::init_supply(), metadata_id: None, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: false, account_id: IdForTests::pool_definition_id(), @@ -70,7 +70,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id_diff(), balance: BalanceForTests::holding_balance(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -86,7 +86,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::holding_balance(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -102,7 +102,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::holding_balance(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: false, account_id: IdForTests::holding_id(), @@ -118,7 +118,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::init_supply(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: false, account_id: IdForTests::holding_id(), @@ -135,7 +135,7 @@ impl AccountForTests { total_supply: BalanceForTests::init_supply_burned(), metadata_id: None, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -151,7 +151,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::holding_balance_burned(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: false, account_id: IdForTests::holding_id(), @@ -175,7 +175,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::mint_success(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: false, account_id: IdForTests::holding_id(), @@ -191,7 +191,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::holding_balance_mint(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -208,7 +208,7 @@ impl AccountForTests { total_supply: BalanceForTests::init_supply_mint(), metadata_id: None, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -224,7 +224,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::mint_overflow(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -241,7 +241,7 @@ impl AccountForTests { printable_supply: BalanceForTests::printable_copies(), metadata_id: AccountId::new([0; 32]), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -265,7 +265,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::init_supply(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -282,7 +282,7 @@ impl AccountForTests { total_supply: BalanceForTests::init_supply(), metadata_id: None, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::pool_definition_id(), @@ -298,7 +298,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::init_supply(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -314,7 +314,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::init_supply(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id_2(), @@ -330,7 +330,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::recipient_post_transfer(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id_2(), @@ -346,7 +346,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), balance: BalanceForTests::sender_post_transfer(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -362,7 +362,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), print_balance: BalanceForTests::printable_copies(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -378,7 +378,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), print_balance: 1, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -394,7 +394,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), print_balance: BalanceForTests::printable_copies() - 1, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), @@ -410,7 +410,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), owned: true, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: false, account_id: IdForTests::holding_id(), @@ -426,7 +426,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), print_balance: BalanceForTests::printable_copies(), }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id_2(), @@ -442,7 +442,7 @@ impl AccountForTests { definition_id: IdForTests::pool_definition_id(), print_balance: 0, }), - nonce: 0u128.into(), + nonce: 0_u128.into(), }, is_authorized: true, account_id: IdForTests::holding_id(), diff --git a/wallet/src/helperfunctions.rs b/wallet/src/helperfunctions.rs index bfa28970..74f7bab3 100644 --- a/wallet/src/helperfunctions.rs +++ b/wallet/src/helperfunctions.rs @@ -145,7 +145,7 @@ pub fn produce_data_for_storage( } } -#[expect(dead_code)] +#[expect(dead_code, reason = "Maybe used later")] pub(crate) fn produce_random_nonces(size: usize) -> Vec { let mut result = vec![[0; 16]; size]; for bytes in &mut result {