-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ife input spend challenge using wrong index (#593)
* test: integ test for challenge IFE input spend for all output indexes This is an effort to add tests to cover challenge IFE input spent on all output indexes. We found a bug that we are using wrong indexes in contract code. But, this test end up does not break the existing contract as although it is attracting wrong output, we are only using the output type with that output. With current system, we only have 1 output type for payment tx. As a result it failed to break with this test.. https://github.com/omisego/security-issues/issues/15 * test: integ test for all challenge indexes on IFE input spend Test in previous commit failed to cover the situation that would fail the contract with wrong index. This one test the index from another side (challenge input index) and it works to break the contract. Without the fix, it would result in "VM Exception while processing transaction: revert Output index out of bounds" error from the EVM. * refactor: uncomment tests * fix: ife spend with wrong index This commit is the fix on the contract for input spend challenge * style: fix linter * fix: test description on period * refactor: merge previous two tests into one with test parameters 1. kudo Piotr's idea to parametize the inputs for indexes at once 1. rename the period test a bit as just realize that it can work with period 0 too Piotr's PR: #594 * refactor: small changes on genreate list
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters