Skip to content

Commit

Permalink
refactor(core): remove trezorui2 module
Browse files Browse the repository at this point in the history
- also remove "check" scripts which seem outdated

[no changelog]
  • Loading branch information
obrusvit committed Dec 18, 2024
1 parent ad9618c commit 9caf540
Show file tree
Hide file tree
Showing 19 changed files with 3 additions and 391 deletions.
1 change: 0 additions & 1 deletion core/embed/projects/firmware/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
#define MICROPY_PY_TREZORUTILS (1)
#define MICROPY_PY_TREZORPROTO (1)
#define MICROPY_PY_TREZORTRANSLATE (1)
#define MICROPY_PY_TREZORUI2 (1)
#define MICROPY_PY_TREZORUI_API (1)

#ifdef SYSTEM_VIEW
Expand Down
1 change: 0 additions & 1 deletion core/embed/projects/unix/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ extern const struct _mp_print_t mp_stderr_print;
#define MICROPY_PY_TREZORUTILS (1)
#define MICROPY_PY_TREZORPROTO (1)
#define MICROPY_PY_TREZORTRANSLATE (1)
#define MICROPY_PY_TREZORUI2 (1)
#define MICROPY_PY_TREZORUI_API (1)

#define MP_STATE_PORT MP_STATE_VM
Expand Down
1 change: 0 additions & 1 deletion core/embed/rust/librust.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ mp_obj_t protobuf_debug_msg_def_type();
#endif

extern mp_obj_module_t mp_module_trezorproto;
extern mp_obj_module_t mp_module_trezorui2;
extern mp_obj_module_t mp_module_trezorui_api;
extern mp_obj_module_t mp_module_trezortranslate;

Expand Down
1 change: 0 additions & 1 deletion core/embed/rust/librust_qstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ static void _librust_qstrs(void) {
MP_QSTR_touch_event;
MP_QSTR_trace;
MP_QSTR_trezorproto;
MP_QSTR_trezorui2;
MP_QSTR_trezorui_api;
MP_QSTR_tutorial;
MP_QSTR_tutorial__continue;
Expand Down
11 changes: 1 addition & 10 deletions core/embed/rust/src/ui/model_mercury/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::component::{
};
use crate::{
error::Error,
micropython::{macros::obj_module, module::Module, obj::Obj, qstr::Qstr},
micropython::obj::Obj,
ui::{
component::{
text::paragraphs::{ParagraphSource, Paragraphs},
Expand Down Expand Up @@ -184,12 +184,3 @@ where
unreachable!();
}
}

#[no_mangle]
pub static mp_module_trezorui2: Module = obj_module! {
/// from trezor import utils
/// from trezorui_api import *
///
Qstr::MP_QSTR___name__ => Qstr::MP_QSTR_trezorui2.to_obj(),

};
11 changes: 1 addition & 10 deletions core/embed/rust/src/ui/model_tr/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use super::component::{
};
use crate::{
error::Error,
micropython::{macros::obj_module, map::Map, module::Module, obj::Obj, qstr::Qstr},
micropython::obj::Obj,
ui::{
component::{
base::Component,
Expand Down Expand Up @@ -200,12 +200,3 @@ impl ComponentMsgObj for super::component::bl_confirm::Confirm<'_> {
}
}
}

#[no_mangle]
pub static mp_module_trezorui2: Module = obj_module! {
/// from trezor import utils
/// from trezorui_api import *
///
Qstr::MP_QSTR___name__ => Qstr::MP_QSTR_trezorui2.to_obj(),

};
10 changes: 1 addition & 9 deletions core/embed/rust/src/ui/model_tt/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use super::component::{
};
use crate::{
error::Error,
micropython::{macros::obj_module, map::Map, module::Module, obj::Obj, qstr::Qstr, util},
micropython::obj::Obj,
strutil::TString,
ui::{
component::{
Expand Down Expand Up @@ -284,11 +284,3 @@ impl ComponentMsgObj for super::component::bl_confirm::Confirm<'_> {
}
}
}

#[no_mangle]
pub static mp_module_trezorui2: Module = obj_module! {
/// from trezor import utils
/// from trezorui_api import *
///
Qstr::MP_QSTR___name__ => Qstr::MP_QSTR_trezorui2.to_obj(),
};
4 changes: 0 additions & 4 deletions core/embed/upymod/rustmods.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
#include "librust.h"
#include "py/runtime.h"

#if MICROPY_PY_TREZORUI2
MP_REGISTER_MODULE(MP_QSTR_trezorui2, mp_module_trezorui2);
#endif

#if MICROPY_PY_TREZORUI_API
MP_REGISTER_MODULE(MP_QSTR_trezorui_api, mp_module_trezorui_api);
#endif
Expand Down
7 changes: 0 additions & 7 deletions core/mocks/generated/trezorui2.pyi

This file was deleted.

1 change: 0 additions & 1 deletion core/src/trezor/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from trezorui import Display
from typing import TYPE_CHECKING

import trezorui2
from trezor import io, log, loop, utils, wire, workflow
from trezor.messages import ButtonAck, ButtonRequest
from trezor.wire import context
Expand Down
1 change: 0 additions & 1 deletion core/src/trezor/ui/layouts/mercury/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import TYPE_CHECKING

import trezorui2
import trezorui_api
from trezor import TR, ui, utils
from trezor.enums import ButtonRequestType
Expand Down
1 change: 0 additions & 1 deletion core/src/trezor/ui/layouts/mercury/recovery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import TYPE_CHECKING

import trezorui2
import trezorui_api
from trezor import TR
from trezor.enums import ButtonRequestType, RecoveryType
Expand Down
1 change: 0 additions & 1 deletion core/src/trezor/ui/layouts/tr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import TYPE_CHECKING

import trezorui2
import trezorui_api
from trezor import TR, ui, utils
from trezor.enums import ButtonRequestType
Expand Down
1 change: 0 additions & 1 deletion core/src/trezor/ui/layouts/tr/recovery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import TYPE_CHECKING

import trezorui2
import trezorui_api
from trezor import TR, ui
from trezor.enums import ButtonRequestType, RecoveryType
Expand Down
1 change: 0 additions & 1 deletion core/src/trezor/ui/layouts/tt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import TYPE_CHECKING

import trezorui2
import trezorui_api
from trezor import TR, ui, utils
from trezor.enums import ButtonRequestType
Expand Down
1 change: 0 additions & 1 deletion core/src/trezor/ui/layouts/tt/recovery.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import TYPE_CHECKING

import trezorui2
import trezorui_api
from trezor import TR, ui
from trezor.enums import ButtonRequestType
Expand Down
9 changes: 0 additions & 9 deletions core/tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,3 @@ Generate a CMakeLists.txt file for the core.
### `provision_device.py`

Run the provisioning flow on a prodtest firmware, against a staging provisioning server.

### `rust_api_checks.py`

Check that the Rust UI API is consistent with the Python UI API.

### `rust_api_models_unification.py`

Checks the consistency of the Rust API between models.

Loading

0 comments on commit 9caf540

Please sign in to comment.