diff --git a/staking/integration-tests/src/staking/instructions.rs b/staking/integration-tests/src/staking/instructions.rs index d7603c9c..fe447e82 100644 --- a/staking/integration-tests/src/staking/instructions.rs +++ b/staking/integration-tests/src/staking/instructions.rs @@ -56,7 +56,7 @@ pub fn init_config_account(svm: &mut litesvm::LiteSVM, payer: &Keypair, pyth_tok governance_authority: payer.pubkey(), pyth_token_mint, pyth_governance_realm: MAINNET_REALM_ID, - unlocking_duration: 1, + removed_unlocking_duration: 1, epoch_duration: EPOCH_DURATION, freeze: false, pda_authority: payer.pubkey(), diff --git a/staking/programs/staking/src/state/global_config.rs b/staking/programs/staking/src/state/global_config.rs index cffec1dd..9c59b6b4 100644 --- a/staking/programs/staking/src/state/global_config.rs +++ b/staking/programs/staking/src/state/global_config.rs @@ -6,18 +6,18 @@ use { #[account] #[derive(Default, BorshSchema)] pub struct GlobalConfig { - pub bump: u8, - pub governance_authority: Pubkey, - pub pyth_token_mint: Pubkey, - pub pyth_governance_realm: Pubkey, - // unlocking_duration is deprecated, but we need to keep it for account structure - pub unlocking_duration: u8, - pub epoch_duration: u64, // epoch duration in seconds - pub freeze: bool, - pub pda_authority: Pubkey, /* Authority that can authorize the transfer of - * locked - * tokens */ - pub governance_program: Pubkey, // Governance program id + pub bump: u8, + pub governance_authority: Pubkey, + pub pyth_token_mint: Pubkey, + pub pyth_governance_realm: Pubkey, + // unlocking_duration is deprecated, but we need to keep the space for account structure + pub removed_unlocking_duration: u8, + pub epoch_duration: u64, // epoch duration in seconds + pub freeze: bool, + pub pda_authority: Pubkey, /* Authority that can authorize the transfer of + * locked + * tokens */ + pub governance_program: Pubkey, // Governance program id /// Once the pyth token is listed, governance can update the config to set this value. /// Once this value is set, vesting schedules that depend on the token list date can start diff --git a/staking/target/idl/staking.json b/staking/target/idl/staking.json index 689407da..2e9e4793 100644 --- a/staking/target/idl/staking.json +++ b/staking/target/idl/staking.json @@ -2621,7 +2621,7 @@ "type": "pubkey" }, { - "name": "unlocking_duration", + "name": "removed_unlocking_duration", "type": "u8" }, { diff --git a/staking/target/types/staking.ts b/staking/target/types/staking.ts index 7fa6e3aa..db1096c4 100644 --- a/staking/target/types/staking.ts +++ b/staking/target/types/staking.ts @@ -2627,7 +2627,7 @@ export type Staking = { "type": "pubkey" }, { - "name": "unlockingDuration", + "name": "removedUnlockingDuration", "type": "u8" }, { diff --git a/staking/tests/config.ts b/staking/tests/config.ts index 982c9c5b..3a153939 100644 --- a/staking/tests/config.ts +++ b/staking/tests/config.ts @@ -66,7 +66,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -99,7 +99,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -126,7 +126,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -149,7 +149,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -176,7 +176,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -199,7 +199,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -224,7 +224,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -332,7 +332,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: program.provider.publicKey, @@ -356,7 +356,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority, @@ -384,7 +384,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority, @@ -407,7 +407,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority, @@ -438,7 +438,7 @@ describe("config", async () => { governanceAuthority: program.provider.publicKey, pythTokenMint: pythMintAccount.publicKey, pythGovernanceRealm, - unlockingDuration: 0, + removedUnlockingDuration: 0, epochDuration: new BN(3600), freeze: false, pdaAuthority: pdaAuthority,