Skip to content

Commit

Permalink
refactoring actions_vec to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vivek-arte committed Oct 14, 2024
1 parent 9cc70bd commit 1f8b132
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions zcash_primitives/src/transaction/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,13 +1465,13 @@ mod tests {
let bundle = tx.issue_bundle().unwrap();

assert_eq!(bundle.actions().len(), 1, "There should be only one action");
let actions_vec = bundle.get_actions_by_desc(asset_desc);
let actions = bundle.get_actions_by_desc(asset_desc);
assert_eq!(
actions_vec.len(),
actions.len(),
1,
"The one action should correspond to asset_desc"
);
let action = actions_vec[0];
let action = actions[0];
assert!(action.is_finalized(), "Action should be finalized");
assert_eq!(action.notes().len(), 0, "Action should have zero notes");
}
Expand All @@ -1498,13 +1498,13 @@ mod tests {
let bundle = binding.issue_bundle().unwrap();

assert_eq!(bundle.actions().len(), 1, "There should be only one action");
let actions_vec = bundle.get_actions_by_desc(asset_desc);
let actions = bundle.get_actions_by_desc(asset_desc);
assert_eq!(
actions_vec.len(),
actions.len(),
1,
"The one action should correspond to asset_desc"
);
let action = actions_vec[0];
let action = actions[0];
assert!(!action.is_finalized(), "Action should not be finalized");
assert_eq!(action.notes().len(), 1, "Action should have 1 note");
assert_eq!(
Expand Down Expand Up @@ -1539,13 +1539,13 @@ mod tests {
let bundle = binding.issue_bundle().unwrap();

assert_eq!(bundle.actions().len(), 1, "There should be only one action");
let actions_vec = bundle.get_actions_by_desc(asset_desc);
let actions = bundle.get_actions_by_desc(asset_desc);
assert_eq!(
actions_vec.len(),
actions.len(),
1,
"The one action should correspond to asset_desc"
);
let action = actions_vec[0];
let action = actions[0];
assert!(!action.is_finalized(), "Action should not be finalized");
assert_eq!(action.notes().len(), 2, "Action should have 2 notes");
assert_eq!(
Expand Down Expand Up @@ -1586,13 +1586,13 @@ mod tests {

assert_eq!(bundle.actions().len(), 2, "There should be 2 actions");

let actions_vec = bundle.get_actions_by_desc(asset_desc_1);
let actions = bundle.get_actions_by_desc(asset_desc_1);
assert_eq!(
actions_vec.len(),
actions.len(),
1,
"Only one action should correspond to asset_desc_1"
);
let action = actions_vec[0];
let action = actions[0];
assert!(!action.is_finalized(), "Action should not be finalized");
assert_eq!(action.notes().len(), 1, "Action should have 1 note");
assert_eq!(
Expand All @@ -1605,13 +1605,13 @@ mod tests {
"Incorrect notes sum"
);

let actions_vec_2 = bundle.get_actions_by_desc(asset_desc_2);
let actions_2 = bundle.get_actions_by_desc(asset_desc_2);
assert_eq!(
actions_vec_2.len(),
actions_2.len(),
1,
"Only one action should correspond to asset_desc_2"
);
let action2 = actions_vec_2[0];
let action2 = actions_2[0];
assert!(!action2.is_finalized(), "Action should not be finalized");
assert_eq!(action2.notes().len(), 1, "Action should have 1 note");
assert_eq!(
Expand Down

0 comments on commit 1f8b132

Please sign in to comment.