trezor-firmware icon indicating copy to clipboard operation
trezor-firmware copied to clipboard

refactor(core/mercury): separate upy args parsing

Open obrusvit opened this issue 5 months ago • 2 comments

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 in ui/model_mercury/flow/**.rs, i.e. they won't be passed as args: &[Obj], kwargs: &Map. The goal is to keep the rust flows independent from micropython sub-crate. This separation is done for two reasons:

  • it simplifies the code in for flows creation which
  • it paves the way for apps done completely in Rust

This PR has no impact on UI or features.

TODO:

  • [x] some lifetime issues to FIX
  • [x] there is a few places with the usage of Obj and IterBuf
    • last place is get_address.rs, postponing this for now

obrusvit avatar Sep 15 '24 20:09 obrusvit