Skip to content

Commit

Permalink
feat(eos-v2-cores): <- adds assertion that global sequence reprocessi…
Browse files Browse the repository at this point in the history
…ng protection works w/ multi-incremerkle based submission
  • Loading branch information
gskapka committed Feb 13, 2024
1 parent 235d9a3 commit b190fb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion v2_bridges/eos_on_int/src/eos/submit_eos_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,13 @@ mod tests {
assert!(latest_block_num > submission_block_num);

// NOTE: Now we can submit the block with the peg in in it...
let output = EosOutput::from_str(&submit_eos_block_to_core(&db, &submission_block_json).unwrap()).unwrap();
let mut output = EosOutput::from_str(&submit_eos_block_to_core(&db, &submission_block_json).unwrap()).unwrap();
// NOTE: Asserting a tx is outputted successfully is sufficient for this test.
assert_eq!(output.int_signed_transactions.len(), 1);

// NOTE: If we submit the _same_ material again, we should get no signed transactions since
// the core has already seen this global sequence.
output = EosOutput::from_str(&submit_eos_block_to_core(&db, &submission_block_json).unwrap()).unwrap();
assert_eq!(output.int_signed_transactions.len(), 0);
}
}
7 changes: 6 additions & 1 deletion v2_bridges/int_on_eos/src/eos/submit_eos_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,13 @@ mod tests {
assert!(latest_block_num > submission_block_num);

// NOTE: Now we can submit the block with the peg in in it...
let output = EosOutput::from_str(&submit_eos_block_to_core(&db, &submission_block_json).unwrap()).unwrap();
let mut output = EosOutput::from_str(&submit_eos_block_to_core(&db, &submission_block_json).unwrap()).unwrap();
// NOTE: Asserting a tx is outputted successfully is sufficient for this test.
assert_eq!(output.int_signed_transactions.len(), 1);

// NOTE: If we submit the _same_ material again, we should get no signed transactions since
// the core has already seen this global sequence.
output = EosOutput::from_str(&submit_eos_block_to_core(&db, &submission_block_json).unwrap()).unwrap();
assert_eq!(output.int_signed_transactions.len(), 0);
}
}

0 comments on commit b190fb7

Please sign in to comment.