-
Notifications
You must be signed in to change notification settings - Fork 27
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
refactor(minor-interchain-token-service): change max uint to max bits #760
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #760 +/- ##
==========================================
- Coverage 93.36% 93.35% -0.01%
==========================================
Files 225 225
Lines 36359 36366 +7
==========================================
+ Hits 33947 33951 +4
- Misses 2412 2415 +3 ☔ View full report in Codecov by Sentry. |
What's the reason for making this change? Easier to configure? |
Ok(res) => res.gt(&Uint256::zero()), | ||
// this overflow error occurs when trying to shift 256 bits or more. | ||
// But this can only happen if max_bits is >= 256, and amount itself is only 256 bits. | ||
// So in this can, amount cannot possibly overflow the max uint of the target chain |
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.
// So in this can, amount cannot possibly overflow the max uint of the target chain | |
// So in this case, amount cannot possibly overflow the max uint of the target chain |
@@ -60,8 +59,8 @@ pub struct ChainConfig { | |||
|
|||
#[cw_serde] | |||
pub struct TruncationConfig { | |||
pub max_uint: nonempty::Uint256, // The maximum uint value that is supported by the chain's token standard | |||
pub max_decimals_when_truncating: u8, // The maximum number of decimals that is preserved when deploying from a chain with a larger max_uint | |||
pub max_uint_bits: u32, // The maximum number of bits used by the chain to represent unsigned integers |
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.
Do we have a nonempty::u32
? zero wouldn't make sense here.
@@ -41,15 +41,15 @@ pub struct ChainConfig { | |||
|
|||
#[cw_serde] | |||
pub struct TruncationConfig { | |||
pub max_uint: nonempty::Uint256, // The maximum uint value that is supported by the chain's token standard | |||
pub max_decimals_when_truncating: u8, // The maximum number of decimals that is preserved when deploying from a chain with a larger max_uint | |||
pub max_uint_bits: u32, // The maximum number of bits used to represent unsigned integer values that is supported by the chain's token standard |
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.
Same here.
Todos
need to migrate the existing chain configs
https://axelarnetwork.atlassian.net/browse/AXE-7486