diff --git a/clients/js/package.json b/clients/js/package.json index 1a1706e..a6ed43d 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -1,6 +1,6 @@ { - "name": "@metaplex-foundation/mpl-project-name", - "version": "0.1.0", + "name": "@void_devourers/mpl-rewards-client", + "version": "0.1.14", "description": "My project description", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", diff --git a/clients/js/src/generated/types/lockupPeriod.ts b/clients/js/src/generated/types/lockupPeriod.ts index a95f519..4f78119 100644 --- a/clients/js/src/generated/types/lockupPeriod.ts +++ b/clients/js/src/generated/types/lockupPeriod.ts @@ -10,6 +10,7 @@ import { Serializer, scalarEnum } from '@metaplex-foundation/umi/serializers'; export enum LockupPeriod { None, + Test, Flex, ThreeMonths, SixMonths, diff --git a/clients/rust/src/generated/types/lockup_period.rs b/clients/rust/src/generated/types/lockup_period.rs index 008e5e3..8b0aa28 100644 --- a/clients/rust/src/generated/types/lockup_period.rs +++ b/clients/rust/src/generated/types/lockup_period.rs @@ -15,6 +15,7 @@ use num_derive::FromPrimitive; #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum LockupPeriod { None, + Test, Flex, ThreeMonths, SixMonths, diff --git a/idls/mplx_rewards.json b/idls/mplx_rewards.json index 18eeafc..e81fbcf 100644 --- a/idls/mplx_rewards.json +++ b/idls/mplx_rewards.json @@ -721,6 +721,9 @@ { "name": "None" }, + { + "name": "Test" + }, { "name": "Flex" }, diff --git a/programs/rewards/src/state/reward_pool.rs b/programs/rewards/src/state/reward_pool.rs index 2a537b2..f9dc293 100644 --- a/programs/rewards/src/state/reward_pool.rs +++ b/programs/rewards/src/state/reward_pool.rs @@ -141,9 +141,9 @@ impl<'a> WrappedRewardPool<'a> { self.pool.total_share = self.consume_old_modifiers(beginning_of_the_day, self.pool.total_share)?; - if self.cumulative_index.contains(&beginning_of_the_day) { - return Ok(()); - } + // if self.cumulative_index.contains(&beginning_of_the_day) { + // return Ok(()); + // } WrappedRewardPool::update_index( self.cumulative_index, diff --git a/programs/rewards/src/utils.rs b/programs/rewards/src/utils.rs index 255984e..5d5d936 100644 --- a/programs/rewards/src/utils.rs +++ b/programs/rewards/src/utils.rs @@ -211,6 +211,7 @@ impl AccountLoader { pub enum LockupPeriod { /// Unreachable option None, + Test, /// Unlimited lockup period. Flex, /// Three months @@ -231,6 +232,7 @@ impl LockupPeriod { LockupPeriod::SixMonths => 4, LockupPeriod::OneYear => 6, LockupPeriod::Flex => 1, + LockupPeriod::Test => 1, } } @@ -245,6 +247,7 @@ impl LockupPeriod { LockupPeriod::SixMonths => Ok(beginning_of_the_day + SECONDS_PER_DAY * 180), LockupPeriod::OneYear => Ok(beginning_of_the_day + SECONDS_PER_DAY * 365), LockupPeriod::Flex => Ok(beginning_of_the_day + SECONDS_PER_DAY * 5), + LockupPeriod::Test => Ok(beginning_of_the_day + 120), } } @@ -256,6 +259,7 @@ impl LockupPeriod { LockupPeriod::SixMonths => Ok(180), LockupPeriod::OneYear => Ok(365), LockupPeriod::Flex => Ok(5), + LockupPeriod::Test => Ok(0), } } }