@@ -7813,21 +7813,24 @@ pub mod args {
78137813 ctx : & mut Context ,
78147814 ) -> Result < Tx < SdkTypes > , Self :: Error > {
78157815 let ctx = ctx. borrow_mut_chain_or_exit ( ) ;
7816+ let wrapper = self . wrap_tx . map ( |wrapper| Wrapper {
7817+ broadcast_only : wrapper. broadcast_only ,
7818+ fee_amount : wrapper. fee_amount ,
7819+ fee_token : ctx. get ( & wrapper. fee_token ) . into ( ) ,
7820+ gas_limit : wrapper. gas_limit ,
7821+ wrapper_fee_payer : wrapper
7822+ . wrapper_fee_payer
7823+ . map ( |x| ctx. get ( & x) ) ,
7824+ } ) ;
78167825
78177826 Ok ( Tx :: < SdkTypes > {
78187827 dry_run : self . dry_run ,
7819- dry_run_wrapper : self . dry_run_wrapper ,
78207828 dump_tx : self . dump_tx ,
7821- dump_wrapper_tx : self . dump_wrapper_tx ,
78227829 output_folder : self . output_folder ,
78237830 force : self . force ,
7824- broadcast_only : self . broadcast_only ,
78257831 ledger_address : ctx. get ( & self . ledger_address ) ,
78267832 initialized_account_alias : self . initialized_account_alias ,
78277833 wallet_alias_force : self . wallet_alias_force ,
7828- fee_amount : self . fee_amount ,
7829- fee_token : ctx. get ( & self . fee_token ) . into ( ) ,
7830- gas_limit : self . gas_limit ,
78317834 signing_keys : self
78327835 . signing_keys
78337836 . iter ( )
@@ -7839,7 +7842,7 @@ pub mod args {
78397842 chain_id : self
78407843 . chain_id
78417844 . or_else ( || Some ( ctx. config . ledger . chain_id . clone ( ) ) ) ,
7842- wrapper_fee_payer : self . wrapper_fee_payer . map ( |x| ctx . get ( & x ) ) ,
7845+ wrap_tx : wrapper ,
78437846 memo : self . memo ,
78447847 use_device : self . use_device ,
78457848 device_transport : self . device_transport ,
@@ -7966,10 +7969,20 @@ pub mod args {
79667969 }
79677970
79687971 fn parse ( matches : & ArgMatches ) -> Self {
7969- let dry_run = DRY_RUN_TX . parse ( matches) ;
7970- let dry_run_wrapper = DRY_RUN_WRAPPER_TX . parse ( matches) ;
7971- let dump_tx = DUMP_TX . parse ( matches) ;
7972- let dump_wrapper_tx = DUMP_WRAPPER_TX . parse ( matches) ;
7972+ let dry_run = if DRY_RUN_TX . parse ( matches) {
7973+ Some ( DryRun :: Inner )
7974+ } else if DRY_RUN_WRAPPER_TX . parse ( matches) {
7975+ Some ( DryRun :: Wrapper )
7976+ } else {
7977+ None
7978+ } ;
7979+ let dump_tx = if DUMP_TX . parse ( matches) {
7980+ Some ( DumpTx :: Inner )
7981+ } else if DUMP_WRAPPER_TX . parse ( matches) {
7982+ Some ( DumpTx :: Wrapper )
7983+ } else {
7984+ None
7985+ } ;
79737986 let force = FORCE . parse ( matches) ;
79747987 let broadcast_only = BROADCAST_ONLY . parse ( matches) ;
79757988 let ledger_address = CONFIG_RPC_LEDGER_ADDRESS . parse ( matches) ;
@@ -7998,25 +8011,30 @@ pub mod args {
79988011 }
79998012 } ;
80008013 let device_transport = DEVICE_TRANSPORT . parse ( matches) ;
8014+ // Wrap the transaction unless we want to dump or dry-run the raw tx
8015+ let wrap_tx = match ( & dump_tx, & dry_run) {
8016+ ( _, Some ( DryRun :: Inner ) ) | ( Some ( DumpTx :: Inner ) , _) => None ,
8017+ _ => Some ( Wrapper {
8018+ broadcast_only,
8019+ fee_amount,
8020+ wrapper_fee_payer,
8021+ fee_token,
8022+ gas_limit,
8023+ } ) ,
8024+ } ;
80018025 Self {
80028026 dry_run,
8003- dry_run_wrapper,
80048027 dump_tx,
8005- dump_wrapper_tx,
80068028 force,
8007- broadcast_only,
80088029 ledger_address,
80098030 initialized_account_alias,
80108031 wallet_alias_force,
8011- fee_amount,
8012- fee_token,
8013- gas_limit,
80148032 expiration,
80158033 signing_keys,
80168034 tx_reveal_code_path,
80178035 password,
80188036 chain_id,
8019- wrapper_fee_payer ,
8037+ wrap_tx ,
80208038 output_folder,
80218039 memo,
80228040 use_device,
0 commit comments