-
-
Notifications
You must be signed in to change notification settings - Fork 664
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(core/mercury): separate upy args parsing #4182
refactor(core/mercury): separate upy args parsing #4182
Conversation
Similar thing was done here for bootloader and "common". Need to take a look how to take the same/similar approach for firmware. #3658 |
b616b27
to
58347bc
Compare
The only conflict with #3686 should be: |
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.
Wrote some thoughts inline but overall this should be a harmless refactor that can be merged when CI passes.
case_sensitive: bool, | ||
account: Option<TString<'static>>, | ||
path: Option<TString<'static>>, | ||
xpubs: Obj, // TODO: get rid of Obj |
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.
Perhaps this can use some kind of closure?
@@ -1540,16 +1866,16 @@ pub static mp_module_trezorui2: Module = obj_module! { | |||
/// br_code: ButtonRequestType, | |||
/// br_name: str, | |||
/// ) -> LayoutObj[tuple[UiResult, int]]: | |||
/// """Numer input with + and - buttons, description, and context menu with cancel and | |||
/// """Numebr input with + and - buttons, description, and context menu with cancel and |
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.
/// """Numebr input with + and - buttons, description, and context menu with cancel and | |
/// """Number input with + and - buttons, description, and context menu with cancel and |
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.
Making a typo while fixing a typo.
Fixed on rebase.
58347bc
to
57d2b15
Compare
|
|
Re-targeting to GFL branch #3686 and it can go right after. |
57d2b15
to
5086bd3
Compare
9297722
to
6b8585b
Compare
5086bd3
to
0d51a8e
Compare
0d51a8e
to
752c8b3
Compare
752c8b3
to
172af6d
Compare
|
||
let mut account_params = | ||
ShowInfoParams::new(TR::send__send_from.into()).with_cancel_button(); | ||
for pair in IterBuf::new().try_iterate(account_items)? { |
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't this be extracted into a ShowInfoParams::add_items
?
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.
Not without making ShowInfoParams
dependent on micropython
crate.
313f806
to
69d448f
Compare
- removes 2nd definition of ConfirmBlobParams, the choice of fields and what supplied in ctor and what in `with_` methods should be thought through again. [no changelog]
bbb65ed
to
320eb1f
Compare
I had to use This could be resolved as a part of #4322 |
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.
utACK
i'm thinking though, when do we bite the bullet on proc macros? :) |
[no changelog]
Supply the rust layout with dedicated paremeter type instead of plain micropython::Obj. The types used are ConfirmBlobParams and ShowInfoParams. [no changelog]
320eb1f
to
abc7203
Compare
This PR separates the Rust flows from micropython layer.
The idea is to do the uPy argument parsing in
ui/model_mercury/layout.rs
and then pass them as regular arguments to code inui/model_mercury/flow/**.rs
, i.e. they won't be passed asargs: &[Obj], kwargs: &Map
. The goal is to keep the rust flows independent frommicropython
sub-crate. This separation is done for two reasons:flows
creationThis PR has no impact on UI or features.
Note:
Obj
andIterBuf
- last place isget_address.rs
, postponing this for now