@@ -29,9 +29,9 @@ use crate::{
2929use messages:: {
3030 encode,
3131 mlcp:: {
32- AccountCommand , Amount , CoinType , Destination , IsTokenFreezable , IsTokenUnfreezable ,
33- NftIssuance , OrderAccountCommand , OutputTimeLock , OutputValue , PublicKey , TokenIssuance ,
34- TokenTotalSupply , TxOutput , VrfPublicKey , H256 ,
32+ AccountCommand , AccountSpending , Amount , CoinType , Destination , IsTokenFreezable ,
33+ IsTokenUnfreezable , NftIssuance , OrderAccountCommand , OutputTimeLock , OutputValue ,
34+ PublicKey , TokenIssuance , TokenTotalSupply , TxOutput , VrfPublicKey , H256 ,
3535 } ,
3636 AddrType ,
3737} ;
@@ -104,14 +104,9 @@ pub fn ui_streaming_review_show_output(
104104
105105pub fn ui_approve_streaming_review (
106106 review : & NbglStreamingReview ,
107- output : & TxOutput ,
108107 ctx : & TxParsingOutputsContext ,
109108) -> Result < bool , StatusWord > {
110109 let coin = ctx. coin ( ) ;
111- if !ui_streaming_review_show_output ( review, output, coin) ? {
112- return Ok ( false ) ;
113- }
114-
115110 let fees = ctx. summary ( ) . fees_iter ( ) . try_fold (
116111 String :: new ( ) ,
117112 |mut acc, res| -> Result < _ , StatusWord > {
@@ -473,6 +468,20 @@ fn format_output(output: &TxOutput, coin: CoinType) -> Result<FormatedOutput, St
473468
474469fn format_input ( input : & InputCommand , coin : CoinType ) -> Result < FormatedOutput , StatusWord > {
475470 let ( name, value) = match input {
471+ InputCommand :: AccountSpending ( cmd) => match cmd {
472+ AccountSpending :: DelegationBalance ( delegation_id, amount) => {
473+ let address_short = format ! (
474+ "Delegation ID: {}\n Amount: {}" ,
475+ id_to_address( delegation_id. hash( ) , coin. delegation_id_address_prefix( ) ) ?,
476+ format_amount( * amount, coin)
477+ ) ;
478+ if cfg ! ( any( target_os = "nanosplus" , target_os = "nanox" ) ) {
479+ ( "Del Wdrwl" , address_short)
480+ } else {
481+ ( "Delegation withdrawl" , address_short)
482+ }
483+ }
484+ } ,
476485 InputCommand :: AccountCommand ( cmd) => match cmd {
477486 AccountCommand :: MintTokens ( token_id, amount) => {
478487 let address_short = format ! (
@@ -494,7 +503,11 @@ fn format_input(input: &InputCommand, coin: CoinType) -> Result<FormatedOutput,
494503 "Token ID: {}" ,
495504 id_to_address( token_id. hash( ) , coin. token_id_address_prefix( ) ) ?
496505 ) ;
497- ( "Lock token supply" , address_short)
506+ if cfg ! ( any( target_os = "nanosplus" , target_os = "nanox" ) ) {
507+ ( "Lock token" , address_short)
508+ } else {
509+ ( "Lock token supply" , address_short)
510+ }
498511 }
499512 AccountCommand :: FreezeToken ( token_id, is_unfreezable) => {
500513 let address_short = format ! (
@@ -513,23 +526,35 @@ fn format_input(input: &InputCommand, coin: CoinType) -> Result<FormatedOutput,
513526 "Token ID: {}" ,
514527 id_to_address( token_id. hash( ) , coin. token_id_address_prefix( ) ) ?,
515528 ) ;
516- ( "Unfreeze token" , address_short)
529+ if cfg ! ( any( target_os = "nanosplus" , target_os = "nanox" ) ) {
530+ ( "Unfrz token" , address_short)
531+ } else {
532+ ( "Unfreeze token" , address_short)
533+ }
517534 }
518535 AccountCommand :: ChangeTokenAuthority ( token_id, new_authority) => {
519536 let address_short = format ! (
520537 "Token ID: {}\n New authority: {}" ,
521538 id_to_address( token_id. hash( ) , coin. token_id_address_prefix( ) ) ?,
522539 to_address( new_authority, coin) ?
523540 ) ;
524- ( "Change token authority" , address_short)
541+ if cfg ! ( any( target_os = "nanosplus" , target_os = "nanox" ) ) {
542+ ( "Chg token auth" , address_short)
543+ } else {
544+ ( "Change token authority" , address_short)
545+ }
525546 }
526547 AccountCommand :: ChangeTokenMetadataUri ( token_id, new_metadata_uri) => {
527548 let address_short = format ! (
528549 "Token ID: {}\n New metadata URI: {}" ,
529550 id_to_address( token_id. hash( ) , coin. token_id_address_prefix( ) ) ?,
530551 String :: from_utf8_lossy( new_metadata_uri)
531552 ) ;
532- ( "Change token metadata URI" , address_short)
553+ if cfg ! ( any( target_os = "nanosplus" , target_os = "nanox" ) ) {
554+ ( "Chg token meta" , address_short)
555+ } else {
556+ ( "Change token metadata URI" , address_short)
557+ }
533558 }
534559 AccountCommand :: ConcludeOrder ( _) | AccountCommand :: FillOrder ( _, _, _) => {
535560 return Err ( StatusWord :: OrdersV0NotSupported )
@@ -556,7 +581,11 @@ fn format_input(input: &InputCommand, coin: CoinType) -> Result<FormatedOutput,
556581 "Order ID: {}" ,
557582 id_to_address( order_id. hash( ) , coin. order_id_address_prefix( ) ) ?
558583 ) ;
559- ( "Conclude order" , address_short)
584+ if cfg ! ( any( target_os = "nanosplus" , target_os = "nanox" ) ) {
585+ ( "Conclude ord" , address_short)
586+ } else {
587+ ( "Conclude order" , address_short)
588+ }
560589 }
561590 } ,
562591 } ;
0 commit comments