@@ -29,6 +29,8 @@ use zcash_keys::{
2929 keys:: { UnifiedAddressRequest , UnifiedFullViewingKey , UnifiedSpendingKey } ,
3030} ;
3131use zcash_note_encryption:: Domain ;
32+ #[ cfg( feature = "unstable" ) ]
33+ use zcash_primitives:: transaction:: TxVersion ;
3234use zcash_primitives:: {
3335 block:: BlockHash ,
3436 transaction:: { Transaction , TxId , components:: sapling:: zip212_enforcement, fees:: FeeRule } ,
@@ -1091,6 +1093,43 @@ where
10911093 memo,
10921094 mode,
10931095 confirmations_policy,
1096+ #[ cfg( feature = "unstable" ) ]
1097+ None ,
1098+ )
1099+ }
1100+
1101+ /// Invokes [`propose_send_max_transfer`] with an explicit transaction version.
1102+ #[ cfg( feature = "unstable" ) ]
1103+ #[ allow( clippy:: type_complexity) ]
1104+ #[ allow( clippy:: too_many_arguments) ]
1105+ pub fn propose_send_max_transfer_with_tx_version < FeeRuleT > (
1106+ & mut self ,
1107+ spend_from_account : <DbT as InputSource >:: AccountId ,
1108+ fee_rule : & FeeRuleT ,
1109+ to : ZcashAddress ,
1110+ memo : Option < MemoBytes > ,
1111+ mode : MaxSpendMode ,
1112+ confirmations_policy : ConfirmationsPolicy ,
1113+ proposed_version : TxVersion ,
1114+ ) -> Result <
1115+ Proposal < FeeRuleT , <DbT as InputSource >:: NoteRef > ,
1116+ super :: wallet:: ProposeSendMaxErrT < DbT , Infallible , FeeRuleT > ,
1117+ >
1118+ where
1119+ FeeRuleT : FeeRule + Clone ,
1120+ {
1121+ let network = self . network ( ) . clone ( ) ;
1122+ propose_send_max_transfer :: < _ , _ , _ , Infallible > (
1123+ self . wallet_mut ( ) ,
1124+ & network,
1125+ spend_from_account,
1126+ & [ ShieldedProtocol :: Sapling , ShieldedProtocol :: Orchard ] ,
1127+ fee_rule,
1128+ to,
1129+ memo,
1130+ mode,
1131+ confirmations_policy,
1132+ Some ( proposed_version) ,
10941133 )
10951134 }
10961135
@@ -1139,6 +1178,53 @@ where
11391178 result
11401179 }
11411180
1181+ /// Invokes [`propose_standard_transfer_to_address`] with an explicitly requested
1182+ /// transaction version.
1183+ #[ cfg( feature = "unstable" ) ]
1184+ #[ allow( clippy:: type_complexity) ]
1185+ #[ allow( clippy:: too_many_arguments) ]
1186+ pub fn propose_standard_transfer_with_tx_version < CommitmentTreeErrT > (
1187+ & mut self ,
1188+ spend_from_account : <DbT as InputSource >:: AccountId ,
1189+ fee_rule : StandardFeeRule ,
1190+ confirmations_policy : ConfirmationsPolicy ,
1191+ to : & Address ,
1192+ amount : Zatoshis ,
1193+ memo : Option < MemoBytes > ,
1194+ change_memo : Option < MemoBytes > ,
1195+ fallback_change_pool : ShieldedProtocol ,
1196+ proposed_version : TxVersion ,
1197+ ) -> Result <
1198+ Proposal < StandardFeeRule , <DbT as InputSource >:: NoteRef > ,
1199+ super :: wallet:: ProposeTransferErrT <
1200+ DbT ,
1201+ CommitmentTreeErrT ,
1202+ GreedyInputSelector < DbT > ,
1203+ SingleOutputChangeStrategy < DbT > ,
1204+ > ,
1205+ > {
1206+ let network = self . network ( ) . clone ( ) ;
1207+ let result = propose_standard_transfer_to_address :: < _ , _ , CommitmentTreeErrT > (
1208+ self . wallet_mut ( ) ,
1209+ & network,
1210+ fee_rule,
1211+ spend_from_account,
1212+ confirmations_policy,
1213+ to,
1214+ amount,
1215+ memo,
1216+ change_memo,
1217+ fallback_change_pool,
1218+ Some ( proposed_version) ,
1219+ ) ;
1220+
1221+ if let Ok ( proposal) = & result {
1222+ check_proposal_serialization_roundtrip ( self . wallet ( ) , proposal) ;
1223+ }
1224+
1225+ result
1226+ }
1227+
11421228 /// Invokes [`propose_shielding`] with the given arguments.
11431229 ///
11441230 /// [`propose_shielding`]: crate::data_api::wallet::propose_shielding
@@ -1276,6 +1362,39 @@ where
12761362 )
12771363 }
12781364
1365+ /// Invokes [`create_pczt_from_proposal_with_tx_version`] with the given arguments.
1366+ ///
1367+ /// [`create_pczt_from_proposal_with_tx_version`]: super::wallet::create_pczt_from_proposal_with_tx_version
1368+ #[ cfg( all( feature = "pczt" , feature = "unstable" ) ) ]
1369+ #[ allow( clippy:: type_complexity) ]
1370+ pub fn create_pczt_from_proposal_with_tx_version < InputsErrT , FeeRuleT , ChangeErrT > (
1371+ & mut self ,
1372+ spend_from_account : <DbT as InputSource >:: AccountId ,
1373+ ovk_policy : OvkPolicy ,
1374+ proposal : & Proposal < FeeRuleT , <DbT as InputSource >:: NoteRef > ,
1375+ proposed_version : TxVersion ,
1376+ ) -> Result <
1377+ pczt:: Pczt ,
1378+ super :: wallet:: CreateErrT < DbT , InputsErrT , FeeRuleT , ChangeErrT , DbT :: NoteRef > ,
1379+ >
1380+ where
1381+ <DbT as WalletRead >:: AccountId : serde:: Serialize ,
1382+ FeeRuleT : FeeRule ,
1383+ {
1384+ use super :: wallet:: create_pczt_from_proposal_with_tx_version;
1385+
1386+ let network = self . network ( ) . clone ( ) ;
1387+
1388+ create_pczt_from_proposal_with_tx_version (
1389+ self . wallet_mut ( ) ,
1390+ & network,
1391+ spend_from_account,
1392+ ovk_policy,
1393+ proposal,
1394+ proposed_version,
1395+ )
1396+ }
1397+
12791398 /// Invokes [`extract_and_store_transaction_from_pczt`] with the given arguments.
12801399 ///
12811400 /// [`extract_and_store_transaction_from_pczt`]: super::wallet::extract_and_store_transaction_from_pczt
0 commit comments