lint fixes

This commit is contained in:
jonesmarvin8 2026-03-18 13:10:36 -04:00
parent 0bcb626adc
commit 5d9980cf63
33 changed files with 144 additions and 141 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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(),
},
),
],

View File

@ -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);

View File

@ -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();

View File

@ -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(

View File

@ -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();

View File

@ -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());

View File

@ -63,7 +63,7 @@ impl From<Program> 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<AccountWithMetadata>,
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(),
};

View File

@ -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 =

View File

@ -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,
);

View File

@ -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 {

View File

@ -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();

View File

@ -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(),

View File

@ -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<Nonce> {
let mut result = vec![[0; 16]; size];
for bytes in &mut result {