Skip to content

Commit 2a24fc2

Browse files
authored
Merge pull request #7 from lazor-kit/check-spelling
Standardize error terminology in default_policy JSON, TypeScript, and…
2 parents 4bb09fb + 3bd6905 commit 2a24fc2

6 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎contract-integration/anchor/idl/default_policy.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
},
147147
{
148148
"code": 6001,
149-
"name": "UnAuthorize",
149+
"name": "Unauthorized",
150150
"msg": "Unauthorized to access smart wallet"
151151
}
152152
],

‎contract-integration/anchor/types/default_policy.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export type DefaultPolicy = {
152152
},
153153
{
154154
code: 6001;
155-
name: 'unAuthorize';
155+
name: 'unauthorized';
156156
msg: 'Unauthorized to access smart wallet';
157157
}
158158
];

‎programs/default_policy/src/error.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ pub enum PolicyError {
55
#[msg("Invalid passkey format")]
66
InvalidPasskey,
77
#[msg("Unauthorized to access smart wallet")]
8-
UnAuthorize,
8+
Unauthorized,
99
}

‎programs/default_policy/src/instructions/check_policy.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub struct CheckPolicy<'info> {
1515
#[account(
1616
mut,
1717
owner = ID,
18-
constraint = wallet_device.key() == policy.wallet_device @ PolicyError::UnAuthorize,
19-
constraint = policy.smart_wallet == smart_wallet.key() @ PolicyError::UnAuthorize,
18+
constraint = wallet_device.key() == policy.wallet_device @ PolicyError::Unauthorized,
19+
constraint = policy.smart_wallet == smart_wallet.key() @ PolicyError::Unauthorized,
2020
)]
2121
pub policy: Account<'info, Policy>,
2222
}

‎programs/lazorkit/src/instructions/execute/chunk/execute_session_transaction.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub fn execute_session_transaction(
5353

5454
// Validate program is executable only (no whitelist/rule checks here)
5555
if !ctx.accounts.cpi_program.executable {
56-
msg!("Cpi program must executable");
56+
msg!("Cpi program must be executable");
5757
return Ok(());
5858
}
5959

‎programs/lazorkit/src/security.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
use anchor_lang::prelude::*;
22

3-
use crate::error::LazorKitError;
4-
53
// Security constants and validation utilities
64

75
/// Maximum allowed size for credential ID to prevent DoS
@@ -99,7 +97,10 @@ pub mod validation {
9997
pub fn validate_program_executable(program: &AccountInfo) -> Result<()> {
10098
require!(program.executable, LazorKitError::ProgramNotExecutable);
10199

102-
require!(program.key() != crate::ID, LazorKitError::ReentrancyDetected);
100+
require!(
101+
program.key() != crate::ID,
102+
LazorKitError::ReentrancyDetected
103+
);
103104
Ok(())
104105
}
105106

@@ -137,4 +138,4 @@ pub mod validation {
137138
);
138139
Ok(())
139140
}
140-
}
141+
}

0 commit comments

Comments
 (0)