forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c46929
commit adc79cb
Showing
6 changed files
with
5 additions
and
89 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
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 |
---|---|---|
@@ -1,22 +1,9 @@ | ||
use {solana_accounts_db::accounts_hash::AccountsLtHash, solana_lattice_hash::lt_hash::LtHash}; | ||
|
||
/// Snapshot serde-safe AccountsLtHash | ||
#[cfg_attr(feature = "frozen-abi", derive(AbiExample))] | ||
#[serde_with::serde_as] | ||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] | ||
pub struct SerdeAccountsLtHash( | ||
// serde only has array support up to 32 elements; anything larger needs to be handled manually | ||
// see https://github.com/serde-rs/serde/issues/1937 for more information | ||
#[serde_as(as = "[_; LtHash::NUM_ELEMENTS]")] pub [u16; LtHash::NUM_ELEMENTS], | ||
#[serde_as(as = "[_; 1024]")] pub [u16; 1024], | ||
); | ||
|
||
impl From<SerdeAccountsLtHash> for AccountsLtHash { | ||
fn from(accounts_lt_hash: SerdeAccountsLtHash) -> Self { | ||
Self(LtHash(accounts_lt_hash.0)) | ||
} | ||
} | ||
impl From<AccountsLtHash> for SerdeAccountsLtHash { | ||
fn from(accounts_lt_hash: AccountsLtHash) -> Self { | ||
Self(accounts_lt_hash.0 .0) | ||
} | ||
} |