-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Migrate Tezos to Rust #4434
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?
Migrate Tezos to Rust #4434
Conversation
Binary size comparison➡️ aarch64-apple-ios: - 14.07 MB
+ 14.13 MB +67 KB ➡️ aarch64-apple-ios-sim: - 14.07 MB
+ 14.14 MB +67 KB ➡️ aarch64-linux-android: - 18.56 MB
+ 18.67 MB +109 KB ➡️ armv7-linux-androideabi: - 15.53 MB
+ 15.60 MB +76 KB ➡️ wasm32-unknown-emscripten: - 13.23 MB
+ 13.29 MB +65 KB |
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.
Good job! A few minor things please
pub fn base58_to_hex(input: &str, prefix_length: usize) -> String { | ||
let decoded = match decode_check(input, Alphabet::Bitcoin) { | ||
Ok(d) => d, | ||
Err(_) => return String::new(), | ||
}; | ||
|
||
if decoded.len() < prefix_length { | ||
return String::new(); |
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.
Shouldn't return an error instead?
let decoded = | ||
decode_check(private_key, Alphabet::Bitcoin).map_err(|_| KeyPairError::InvalidSecretKey)?; |
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.
Please wrap to Zeroized
rust/chains/tw_tezos/src/compiler.rs
Outdated
.map_err(|_| SigningErrorType::Error_internal)?; | ||
|
||
let mut watermarked_data = Vec::new(); | ||
watermarked_data.push(0x03); |
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.
Magic value
// Optional modules: | ||
type JsonSigner = NoJsonSigner; | ||
type PlanBuilder = NoPlanBuilder; | ||
type MessageSigner = NoMessageSigner; |
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.
Here we need to add a TezosMessageSigner module to be able to handle TWMessageSigner
requests
Description
This PR migrates Tezos from C++ to Rust.
How to test
Run tests
Types of changes
Refactor
Checklist
If you're adding a new blockchain