Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
fixed off-by-one issue producing unexpected results.
  • Loading branch information
joshuacolvin0 committed Nov 2, 2023
1 parent c3ab7ad commit eab0519
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions arbitrator/stylus/tests/nonreentrant-enter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ fn user_main(input: Vec<u8>) -> Result<Vec<u8>, Vec<u8>> {
}
console!("counter: {}", input[40]);

let mut input = input.to_vec();
input[40] -= 1;
RawCall::new().call(dest, input.as_slice())
}
2 changes: 0 additions & 2 deletions arbitrator/stylus/tests/reentrant-enter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@ fn user_main(input: Vec<u8>) -> Result<Vec<u8>, Vec<u8>> {
}
console!("counter: {}", input[40]);

let mut input = input.to_vec();
input[40] -= 1;
unsafe{RawCall::new().call(dest, input.as_slice())}
}
2 changes: 2 additions & 0 deletions arbitrator/stylus/tests/reentrant-reenter/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ fn user_main(input: Vec<u8>) -> Result<Vec<u8>, Vec<u8>> {
if input[40] == 0 {
return unsafe{RawCall::new_delegate().call(dest, input.as_slice())}
}
let mut input = input;
input[40] -= 1;
unsafe{RawCall::new().call(dest, input.as_slice())}
}

0 comments on commit eab0519

Please sign in to comment.