-
Notifications
You must be signed in to change notification settings - Fork 97
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(trezor): add withdraw eth with trezor #2005
Conversation
… emulator support (via udp), add test config helpers, add layer to connect to Trezor or emulator over usb and udp (cherry-picked cdcb384)
…me, better naming and constraints, thanks to shamardy)
…ithdraw eth from trezor account (WiP)
…or eth sign request
…on-taskman call; refactor PrivKeyPolicy::Trezor to eliminate unneeded field; refactor platform_coin_with_tokens (var names, remove extra bounds); added test code to withdraw JST token
270d9fa
to
e0a4565
Compare
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.
Thanks a lot for the huge work! First review iteration!
I hope I fixed review notes above in the last push. |
* evm-hd-wallet: (27 commits) Fix todo comments Fix HDAddressOps::Address trait bounds fix(indexeddb): fix IDB cursor.continue_() call after drop (#2028) security bump for `h2` (#2062) fix(makerbot): allow more than one prices url in makerbot (#2027) fix(wasm worker env): refactor direct usage of `window` (#1953) feat(nft): nft abi in withdraw_nft RPC, clear_nft_db RPC (#2039) refactor(utxo): refactor utxo output script creation (#1960) feat(ETH): balance event streaming for ETH (#2041) chore(release): bump mm2 version to 2.1.0-beta (#2044) feat(trezor): add segwit support for withdraw with trezor (#1984) chore(config): remove vscode launchjson (#2040) feat(trading-proto-upgrade): wasm DB, kickstart, refund states, v2 RPCs (#2015) feat(UTXO): balance event streaming for Electrum clients (#2013) feat(tx): add new sign_raw_transaction rpc for UTXO and EVM coins (#1930) fix(p2p): handle encode_and_sign errors (#2038) chore(release): add changelog entries for v2.0.0-beta (#2037) chore(network): write network information to stdout (#2034) fix(price_endpoints): add cached url (#2032) deps(network): sync with upstream yamux (#2030) ...
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.
Next review iteration!
…n_withdraw_tx, removed unused fn
add wasm_test_withdraw_eth test move eth test coin creators in for_test mod for use in wasm
…m in mm2src/coins/lp_coins.rs
…ns/lp_coins.rs to return a Result instead of unwrapping the value directly
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.
Just some questions before finalizing and merging this PR!
/// Get external token definition by token contract address and chain id | ||
/// check this doc how to find token definition files https://docs.trezor.io/trezor-firmware/common/ethereum-definitions.html | ||
#[allow(dead_code)] | ||
fn get_eth_token_def(address_bytes: &[u8], chain_id: ChainId) -> Option<Vec<u8>> { | ||
ETH_TOKEN_DEFS | ||
.iter() | ||
.find(|(address, def)| address == &&address_bytes && def.0 == chain_id) | ||
.map(|found| found.1 .1.to_vec()) | ||
} |
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.
Why do we need this?
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 is needed to show the chain name on the device display (when it asks for signing confirmation)
(they support couple test chains internally and I just added sepolia)
// if we have it, pass network or token definition info to show on the device screen: | ||
let eth_defs = proto_ethereum_definitions::EthereumDefinitions { | ||
encoded_network: get_eth_network_def(chain_id), | ||
encoded_token: None, // TODO add looking for tokens defs |
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.
Can you please explain this todo in more details?
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.
they support a list of tokens embedded into the firmware (this allows to show token name on the display, when confirming).
We can put additional tokens here (but only if they have their definitions on their website, bcz definitions are signed with trezor key).
maybe now it's time to look for such tokens?
Changes to EVM wallet to enable trezor: