Skip to content

Commit 87ea104

Browse files
committed
rename to staking program. clean up warnings of unused variables.
1 parent 9da590a commit 87ea104

File tree

13 files changed

+30
-51
lines changed

13 files changed

+30
-51
lines changed

Cargo.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = [
99
"common/*",
1010
"solana/allocator",
1111
"solana/restaking/programs/*",
12-
"solana/restaking-v2/programs/*",
12+
"solana/staking/programs/*",
1313
"solana/signature-verifier",
1414
"solana/solana-ibc/programs/*",
1515
"solana/trie",

solana/merkle-distributor/src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ pub enum ErrorCode {
3333
SameAdmin,
3434
#[msg("Claim window expired")]
3535
ClaimExpired,
36+
#[msg("Claim not started yet")]
37+
ClaimNotStarted,
3638
#[msg("Arithmetic Error (overflow/underflow)")]
3739
ArithmeticError,
3840
#[msg("Start Timestamp cannot be after end Timestamp")]

solana/merkle-distributor/src/instructions/claim_locked.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,14 @@ pub fn handle_claim_locked(ctx: Context<ClaimLocked>) -> Result<()> {
7171

7272
require!(!distributor.clawed_back, ErrorCode::ClaimExpired);
7373

74+
require!(
75+
curr_ts < distributor.start_ts,
76+
ErrorCode::ClaimNotStarted,
77+
);
78+
7479
//allow to withdraw only when the lockup period is over
7580
let amount = claim_status.amount_withdrawable(
7681
curr_ts,
77-
distributor.start_ts,
78-
distributor.end_ts,
7982
distributor.duration,
8083
)?;
8184

solana/merkle-distributor/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ pub mod merkle_distributor {
113113
handle_set_admin(ctx)
114114
}
115115

116+
#[allow(clippy::result_large_err)]
116117
pub fn update_stake(
117118
ctx: Context<SetStake>,
118119
amount: u64,

solana/merkle-distributor/src/state/claim_status.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ impl ClaimStatus {
3535
pub fn amount_withdrawable(
3636
&mut self,
3737
curr_ts: i64,
38-
start_ts: i64,
39-
end_ts: i64,
4038
duration: i64,
4139
) -> Result<u64> {
4240

@@ -267,7 +265,7 @@ mod tests {
267265
};
268266

269267
assert_eq!(
270-
claim_status.amount_withdrawable(curr_ts, 0, 100, 0),
268+
claim_status.amount_withdrawable(curr_ts, 0),
271269
Ok(expected)
272270
);
273271
}
File renamed without changes.

solana/restaking-v2/programs/restaking-v2/Cargo.toml renamed to solana/staking/programs/staking/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "restaking_v2"
2+
name = "staking"
33
version = "0.1.0"
44
description = "Created with Anchor"
55
edition = "2021"
66

77
[lib]
88
crate-type = ["cdylib", "lib"]
9-
name = "restaking_v2"
9+
name = "staking"
1010

1111
[features]
1212
# added so that we can compile this along with `solana-ibc` with mocks features. Currently unused.
File renamed without changes.

0 commit comments

Comments
 (0)