File tree Expand file tree Collapse file tree 7 files changed +10
-28
lines changed
programs/squads_smart_account_program/src Expand file tree Collapse file tree 7 files changed +10
-28
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,10 @@ pub enum SmartAccountError {
204204 SpendingLimitInvariantCustomPeriodNegative ,
205205 #[ msg( "Spending limit policy invariant violation: cannot have duplicate destinations for the same mint" ) ]
206206 SpendingLimitPolicyInvariantDuplicateDestinations ,
207+ #[ msg( "Spending limit invariant violation: last reset must be between start and expiration" ) ]
208+ SpendingLimitInvariantLastResetOutOfBounds ,
209+ #[ msg( "Spending limit invariant violation: last reset must be greater than start" ) ]
210+ SpendingLimitInvariantLastResetSmallerThanStart ,
207211
208212 // ===============================================
209213 // Internal Fund Transfer Policy Errors
Original file line number Diff line number Diff line change @@ -641,7 +641,7 @@ impl PolicyTrait for ProgramInteractionPolicy {
641641 ) -> Result < ( ) > {
642642 match & payload. transaction_payload {
643643 ProgramInteractionTransactionPayload :: AsyncTransaction ( ..) => {
644- self . execute_payload ( args, payload, accounts)
644+ self . execute_payload_async ( args, payload, accounts)
645645 }
646646 ProgramInteractionTransactionPayload :: SyncTransaction ( ..) => {
647647 self . execute_payload_sync ( args, payload, accounts)
@@ -656,7 +656,7 @@ impl PolicyTrait for ProgramInteractionPolicy {
656656
657657impl ProgramInteractionPolicy {
658658 /// Execute an async transaction through the policy
659- fn execute_payload < ' info > (
659+ fn execute_payload_async < ' info > (
660660 & mut self ,
661661 args : ProgramInteractionExecutionArgs ,
662662 payload : & ProgramInteractionPayload ,
Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ impl PolicyTrait for SettingsChangePolicy {
227227 SmartAccountError :: SettingsChangeAddSignerViolation
228228 ) ;
229229 }
230- // If None, any permissions can used
230+ // If None, any permissions can be used
231231 if let Some ( allowed_permissions) = allowed_permissions {
232232 require ! (
233233 & new_signer. permissions == allowed_permissions,
@@ -380,7 +380,7 @@ impl SettingsChangePolicy {
380380 settings,
381381 rent_payer : Some ( rent_payer) ,
382382 system_program : Some ( system_program) ,
383- program : program ,
383+ program,
384384 } )
385385 }
386386}
Original file line number Diff line number Diff line change 1- //! Policy system for smart accounts
2- //!
3- //! This module provides a unified policy framework for smart accounts, allowing
4- //! different types of policies to be executed through a common consensus mechanism.
5- //!
6- //! ## Structure
7- //!
8- //! - `core/`: Core policy framework (Policy struct, traits, payloads)
9- //! - `implementations/`: Specific policy implementations
10- //! - `tests/`: Test modules for framework and implementations
11-
121pub mod implementations;
132pub mod policy_core;
14- pub mod tests;
153mod utils;
164
175pub use policy_core:: * ;
186
19- // Re-export implementations for convenience
207pub use implementations:: * ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -278,12 +278,12 @@ impl SpendingLimitV2 {
278278 require ! (
279279 self . usage. last_reset >= self . time_constraints. start
280280 && self . usage. last_reset <= expiration,
281- SmartAccountError :: SpendingLimitInvariantRemainingAmountGreaterThanMaxPerPeriod
281+ SmartAccountError :: SpendingLimitInvariantLastResetOutOfBounds
282282 ) ;
283283 } else {
284284 require ! (
285285 self . usage. last_reset >= self . time_constraints. start,
286- SmartAccountError :: SpendingLimitInvariantRemainingAmountGreaterThanMaxPerPeriod
286+ SmartAccountError :: SpendingLimitInvariantLastResetSmallerThanStart
287287 ) ;
288288 }
289289
You can’t perform that action at this time.
0 commit comments