Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolved Issues
Partially resolves these two:
#88
#45
Description
The fee rounding behavior was adjusted recently to more closely match solidity, but the order of operations was not exactly the same. This caused an occasional slight variation in output (usually off by 1e1), that compounded in situations where we were iteratively assessing fees such as
max_long
. In that case, the error would grow to as much as 1e5.During my effort to find this bug I
.mul_down
syntax instead of*
where it was sufficiently complicated to require this to easily pattern match against Solidity.calculate_max_long
to return errors instead of panic. This makes checks in the tests ugly, but that is a temporary problem until we purge the panics all-together (Improved Testing of the Rust SDK #20)traced
andtrace_test
which is helpful for debugging but was not actively being used and can slow down tests.Review Checklists
Please check each item before approving the pull request. While going
through the checklist, it is recommended to leave comments on items that are
referenced in the checklist to make sure that they are reviewed.
covering the full input space?
ensure that Rust matches Solidity?