-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implementing history, block storage method
changes after groovies review
- Loading branch information
1 parent
8a9a6e2
commit 7ef29e1
Showing
24 changed files
with
719 additions
and
165 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
use solana_sdk::commitment_config::{CommitmentConfig, CommitmentLevel}; | ||
|
||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)] | ||
#[repr(C)] | ||
pub enum Commitment { | ||
Processed = 0, | ||
Confirmed = 1, | ||
Finalized = 2, | ||
} | ||
|
||
impl From<CommitmentLevel> for Commitment { | ||
#[allow(deprecated)] | ||
fn from(value: CommitmentLevel) -> Self { | ||
match value { | ||
CommitmentLevel::Finalized | CommitmentLevel::Root | CommitmentLevel::Max => { | ||
Commitment::Finalized | ||
} | ||
CommitmentLevel::Confirmed | ||
| CommitmentLevel::Single | ||
| CommitmentLevel::SingleGossip => Commitment::Confirmed, | ||
CommitmentLevel::Processed | CommitmentLevel::Recent => Commitment::Processed, | ||
} | ||
} | ||
} | ||
|
||
impl From<CommitmentConfig> for Commitment { | ||
fn from(value: CommitmentConfig) -> Self { | ||
value.commitment.into() | ||
} | ||
} | ||
|
||
impl Commitment { | ||
pub fn into_commitment_level(&self) -> CommitmentLevel { | ||
match self { | ||
Commitment::Confirmed => CommitmentLevel::Confirmed, | ||
Commitment::Processed => CommitmentLevel::Processed, | ||
Commitment::Finalized => CommitmentLevel::Finalized, | ||
} | ||
} | ||
|
||
pub fn into_commiment_config(&self) -> CommitmentConfig { | ||
CommitmentConfig { | ||
commitment: self.into_commitment_level(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod commitment_utils; | ||
pub mod keypair_loader; | ||
pub mod quic_connection; | ||
pub mod quic_connection_utils; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.