Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pyth-network/governance into starti…
Browse files Browse the repository at this point in the history
…ng-epoch
  • Loading branch information
keyvankhademi committed Aug 29, 2024
2 parents fac48e4 + bc9f9ea commit fdc378f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion staking/integration-tests/src/staking/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
24 changes: 12 additions & 12 deletions staking/programs/staking/src/state/global_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion staking/target/idl/staking.json
Original file line number Diff line number Diff line change
Expand Up @@ -2621,7 +2621,7 @@
"type": "pubkey"
},
{
"name": "unlocking_duration",
"name": "removed_unlocking_duration",
"type": "u8"
},
{
Expand Down
2 changes: 1 addition & 1 deletion staking/target/types/staking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2627,7 +2627,7 @@ export type Staking = {
"type": "pubkey"
},
{
"name": "unlockingDuration",
"name": "removedUnlockingDuration",
"type": "u8"
},
{
Expand Down
24 changes: 12 additions & 12 deletions staking/tests/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit fdc378f

Please sign in to comment.