-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ITS): add ITS message ABI encoding/decoding support #65
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
=======================================
Coverage ? 93.60%
=======================================
Files ? 33
Lines ? 2018
Branches ? 0
=======================================
Hits ? 1889
Misses ? 129
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ABI encoding/decoding could be quite challenging, but you managed it very well. Well done!
- add ABI encoding/decoding for ITS messages - add ITS Hub message types
- replace match statements with one-liners where appropriate
- cargo sort workspace dependencies
- import std in root lib.rs #[cfg(test)] in order to use goldie assertions - add error handling to `try_into()` - add `into_vec` and `from_vec` helpers - rename soroban string and i128 conversion functions - remove redundant unit test
- change HubMessage to standard enum (not #[contracttype]) and refactor - simplify `to_i128` conversion function and use `ensure!` macro
5ff1615
to
f9e5ac8
Compare
- push re-built Cargo.lock after rebase
- add checks for negative values for Uint<256,4> to i128 conversion - add test for invalid UTF-8 sequence when converting to Std String - add test for i128 overflow
- add test for invalid HubMessage
- remove #[contracttype] for all ITS message types - change decimals to u8
- use i128::MAX directly in tests
- change abi_decode method to have single point of exit (no early return for error) - add u128 overflow test for `to_i128()`
- add improved error handling for string conversion (return Result instead of panic) - improved tests for string conversion
- remove unnecessary test - use assert_ok! in tests rather than unwrap - add test case for invalid hub message type
AXE-6065