7272
7373#![ cfg_attr( not( feature = "std" ) , no_std) ]
7474
75+ // not all specific usages can be marked as deprecated
76+ #![ allow( deprecated) ]
77+
7578mod benchmarking;
7679pub mod migration;
7780#[ cfg( test) ]
@@ -240,6 +243,9 @@ pub mod pallet {
240243 ///
241244 /// NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
242245 #[ pallet:: constant]
246+ #[ deprecated(
247+ note = "Gov v1 type used for spend_local, configure pallet to use PayFromAccount for Paymaster type instead"
248+ ) ]
243249 type MaxApprovals : Get < u32 > ;
244250
245251 /// The origin required for approving spends from the treasury outside of the proposal
@@ -279,10 +285,17 @@ pub mod pallet {
279285
280286 /// Number of proposals that have been made.
281287 #[ pallet:: storage]
288+ #[ deprecated(
289+ note = "Gov v1 type used for spend_local, configure pallet to use PayFromAccount for Paymaster type instead"
290+ ) ]
282291 pub type ProposalCount < T , I = ( ) > = StorageValue < _ , ProposalIndex , ValueQuery > ;
283292
284293 /// Proposals that have been made.
285294 #[ pallet:: storage]
295+ #[ deprecated(
296+ note = "Gov v1 type used for spend_local, configure pallet to use PayFromAccount for Paymaster type instead"
297+ ) ]
298+ #[ allow( deprecated) ]
286299 pub type Proposals < T : Config < I > , I : ' static = ( ) > = StorageMap <
287300 _ ,
288301 Twox64Concat ,
@@ -298,6 +311,10 @@ pub mod pallet {
298311
299312 /// Proposal indices that have been approved but not yet awarded.
300313 #[ pallet:: storage]
314+ #[ deprecated(
315+ note = "Gov v1 type used for spend_local, configure pallet to use PayFromAccount for Paymaster type instead"
316+ ) ]
317+ #[ allow( deprecated) ]
301318 pub type Approvals < T : Config < I > , I : ' static = ( ) > =
302319 StorageValue < _ , BoundedVec < ProposalIndex , T :: MaxApprovals > , ValueQuery > ;
303320
@@ -470,6 +487,8 @@ pub mod pallet {
470487 /// Emits [`Event::SpendApproved`] if successful.
471488 #[ pallet:: call_index( 3 ) ]
472489 #[ pallet:: weight( T :: WeightInfo :: spend_local( ) ) ]
490+ #[ deprecated( note = "This call will be removed by May 2025. Configure pallet to use PayFromAccount for Paymaster type instead" ) ]
491+ #[ allow( deprecated) ]
473492 pub fn spend_local (
474493 origin : OriginFor < T > ,
475494 #[ pallet:: compact] amount : BalanceOf < T , I > ,
@@ -499,7 +518,9 @@ pub mod pallet {
499518 . unwrap_or ( Ok ( ( ) ) ) ?;
500519
501520 let beneficiary = T :: Lookup :: lookup ( beneficiary) ?;
521+ #[ allow( deprecated) ]
502522 let proposal_index = ProposalCount :: < T , I > :: get ( ) ;
523+ #[ allow( deprecated) ]
503524 Approvals :: < T , I > :: try_append ( proposal_index)
504525 . map_err ( |_| Error :: < T , I > :: TooManyApprovals ) ?;
505526 let proposal = Proposal {
@@ -508,7 +529,9 @@ pub mod pallet {
508529 beneficiary : beneficiary. clone ( ) ,
509530 bond : Default :: default ( ) ,
510531 } ;
532+ #[ allow( deprecated) ]
511533 Proposals :: < T , I > :: insert ( proposal_index, proposal) ;
534+ #[ allow( deprecated) ]
512535 ProposalCount :: < T , I > :: put ( proposal_index + 1 ) ;
513536
514537 Self :: deposit_event ( Event :: SpendApproved { proposal_index, amount, beneficiary } ) ;
@@ -538,12 +561,17 @@ pub mod pallet {
538561 /// in the first place.
539562 #[ pallet:: call_index( 4 ) ]
540563 #[ pallet:: weight( ( T :: WeightInfo :: remove_approval( ) , DispatchClass :: Operational ) ) ]
564+ #[ deprecated(
565+ note = "This call will be removed by May 2025. Configure pallet to use PayFromAccount for Paymaster type instead"
566+ ) ]
567+ #[ allow( deprecated) ]
541568 pub fn remove_approval (
542569 origin : OriginFor < T > ,
543570 #[ pallet:: compact] proposal_id : ProposalIndex ,
544571 ) -> DispatchResult {
545572 T :: RejectOrigin :: ensure_origin ( origin) ?;
546573
574+ #[ allow( deprecated) ]
547575 Approvals :: < T , I > :: try_mutate ( |v| -> DispatchResult {
548576 if let Some ( index) = v. iter ( ) . position ( |x| x == & proposal_id) {
549577 v. remove ( index) ;
@@ -793,16 +821,28 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
793821 }
794822
795823 /// Public function to proposal_count storage.
824+ #[ deprecated(
825+ note = "This function will be removed by May 2025. Configure pallet to use PayFromAccount for Paymaster type instead"
826+ ) ]
796827 pub fn proposal_count ( ) -> ProposalIndex {
828+ #[ allow( deprecated) ]
797829 ProposalCount :: < T , I > :: get ( )
798830 }
799831
800832 /// Public function to proposals storage.
833+ #[ deprecated(
834+ note = "This function will be removed by May 2025. Configure pallet to use PayFromAccount for Paymaster type instead"
835+ ) ]
801836 pub fn proposals ( index : ProposalIndex ) -> Option < Proposal < T :: AccountId , BalanceOf < T , I > > > {
837+ #[ allow( deprecated) ]
802838 Proposals :: < T , I > :: get ( index)
803839 }
804840
805841 /// Public function to approvals storage.
842+ #[ deprecated(
843+ note = "This function will be removed by May 2025. Configure pallet to use PayFromAccount for Paymaster type instead"
844+ ) ]
845+ #[ allow( deprecated) ]
806846 pub fn approvals ( ) -> BoundedVec < ProposalIndex , T :: MaxApprovals > {
807847 Approvals :: < T , I > :: get ( )
808848 }
@@ -817,6 +857,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
817857
818858 let mut missed_any = false ;
819859 let mut imbalance = PositiveImbalanceOf :: < T , I > :: zero ( ) ;
860+ #[ allow( deprecated) ]
820861 let proposals_len = Approvals :: < T , I > :: mutate ( |v| {
821862 let proposals_approvals_len = v. len ( ) as u32 ;
822863 v. retain ( |& index| {
0 commit comments