Skip to content

Commit 08122b3

Browse files
kevinheaveyjoncinque
authored andcommitted
sdk: Extract clock crate (#1967)
* extract clock crate * update clock usage in solana-program * fmt * fmt after rebase * update lock file after rebase * fmt after rebase * fmt after rebase * fmt * make serde optional in solana-clock * fix description Co-authored-by: Jon C <me@jonc.dev> * fix docs link Co-authored-by: Jon C <me@jonc.dev> * fix accidental deletions from workspace members table --------- Co-authored-by: Jon C <me@jonc.dev>
1 parent 04a4bfa commit 08122b3

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

interface/src/instruction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
use {
77
crate::{
8-
clock::{Epoch, UnixTimestamp},
98
instruction::{AccountMeta, Instruction},
109
program_error::ProgramError,
1110
pubkey::Pubkey,
@@ -19,6 +18,7 @@ use {
1918
log::*,
2019
num_derive::{FromPrimitive, ToPrimitive},
2120
serde_derive::{Deserialize, Serialize},
21+
solana_clock::{Epoch, UnixTimestamp},
2222
solana_decode_error::DecodeError,
2323
thiserror::Error,
2424
};

interface/src/stake_history.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//!
77
//! [`sysvar::stake_history`]: crate::sysvar::stake_history
88
9-
pub use crate::clock::Epoch;
9+
pub use solana_clock::Epoch;
1010
use std::ops::Deref;
1111

1212
pub const MAX_ENTRIES: usize = 512; // it should never take as many as 512 epochs to warm up or cool down

interface/src/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use borsh::{io, BorshDeserialize, BorshSchema, BorshSerialize};
99
use {
1010
crate::{
11-
clock::{Clock, Epoch, UnixTimestamp},
1211
instruction::InstructionError,
1312
pubkey::Pubkey,
1413
stake::{
@@ -17,6 +16,7 @@ use {
1716
},
1817
stake_history::{StakeHistoryEntry, StakeHistoryGetEntry},
1918
},
19+
solana_clock::{Clock, Epoch, UnixTimestamp},
2020
std::collections::HashSet,
2121
};
2222

interface/src/tools.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Utility functions
2-
use crate::{
3-
clock::Epoch, program_error::ProgramError, stake::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION,
2+
use {
3+
crate::{program_error::ProgramError, stake::MINIMUM_DELINQUENT_EPOCHS_FOR_DEACTIVATION},
4+
solana_clock::Epoch,
45
};
56

67
/// Helper function for programs to call [`GetMinimumDelegation`] and then fetch the return data

0 commit comments

Comments
 (0)