-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(target_chains/solana): add format_matches to all accounts
- Loading branch information
Showing
4 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
12 changes: 11 additions & 1 deletion
12
target_chains/solana/programs/pyth-price-publisher/src/accounts.rs
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,4 +1,14 @@ | ||
use bytemuck::from_bytes; | ||
|
||
pub mod buffer; | ||
pub mod config; | ||
pub mod errors; | ||
pub mod publisher_config; | ||
pub mod buffer; | ||
|
||
fn format(data: &[u8]) -> Option<u32> { | ||
if data.len() < size_of::<u32>() { | ||
return None; | ||
} | ||
let format: &u32 = from_bytes(&data[..size_of::<u32>()]); | ||
Some(*format) | ||
} |
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