Skip to content

Commit 6a6c7e2

Browse files
Merge pull request #17 from Squads-Protocol/feat/policy-hooks
Feat/policy hooks
2 parents 74d2415 + f2df7ea commit 6a6c7e2

27 files changed

+1991
-517
lines changed

Anchor.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ url = "https://api.devnet.solana.com"
2323
address = "8UuqDAqe9UQx9e9Sjj4Gs3msrWGfzb4CJHGK3U3tcCEX"
2424
filename = "tests/fixtures/pre-rent-collector/multisig-account.json"
2525

26+
[[test.genesis]]
27+
address = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV"
28+
program = "tests/fixtures/noop.so"
29+
2630
[scripts]
2731
test = "npx mocha --node-option require=ts-node/register --extension ts -t 1000000 tests/index.ts"

programs/squads_smart_account_program/src/errors.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ pub enum SmartAccountError {
170170
ProgramInteractionTooManyInstructionConstraints,
171171
#[msg("Program interaction constraint violation: too many spending limits. Max is 10")]
172172
ProgramInteractionTooManySpendingLimits,
173+
#[msg("Program interaction hook violation: template hook error")]
174+
ProgramInteractionTemplateHookError,
175+
#[msg("Program interaction hook violation: hook authority cannot be part of hook accounts")]
176+
ProgramInteractionHookAuthorityCannotBePartOfHookAccounts,
173177

174178
// ===============================================
175179
// Spending Limit Policy Errors

programs/squads_smart_account_program/src/instructions/transaction_execute_sync.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<'info> SyncTransaction<'info> {
151151
&settings_key,
152152
&smart_account_pubkey,
153153
&settings.signers,
154-
settings_compiled_instructions,
154+
&settings_compiled_instructions,
155155
&remaining_accounts,
156156
)?;
157157

@@ -169,7 +169,7 @@ impl<'info> SyncTransaction<'info> {
169169
consensus_account_type: ConsensusAccountType::Settings,
170170
payload: SynchronousTransactionEventPayload::TransactionPayload {
171171
account_index: args.account_index,
172-
instructions: executable_message.instructions,
172+
instructions: executable_message.instructions.to_vec(),
173173
},
174174
signers: ctx.remaining_accounts[..args.num_signers as usize]
175175
.iter()

programs/squads_smart_account_program/src/instructions/transaction_execute_sync_legacy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl LegacySyncTransaction<'_> {
8989
&settings_key,
9090
&smart_account_pubkey,
9191
&settings.signers,
92-
settings_compiled_instructions,
92+
&settings_compiled_instructions,
9393
&ctx.remaining_accounts,
9494
)?;
9595

@@ -109,7 +109,7 @@ impl LegacySyncTransaction<'_> {
109109
.map(|acc| acc.key.clone())
110110
.collect(),
111111
account_index: args.account_index,
112-
instructions: executable_message.instructions,
112+
instructions: executable_message.instructions.to_vec(),
113113
instruction_accounts: executable_message
114114
.accounts
115115
.iter()

0 commit comments

Comments
 (0)