Skip to content

Commit

Permalink
extract fee-structure crate
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Oct 25, 2024
1 parent aad0381 commit 563bbb4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ members = [
"sdk/epoch-schedule",
"sdk/feature-set",
"sdk/fee-calculator",
"sdk/fee-structure",
"sdk/gen-headers",
"sdk/hash",
"sdk/instruction",
Expand Down Expand Up @@ -419,6 +420,7 @@ solana-epoch-schedule = { path = "sdk/epoch-schedule", version = "=2.1.0" }
solana-faucet = { path = "faucet", version = "=2.1.0" }
solana-feature-set = { path = "sdk/feature-set", version = "=2.1.0" }
solana-fee-calculator = { path = "sdk/fee-calculator", version = "=2.1.0" }
solana-fee-structure = { path = "sdk/fee-structure", version = "=2.1.0" }
solana-fee = { path = "fee", version = "=2.1.0" }
solana-frozen-abi = { path = "frozen-abi", version = "=2.1.0" }
solana-frozen-abi-macro = { path = "frozen-abi/macro", version = "=2.1.0" }
Expand Down
27 changes: 27 additions & 0 deletions sdk/fee-structure/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[package]
name = "solana-fee-structure"
description = "Solana fee structures."
documentation = "https://docs.rs/solana-fee-structure"
version = { workspace = true }
authors = { workspace = true }
repository = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
edition = { workspace = true }

[dependencies]
serde = { workspace = true, optional = true }
serde_derive = { workspace = true, optional = true }
solana-native-token = { workspace = true }

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

[target.'cfg(not(target_os = "solana"))'.dependencies]
solana-program = { workspace = true, default-features = false }

[features]
serde = ["dep:serde", "dep:serde_derive"]

[lints]
workspace = true
6 changes: 5 additions & 1 deletion sdk/src/fee.rs → sdk/fee-structure/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ pub struct FeeStructure {
pub compute_fee_bins: Vec<FeeBin>,
}

#[derive(Debug, Default, Clone, Copy, Eq, PartialEq, Deserialize, Serialize)]
#[cfg_attr(
feature = "serde",
derive(serde_derive::Deserialize, serde_derive::Serialize)
)]
#[derive(Debug, Default, Clone, Copy, Eq, PartialEq)]
pub struct FeeDetails {
transaction_fee: u64,
prioritization_fee: u64,
Expand Down
3 changes: 2 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ pub mod epoch_rewards_hasher;
pub mod example_mocks;
pub mod exit;
pub mod feature;
pub mod fee;
pub mod genesis_config;
pub mod hard_forks;
pub mod hash;
Expand Down Expand Up @@ -120,6 +119,8 @@ pub use solana_decode_error as decode_error;
pub use solana_derivation_path as derivation_path;
#[deprecated(since = "2.1.0", note = "Use `solana-feature-set` crate instead")]
pub use solana_feature_set as feature_set;
#[deprecated(since = "2.1.0", note = "Use `solana-fee-structure` crate instead")]
pub use solana_fee_structure as fee;
#[deprecated(since = "2.1.0", note = "Use `solana-program-memory` crate instead")]
pub use solana_program_memory as program_memory;
#[deprecated(since = "2.1.0", note = "Use `solana_pubkey::pubkey` instead")]
Expand Down

0 comments on commit 563bbb4

Please sign in to comment.