-
Notifications
You must be signed in to change notification settings - Fork 0
Add CoinType used for Ledger and encode/decode utils #2
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
base: master
Are you sure you want to change the base?
Conversation
OBorce
commented
Dec 5, 2025
- also use the specific version of parity scale codec with the fix for NanoX
- also use the specific version of parrity scale codec with the fix for NanoX
src/misc.rs
Outdated
| pub fn encode_as_compact(num: u32) -> PscVec<u8> { | ||
| parity_scale_codec::Compact::<u32>::encode(&num.into()) | ||
| } |
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.
This function has a generic name, but it's only defined for u32. Either make it generic over the type or at least give it a specific name, e.g. encode_u32_as_compact (though this will also look quite ugly, so plz try making it generic first).
But are all these functions really needed?
| parity-scale-codec = { git = "https://github.com/paritytech/parity-scale-codec.git", rev = "5021525697edc0661591ebc71392c48d950a10b0", default-features = false, features = [ | ||
| "derive", | ||
| ] } |
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 comment as in mintlayer/mintlayer-trezor-firmware#24 (comment)
CI fix: hardcode a separate Rust version to use with do_checks.sh
| 11 | ||
| } | ||
|
|
||
| pub const fn address_prefix(&self, destination: &Destination) -> &'static str { |
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.
Btw, it's better to accept DestinationTag here, it'll be more re-usable this way. Then, you can can call it for a destination by passing (&destination).into() or destination.discriminant()