@@ -35,7 +35,6 @@ const LOG_TARGET: &str = "wallet::console_wallet::burn_tab ";
3535pub struct BurnTab {
3636 balance : Balance ,
3737 burn_input_mode : BurnInputMode ,
38- burnt_proof_filepath_field : String ,
3938 claim_public_key_field : String ,
4039 sidechain_key_field : String ,
4140 amount_field : String ,
@@ -54,7 +53,6 @@ impl BurnTab {
5453 Self {
5554 balance : Balance :: new ( ) ,
5655 burn_input_mode : BurnInputMode :: None ,
57- burnt_proof_filepath_field : String :: new ( ) ,
5856 claim_public_key_field : String :: new ( ) ,
5957 sidechain_key_field : String :: new ( ) ,
6058 amount_field : String :: new ( ) ,
@@ -88,7 +86,6 @@ impl BurnTab {
8886 Constraint :: Length ( 3 ) ,
8987 Constraint :: Length ( 3 ) ,
9088 Constraint :: Length ( 3 ) ,
91- Constraint :: Length ( 3 ) ,
9289 ]
9390 . as_ref ( ) ,
9491 )
@@ -98,10 +95,6 @@ impl BurnTab {
9895 let instructions = Paragraph :: new ( vec ! [
9996 Spans :: from( vec![
10097 Span :: raw( "Press " ) ,
101- Span :: styled( "V" , Style :: default ( ) . add_modifier( Modifier :: BOLD ) ) ,
102- Span :: raw( " to edit " ) ,
103- Span :: styled( "Burn Proof Filepath" , Style :: default ( ) . add_modifier( Modifier :: BOLD ) ) ,
104- Span :: raw( ", " ) ,
10598 Span :: styled( "C" , Style :: default ( ) . add_modifier( Modifier :: BOLD ) ) ,
10699 Span :: raw( " to edit " ) ,
107100 Span :: styled( "Claim Public Key" , Style :: default ( ) . add_modifier( Modifier :: BOLD ) ) ,
@@ -113,7 +106,7 @@ impl BurnTab {
113106 Span :: styled( "F" , Style :: default ( ) . add_modifier( Modifier :: BOLD ) ) ,
114107 Span :: raw( " to edit " ) ,
115108 Span :: styled( "Fee-Per-Gram" , Style :: default ( ) . add_modifier( Modifier :: BOLD ) ) ,
116- Span :: raw( " and " ) ,
109+ Span :: raw( ", " ) ,
117110 ] ) ,
118111 Spans :: from( vec![
119112 Span :: raw( "Press " ) ,
@@ -125,38 +118,26 @@ impl BurnTab {
125118 . block ( Block :: default ( ) ) ;
126119 f. render_widget ( instructions, vert_chunks[ 0 ] ) ;
127120
128- let burnt_proof_filepath_input = Paragraph :: new ( self . burnt_proof_filepath_field . as_ref ( ) )
129- . style ( match self . burn_input_mode {
130- BurnInputMode :: BurntProofPath => Style :: default ( ) . fg ( Color :: Magenta ) ,
131- _ => Style :: default ( ) ,
132- } )
133- . block (
134- Block :: default ( )
135- . borders ( Borders :: ALL )
136- . title ( "Sa(v)e burn proof to file path:" ) ,
137- ) ;
138- f. render_widget ( burnt_proof_filepath_input, vert_chunks[ 1 ] ) ;
139-
140121 let claim_public_key_input = Paragraph :: new ( self . claim_public_key_field . as_ref ( ) )
141122 . style ( match self . burn_input_mode {
142123 BurnInputMode :: ClaimPublicKey => Style :: default ( ) . fg ( Color :: Magenta ) ,
143124 _ => Style :: default ( ) ,
144125 } )
145126 . block ( Block :: default ( ) . borders ( Borders :: ALL ) . title ( "To (C)laim Public Key:" ) ) ;
146- f. render_widget ( claim_public_key_input, vert_chunks[ 2 ] ) ;
127+ f. render_widget ( claim_public_key_input, vert_chunks[ 1 ] ) ;
147128
148129 let sidechain_key_input = Paragraph :: new ( self . sidechain_key_field . as_ref ( ) )
149130 . style ( match self . burn_input_mode {
150131 BurnInputMode :: SidechainKey => Style :: default ( ) . fg ( Color :: Magenta ) ,
151132 _ => Style :: default ( ) ,
152133 } )
153134 . block ( Block :: default ( ) . borders ( Borders :: ALL ) . title ( "Sidechain Key:" ) ) ;
154- f. render_widget ( sidechain_key_input, vert_chunks[ 3 ] ) ;
135+ f. render_widget ( sidechain_key_input, vert_chunks[ 2 ] ) ;
155136
156137 let amount_fee_layout = Layout :: default ( )
157138 . direction ( Direction :: Horizontal )
158139 . constraints ( [ Constraint :: Percentage ( 50 ) , Constraint :: Percentage ( 50 ) ] . as_ref ( ) )
159- . split ( vert_chunks[ 4 ] ) ;
140+ . split ( vert_chunks[ 3 ] ) ;
160141
161142 let amount_input = Paragraph :: new ( self . amount_field . to_string ( ) )
162143 . style ( match self . burn_input_mode {
@@ -180,47 +161,29 @@ impl BurnTab {
180161 _ => Style :: default ( ) ,
181162 } )
182163 . block ( Block :: default ( ) . borders ( Borders :: ALL ) . title ( "(P)ayment-id:" ) ) ;
183- f. render_widget ( payment_id_input, vert_chunks[ 5 ] ) ;
164+ f. render_widget ( payment_id_input, vert_chunks[ 4 ] ) ;
184165
185166 match self . burn_input_mode {
186167 BurnInputMode :: None => ( ) ,
187- BurnInputMode :: BurntProofPath => f. set_cursor (
188- // Put cursor past the end of the input text
189- vert_chunks[ 1 ] . x + self . burnt_proof_filepath_field . width ( ) as u16 + 1 ,
190- // Move one line down, from the border to the input line
168+ BurnInputMode :: ClaimPublicKey => f. set_cursor (
169+ vert_chunks[ 1 ] . x + self . claim_public_key_field . width ( ) as u16 + 1 ,
191170 vert_chunks[ 1 ] . y + 1 ,
192171 ) ,
193- BurnInputMode :: ClaimPublicKey => f. set_cursor (
194- // Put cursor past the end of the input text
195- vert_chunks[ 2 ] . x + self . claim_public_key_field . width ( ) as u16 + 1 ,
196- // Move one line down, from the border to the input line
172+ BurnInputMode :: SidechainKey => f. set_cursor (
173+ vert_chunks[ 2 ] . x + self . sidechain_key_field . width ( ) as u16 + 1 ,
197174 vert_chunks[ 2 ] . y + 1 ,
198175 ) ,
199- BurnInputMode :: Amount => {
200- f. set_cursor (
201- // Put cursor past the end of the input text
202- amount_fee_layout[ 0 ] . x + self . amount_field . width ( ) as u16 + 1 ,
203- // Move one line down, from the border to the input line
204- amount_fee_layout[ 0 ] . y + 1 ,
205- )
206- } ,
176+ BurnInputMode :: Amount => f. set_cursor (
177+ amount_fee_layout[ 0 ] . x + self . amount_field . width ( ) as u16 + 1 ,
178+ amount_fee_layout[ 0 ] . y + 1 ,
179+ ) ,
207180 BurnInputMode :: Fee => f. set_cursor (
208- // Put cursor past the end of the input text
209181 amount_fee_layout[ 1 ] . x + self . fee_field . width ( ) as u16 + 1 ,
210- // Move one line down, from the border to the input line
211182 amount_fee_layout[ 1 ] . y + 1 ,
212183 ) ,
213- BurnInputMode :: SidechainKey => f. set_cursor (
214- // Put cursor past the end of the input text
215- vert_chunks[ 3 ] . x + self . sidechain_key_field . width ( ) as u16 + 1 ,
216- // Move one line down, from the border to the input line
217- vert_chunks[ 3 ] . y + 1 ,
218- ) ,
219184 BurnInputMode :: PaymentId => f. set_cursor (
220- // Put cursor past the end of the input text
221- vert_chunks[ 5 ] . x + self . payment_id_field . width ( ) as u16 + 1 ,
222- // Move one line down, from the border to the input line
223- vert_chunks[ 5 ] . y + 1 ,
185+ vert_chunks[ 4 ] . x + self . payment_id_field . width ( ) as u16 + 1 ,
186+ vert_chunks[ 4 ] . y + 1 ,
224187 ) ,
225188 }
226189 }
@@ -321,12 +284,6 @@ impl BurnTab {
321284 return KeyHandled :: Handled ;
322285 } ;
323286
324- let burn_proof_filepath = if self . burnt_proof_filepath_field . is_empty ( ) {
325- None
326- } else {
327- Some ( self . burnt_proof_filepath_field . clone ( ) )
328- } ;
329-
330287 let claim_public_key = if self . claim_public_key_field . is_empty ( ) {
331288 None
332289 } else {
@@ -346,7 +303,6 @@ impl BurnTab {
346303 Some ( BurnConfirmationDialogType :: Normal ) => {
347304 match Handle :: current ( ) . block_on (
348305 app_state. send_burn_transaction (
349- burn_proof_filepath,
350306 claim_public_key,
351307 amount. into ( ) ,
352308 UtxoSelectionCriteria :: default ( ) ,
@@ -393,7 +349,6 @@ impl BurnTab {
393349 }
394350
395351 if reset_fields {
396- self . burnt_proof_filepath_field = "" . to_string ( ) ;
397352 self . claim_public_key_field = "" . to_string ( ) ;
398353 self . amount_field = "" . to_string ( ) ;
399354 self . fee_field = app_state. get_default_fee_per_gram ( ) . as_u64 ( ) . to_string ( ) ;
@@ -410,13 +365,6 @@ impl BurnTab {
410365 if self . burn_input_mode != BurnInputMode :: None {
411366 match self . burn_input_mode {
412367 BurnInputMode :: None => ( ) ,
413- BurnInputMode :: BurntProofPath => match c {
414- '\n' => self . burn_input_mode = BurnInputMode :: ClaimPublicKey ,
415- c => {
416- self . burnt_proof_filepath_field . push ( c) ;
417- return KeyHandled :: Handled ;
418- } ,
419- } ,
420368 BurnInputMode :: ClaimPublicKey => match c {
421369 '\n' => self . burn_input_mode = BurnInputMode :: SidechainKey ,
422370 c => {
@@ -554,8 +502,8 @@ impl<B: Backend> Component<B> for BurnTab {
554502 return ;
555503 } ,
556504 UiTransactionBurnStatus :: TransactionComplete => {
557- self . success_message =
558- Some ( "Transaction completed successfully! \n Please press Enter to continue" . to_string ( ) ) ;
505+ let msg = "Transaction completed successfully! \n Please press Enter to continue" . to_string ( ) ;
506+ self . success_message = Some ( msg ) ;
559507 return ;
560508 } ,
561509 } ;
@@ -667,7 +615,6 @@ impl<B: Backend> Component<B> for BurnTab {
667615 }
668616
669617 match c {
670- 'v' => self . burn_input_mode = BurnInputMode :: BurntProofPath ,
671618 'c' => self . burn_input_mode = BurnInputMode :: ClaimPublicKey ,
672619 'a' => {
673620 self . burn_input_mode = BurnInputMode :: Amount ;
@@ -713,9 +660,6 @@ impl<B: Backend> Component<B> for BurnTab {
713660
714661 fn on_backspace ( & mut self , _app_state : & mut AppState ) {
715662 match self . burn_input_mode {
716- BurnInputMode :: BurntProofPath => {
717- let _ = self . burnt_proof_filepath_field . pop ( ) ;
718- } ,
719663 BurnInputMode :: ClaimPublicKey => {
720664 let _ = self . claim_public_key_field . pop ( ) ;
721665 } ,
@@ -739,7 +683,6 @@ impl<B: Backend> Component<B> for BurnTab {
739683#[ derive( PartialEq , Debug ) ]
740684pub enum BurnInputMode {
741685 None ,
742- BurntProofPath ,
743686 ClaimPublicKey ,
744687 SidechainKey ,
745688 Amount ,
0 commit comments