File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 2020
2121optgroup  =  _OptGroup ()
2222
23+ # Flags 
2324quiet_mode  =  False 
25+ expand_data  =  False 
2426
2527# ┌───────────┐ 
2628# │ Callbacks │ 
2729# └───────────┘ 
2830
2931
32+ def  expand_callback (
33+     ctx : click .Context , _ : click .Option , value : Optional [bool ]
34+ ) ->  Optional [Any ]:
35+     if  value :
36+         global  expand_data 
37+         expand_data  =  True 
38+     return  None 
39+ 
40+ 
3041def  help_callback (
3142    ctx : click .Context , _ : click .Option , value : Optional [bool ]
3243) ->  Optional [Any ]:
@@ -158,6 +169,14 @@ def build_safetx(f: FC) -> FC:
158169def  common (f : FC ) ->  FC :
159170    for  option  in  reversed (
160171        [
172+             click .option (
173+                 "--expand" ,
174+                 is_flag = True ,
175+                 expose_value = False ,
176+                 is_eager = True ,
177+                 help = "don't truncate data in panels" ,
178+                 callback = expand_callback ,
179+             ),
161180            click .option (
162181                "-q" ,
163182                "--quiet" ,
Original file line number Diff line number Diff line change 1313    HexBytes ,
1414)
1515
16+ from  . import  params 
1617from  .chaindata  import  ChainData 
1718from  .constants  import  (
1819    SAFE_SETUP_FUNC_SELECTOR ,
@@ -142,7 +143,11 @@ def format_hexbytes(data: HexBytes) -> str:
142143    len_data  =  len (data )
143144    return  (
144145        f"{ data [:TRUNCATE_DATA_BYTES ].to_0x_hex ()}  " 
145-         +  ("[danger]...[/danger] "  if  len_data  >  TRUNCATE_DATA_BYTES  else  " " )
146+         +  (
147+             "[danger]...[/danger] " 
148+             if  (not  params .expand_data  and  (len_data  >  TRUNCATE_DATA_BYTES ))
149+             else  " " 
150+         )
146151        +  r"[secondary]\[" 
147152        +  f"{ len_data :,}   bytes][/secondary]" 
148153    )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments