Skip to content

Commit

Permalink
lock-up: fix error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ece committed Oct 6, 2024
1 parent 0392215 commit 12857a4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions anchor/programs/glam/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ pub enum PolicyError {
TransfersDisabled,
#[msg("Policy violation: amount too big")]
AmountTooBig,
#[msg("Policy violation: lock out period")]
LockOut,
#[msg("Policy violation: lock-up period")]
LockUp,
}
2 changes: 1 addition & 1 deletion anchor/programs/glam/src/instructions/investor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ pub fn redeem_handler<'c: 'info, 'info>(

let cur_timestamp = Clock::get()?.unix_timestamp;
if cur_timestamp < locked_until_ts {
return err!(PolicyError::LockOut);
return err!(PolicyError::LockUp);
}

// If the lock-up period has expired, we can delete the
Expand Down
2 changes: 1 addition & 1 deletion anchor/programs/glam/src/instructions/policy_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn execute(ctx: Context<TransferHook>, amount: u64) -> Result<()> {

let cur_timestamp = Clock::get()?.unix_timestamp;
if cur_timestamp < locked_until_ts {
return err!(PolicyError::LockOut);
return err!(PolicyError::LockUp);
}

Ok(())
Expand Down
13 changes: 9 additions & 4 deletions anchor/target/idl/glam.json
Original file line number Diff line number Diff line change
Expand Up @@ -3866,13 +3866,18 @@
"errors": [
{
"code": 6000,
"name": "NotAuthorized",
"msg": "Signer is not authorized"
"name": "TransfersDisabled",
"msg": "Policy violation: transfers disabled"
},
{
"code": 6001,
"name": "IntegrationDisabled",
"msg": "Integration is disabled"
"name": "AmountTooBig",
"msg": "Policy violation: amount too big"
},
{
"code": 6002,
"name": "LockUp",
"msg": "Policy violation: lock-up period"
}
],
"types": [
Expand Down
13 changes: 9 additions & 4 deletions anchor/target/types/glam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3872,13 +3872,18 @@ export type Glam = {
"errors": [
{
"code": 6000,
"name": "notAuthorized",
"msg": "Signer is not authorized"
"name": "transfersDisabled",
"msg": "Policy violation: transfers disabled"
},
{
"code": 6001,
"name": "integrationDisabled",
"msg": "Integration is disabled"
"name": "amountTooBig",
"msg": "Policy violation: amount too big"
},
{
"code": 6002,
"name": "lockUp",
"msg": "Policy violation: lock-up period"
}
],
"types": [
Expand Down

0 comments on commit 12857a4

Please sign in to comment.