Add tests for different deposit inputs
@@ -43,14 +43,23 @@ fn test_deposit_in_empty_leaf() {
#[test]
#[ignore]
fn test_deposit_existing_account() {
+ // Data for building a test vector: tuples of (token_id, amount).
+ let test_vector = vec![
+ (0, 1), // Small deposit in ETH.
+ (0, 0), // 0 deposit in ETH.
+ (0, std::u64::MAX), // Big amount in ETH.
+ (2, 1), // Non-ETH token.
+ ];
+
+ for (token_id, token_amount) in test_vector {
// Input data.
let accounts = vec![WitnessTestAccount::new_empty(1)];
let account = &accounts[0];
let deposit_op = DepositOp {
priority_op: Deposit {
from: account.account.address,
- token: 0,
- amount: BigDecimal::from(1),
+ token: token_id,
+ amount: BigDecimal::from(token_amount),
to: account.account.address,
},
account_id: account.id,
@@ -66,3 +75,4 @@ fn test_deposit_existing_account() {
},
);
}
+}
