mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-05-23 09:18:46 +00:00
feat(core): use Account info
instead of Send from
in Delizia staking UI
[no changelog]
This commit is contained in:
parent
7be53c4172
commit
e08b15ecaf
@ -39,6 +39,7 @@ static void _librust_qstrs(void) {
|
|||||||
MP_QSTR_account;
|
MP_QSTR_account;
|
||||||
MP_QSTR_account_items;
|
MP_QSTR_account_items;
|
||||||
MP_QSTR_account_path;
|
MP_QSTR_account_path;
|
||||||
|
MP_QSTR_account_title;
|
||||||
MP_QSTR_accounts;
|
MP_QSTR_accounts;
|
||||||
MP_QSTR_action;
|
MP_QSTR_action;
|
||||||
MP_QSTR_active;
|
MP_QSTR_active;
|
||||||
|
@ -438,6 +438,7 @@ extern "C" fn new_flow_confirm_output(n_args: usize, args: *const Obj, kwargs: *
|
|||||||
let amount: Option<Obj> = kwargs.get(Qstr::MP_QSTR_amount)?.try_into_option()?;
|
let amount: Option<Obj> = kwargs.get(Qstr::MP_QSTR_amount)?.try_into_option()?;
|
||||||
let chunkify: bool = kwargs.get_or(Qstr::MP_QSTR_chunkify, false)?;
|
let chunkify: bool = kwargs.get_or(Qstr::MP_QSTR_chunkify, false)?;
|
||||||
let text_mono: bool = kwargs.get_or(Qstr::MP_QSTR_text_mono, true)?;
|
let text_mono: bool = kwargs.get_or(Qstr::MP_QSTR_text_mono, true)?;
|
||||||
|
let account_title: TString = kwargs.get(Qstr::MP_QSTR_account_title)?.try_into()?;
|
||||||
let account: Option<TString> = kwargs.get(Qstr::MP_QSTR_account)?.try_into_option()?;
|
let account: Option<TString> = kwargs.get(Qstr::MP_QSTR_account)?.try_into_option()?;
|
||||||
let account_path: Option<TString> =
|
let account_path: Option<TString> =
|
||||||
kwargs.get(Qstr::MP_QSTR_account_path)?.try_into_option()?;
|
kwargs.get(Qstr::MP_QSTR_account_path)?.try_into_option()?;
|
||||||
@ -482,6 +483,7 @@ extern "C" fn new_flow_confirm_output(n_args: usize, args: *const Obj, kwargs: *
|
|||||||
amount,
|
amount,
|
||||||
chunkify,
|
chunkify,
|
||||||
text_mono,
|
text_mono,
|
||||||
|
account_title,
|
||||||
account,
|
account,
|
||||||
account_path,
|
account_path,
|
||||||
br_code,
|
br_code,
|
||||||
@ -1353,6 +1355,7 @@ pub static mp_module_trezorui_api: Module = obj_module! {
|
|||||||
/// amount: str | None,
|
/// amount: str | None,
|
||||||
/// chunkify: bool,
|
/// chunkify: bool,
|
||||||
/// text_mono: bool,
|
/// text_mono: bool,
|
||||||
|
/// account_title: str,
|
||||||
/// account: str | None,
|
/// account: str | None,
|
||||||
/// account_path: str | None,
|
/// account_path: str | None,
|
||||||
/// br_code: ButtonRequestType,
|
/// br_code: ButtonRequestType,
|
||||||
|
@ -559,6 +559,7 @@ impl FirmwareUI for UIBolt {
|
|||||||
_amount: Option<Obj>,
|
_amount: Option<Obj>,
|
||||||
_chunkify: bool,
|
_chunkify: bool,
|
||||||
_text_mono: bool,
|
_text_mono: bool,
|
||||||
|
_account_title: TString<'static>,
|
||||||
_account: Option<TString<'static>>,
|
_account: Option<TString<'static>>,
|
||||||
_account_path: Option<TString<'static>>,
|
_account_path: Option<TString<'static>>,
|
||||||
_br_code: u16,
|
_br_code: u16,
|
||||||
|
@ -685,6 +685,7 @@ impl FirmwareUI for UICaesar {
|
|||||||
_amount: Option<Obj>,
|
_amount: Option<Obj>,
|
||||||
_chunkify: bool,
|
_chunkify: bool,
|
||||||
_text_mono: bool,
|
_text_mono: bool,
|
||||||
|
_account_title: TString<'static>,
|
||||||
_account: Option<TString<'static>>,
|
_account: Option<TString<'static>>,
|
||||||
_account_path: Option<TString<'static>>,
|
_account_path: Option<TString<'static>>,
|
||||||
_br_code: u16,
|
_br_code: u16,
|
||||||
|
@ -218,6 +218,7 @@ fn get_cancel_page(
|
|||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn new_confirm_output(
|
pub fn new_confirm_output(
|
||||||
confirm_main: ConfirmValue,
|
confirm_main: ConfirmValue,
|
||||||
|
account_title: TString<'static>,
|
||||||
account: Option<TString<'static>>,
|
account: Option<TString<'static>>,
|
||||||
account_path: Option<TString<'static>>,
|
account_path: Option<TString<'static>>,
|
||||||
br_name: TString<'static>,
|
br_name: TString<'static>,
|
||||||
@ -266,7 +267,7 @@ pub fn new_confirm_output(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// AccountInfo
|
// AccountInfo
|
||||||
let ac = AddressDetails::new(TR::send__send_from.into(), account, account_path)?;
|
let ac = AddressDetails::new(account_title, account, account_path)?;
|
||||||
let account_content = ac.map(|_| Some(FlowMsg::Cancelled));
|
let account_content = ac.map(|_| Some(FlowMsg::Cancelled));
|
||||||
|
|
||||||
let res = if let Some(confirm_amount) = confirm_amount {
|
let res = if let Some(confirm_amount) = confirm_amount {
|
||||||
|
@ -512,6 +512,7 @@ impl FirmwareUI for UIDelizia {
|
|||||||
amount: Option<Obj>,
|
amount: Option<Obj>,
|
||||||
chunkify: bool,
|
chunkify: bool,
|
||||||
text_mono: bool,
|
text_mono: bool,
|
||||||
|
account_title: TString<'static>,
|
||||||
account: Option<TString<'static>>,
|
account: Option<TString<'static>>,
|
||||||
account_path: Option<TString<'static>>,
|
account_path: Option<TString<'static>>,
|
||||||
br_code: u16,
|
br_code: u16,
|
||||||
@ -584,6 +585,7 @@ impl FirmwareUI for UIDelizia {
|
|||||||
|
|
||||||
let flow = flow::confirm_output::new_confirm_output(
|
let flow = flow::confirm_output::new_confirm_output(
|
||||||
confirm_main,
|
confirm_main,
|
||||||
|
account_title,
|
||||||
account,
|
account,
|
||||||
account_path,
|
account_path,
|
||||||
br_name,
|
br_name,
|
||||||
|
@ -167,6 +167,7 @@ pub trait FirmwareUI {
|
|||||||
amount: Option<Obj>, // TODO: replace Obj
|
amount: Option<Obj>, // TODO: replace Obj
|
||||||
chunkify: bool,
|
chunkify: bool,
|
||||||
text_mono: bool,
|
text_mono: bool,
|
||||||
|
account_title: TString<'static>,
|
||||||
account: Option<TString<'static>>,
|
account: Option<TString<'static>>,
|
||||||
account_path: Option<TString<'static>>,
|
account_path: Option<TString<'static>>,
|
||||||
br_code: u16,
|
br_code: u16,
|
||||||
|
@ -317,6 +317,7 @@ def flow_confirm_output(
|
|||||||
amount: str | None,
|
amount: str | None,
|
||||||
chunkify: bool,
|
chunkify: bool,
|
||||||
text_mono: bool,
|
text_mono: bool,
|
||||||
|
account_title: str,
|
||||||
account: str | None,
|
account: str | None,
|
||||||
account_path: str | None,
|
account_path: str | None,
|
||||||
br_code: ButtonRequestType,
|
br_code: ButtonRequestType,
|
||||||
|
@ -396,6 +396,7 @@ async def confirm_output(
|
|||||||
amount=amount,
|
amount=amount,
|
||||||
chunkify=chunkify,
|
chunkify=chunkify,
|
||||||
text_mono=True,
|
text_mono=True,
|
||||||
|
account_title=TR.send__send_from,
|
||||||
account=source_account,
|
account=source_account,
|
||||||
account_path=source_account_path,
|
account_path=source_account_path,
|
||||||
address_item=None,
|
address_item=None,
|
||||||
@ -773,6 +774,7 @@ if not utils.BITCOIN_ONLY:
|
|||||||
amount=None,
|
amount=None,
|
||||||
chunkify=(chunkify if recipient else False),
|
chunkify=(chunkify if recipient else False),
|
||||||
text_mono=True,
|
text_mono=True,
|
||||||
|
account_title=TR.send__send_from,
|
||||||
account=account,
|
account=account,
|
||||||
account_path=account_path,
|
account_path=account_path,
|
||||||
address_item=None,
|
address_item=None,
|
||||||
@ -823,6 +825,7 @@ if not utils.BITCOIN_ONLY:
|
|||||||
amount=None,
|
amount=None,
|
||||||
chunkify=False,
|
chunkify=False,
|
||||||
text_mono=False,
|
text_mono=False,
|
||||||
|
account_title=TR.address_details__account_info,
|
||||||
account=account,
|
account=account,
|
||||||
account_path=account_path,
|
account_path=account_path,
|
||||||
br_code=br_code,
|
br_code=br_code,
|
||||||
@ -888,6 +891,7 @@ if not utils.BITCOIN_ONLY:
|
|||||||
amount=None,
|
amount=None,
|
||||||
chunkify=True,
|
chunkify=True,
|
||||||
text_mono=True,
|
text_mono=True,
|
||||||
|
account_title=TR.address_details__account_info,
|
||||||
account=account,
|
account=account,
|
||||||
account_path=account_path,
|
account_path=account_path,
|
||||||
br_code=br_code,
|
br_code=br_code,
|
||||||
|
Loading…
Reference in New Issue
Block a user