Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ repos:
- id: cargo-fmt-message-buffer
name: Cargo format for message buffer contract
language: "rust"
entry: cargo +nightly fmt --manifest-path ./message_buffer/Cargo.toml --all -- --config-path rustfmt.toml
entry: cargo +nightly fmt --manifest-path ./pythnet/message_buffer/Cargo.toml --all -- --config-path rustfmt.toml
pass_filenames: false
files: message_buffer
- id: cargo-clippy-message-buffer
name: Cargo clippy for message buffer contract
language: "rust"
entry: cargo +nightly clippy --manifest-path ./message_buffer/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
entry: cargo +nightly clippy --manifest-path ./pythnet/message_buffer/Cargo.toml --tests --fix --allow-dirty --allow-staged -- -D warnings
pass_filenames: false
files: message_buffer
# Hooks for solana receiver contract
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions pythnet/pythnet_sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[package]
name = "solana-pyth"
version = "1.13.6"
description = "Pyth Runtime for Solana"
authors = ["Pyth Data Association"]
repository = "https://github.com/pyth-network/pythnet"
edition = "2021"

[dependencies]
borsh = "0.9.1"
bincode = "1.3.1"
bytemuck = { version = "1.11.0", features = ["derive"] }
fast-math = "0.1"
hex = { version = "0.4.3", features = ["serde"] }
serde = { version = "1.0.144", features = ["derive"] }
sha3 = "0.10.4"
slow_primes = "0.1.14"

[dev-dependencies]
rand = "0.7.0"

[lib]
crate-type = ["lib"]
name = "solana_pyth"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[build-dependencies]
rustc_version = "0.4"
17 changes: 17 additions & 0 deletions pythnet/pythnet_sdk/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Merge all imports into a clean vertical list of module imports.
imports_granularity = "One"
group_imports = "One"
imports_layout = "Vertical"

# Better grep-ability.
empty_item_single_line = false

# Consistent pipe layout.
match_arm_leading_pipes = "Preserve"

# Align Fields
enum_discrim_align_threshold = 80
struct_field_align_threshold = 80

# Allow up to two blank lines for visual grouping.
blank_lines_upper_bound = 2
9 changes: 9 additions & 0 deletions pythnet/pythnet_sdk/src/accumulators.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pub mod merkle;
mod mul;

pub trait Accumulator<'a>: Sized {
type Proof: 'a;
fn from_set(items: impl Iterator<Item = &'a &'a [u8]>) -> Option<Self>;
fn prove(&'a self, item: &[u8]) -> Option<Self::Proof>;
fn verify(&'a self, proof: Self::Proof, item: &[u8]) -> bool;
}
Loading