@@ -2622,14 +2622,20 @@ impl TxExpiration {
26222622 }
26232623}
26242624
2625+ /// Argument for dry-runs
2626+ #[ derive( Clone , Debug ) ]
2627+ pub enum DryRun {
2628+ /// Request a dry run of the inner transaction(s) only
2629+ Inner ,
2630+ /// Request a dry run of both the inner transaction(s) and the wrapper
2631+ Wrapper ,
2632+ }
2633+
26252634/// Common transaction arguments
26262635#[ derive( Clone , Debug ) ]
26272636pub struct Tx < C : NamadaTypes = SdkTypes > {
2628- // FIXME: should these two be mutually exclusive? Yes
2629- /// Simulate applying the transaction
2630- pub dry_run : bool ,
2631- /// Simulate applying both the wrapper and inner transactions
2632- pub dry_run_wrapper : bool ,
2637+ /// Simulate applying the transaction (possibly the wrapper too)
2638+ pub dry_run : Option < DryRun > ,
26332639 /// Dump the raw transaction bytes to file
26342640 // FIXME: should these two be mutually exclusive? Yes
26352641 // FIXME: can we use dump tx to avoid wrapping the tx instead of the extra
@@ -2714,16 +2720,9 @@ pub trait TxBuilder<C: NamadaTypes>: Sized {
27142720 where
27152721 F : FnOnce ( Tx < C > ) -> Tx < C > ;
27162722 /// Simulate applying the transaction
2717- fn dry_run ( self , dry_run : bool ) -> Self {
2723+ fn dry_run ( self , dry_run : Option < DryRun > ) -> Self {
27182724 self . tx ( |x| Tx { dry_run, ..x } )
27192725 }
2720- /// Simulate applying both the wrapper and inner transactions
2721- fn dry_run_wrapper ( self , dry_run_wrapper : bool ) -> Self {
2722- self . tx ( |x| Tx {
2723- dry_run_wrapper,
2724- ..x
2725- } )
2726- }
27272726 /// Dump the transaction bytes to file
27282727 fn dump_tx ( self , dump_tx : bool ) -> Self {
27292728 self . tx ( |x| Tx { dump_tx, ..x } )
0 commit comments