Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract inflation crate #2970

Merged
merged 5 commits into from
Oct 28, 2024
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
11 changes: 11 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 @@ -117,6 +117,7 @@ members = [
"sdk/fee-calculator",
"sdk/gen-headers",
"sdk/hash",
"sdk/inflation",
"sdk/instruction",
"sdk/macro",
"sdk/msg",
Expand Down Expand Up @@ -433,6 +434,7 @@ agave-geyser-plugin-interface = { path = "geyser-plugin-interface", version = "=
solana-geyser-plugin-manager = { path = "geyser-plugin-manager", version = "=2.1.0" }
solana-gossip = { path = "gossip", version = "=2.1.0" }
solana-hash = { path = "sdk/hash", version = "=2.1.0", default-features = false }
solana-inflation = { path = "sdk/inflation", version = "=2.1.0" }
solana-inline-spl = { path = "inline-spl", version = "=2.1.0" }
solana-instruction = { path = "sdk/instruction", version = "=2.1.0", default-features = false }
solana-last-restart-slot = { path = "sdk/last-restart-slot", version = "=2.1.0" }
Expand Down
9 changes: 9 additions & 0 deletions programs/sbf/Cargo.lock

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

2 changes: 1 addition & 1 deletion runtime/src/bank/serde_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ mod tests {
#[cfg_attr(
feature = "frozen-abi",
derive(AbiExample),
frozen_abi(digest = "2G3gi9LAN7w45KNu4GffLfUUCTQLcChzrvSp7ah3Awbv")
frozen_abi(digest = "WZPdQsksD18CRLSPKbinaMU8uZ5zov3iHJMMNvcamMY")
)]
#[derive(Serialize)]
pub struct BankAbiTestWrapper {
Expand Down
2 changes: 2 additions & 0 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ frozen-abi = [
"dep:solana-frozen-abi-macro",
"solana-feature-set/frozen-abi",
"solana-account/frozen-abi",
"solana-inflation/frozen-abi",
"solana-program/frozen-abi",
"solana-short-vec/frozen-abi",
"solana-signature/frozen-abi",
Expand Down Expand Up @@ -99,6 +100,7 @@ solana-frozen-abi = { workspace = true, optional = true, features = [
solana-frozen-abi-macro = { workspace = true, optional = true, features = [
"frozen-abi",
] }
solana-inflation = { workspace = true, features = ["serde"] }
solana-instruction = { workspace = true }
solana-native-token = { workspace = true }
solana-packet = { workspace = true, features = ["bincode", "serde"] }
Expand Down
23 changes: 23 additions & 0 deletions sdk/inflation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "solana-inflation"
description = "Configuration for Solana network inflation"
documentation = "https://docs.rs/solana-inflation"
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-frozen-abi = { workspace = true, optional = true }
solana-frozen-abi-macro = { workspace = true, optional = true }

[features]
frozen-abi = ["dep:solana-frozen-abi", "dep:solana-frozen-abi-macro"]
serde = ["dep:serde", "dep:serde_derive"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
12 changes: 8 additions & 4 deletions sdk/src/inflation.rs → sdk/inflation/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
//! configuration for network inflation

#[cfg_attr(feature = "frozen-abi", derive(AbiExample))]
#[derive(Serialize, Deserialize, PartialEq, Clone, Debug, Copy)]
#[serde(rename_all = "camelCase")]
#![cfg_attr(feature = "frozen-abi", feature(min_specialization))]
#[cfg(feature = "serde")]
use serde_derive::{Deserialize, Serialize};

#[cfg_attr(feature = "frozen-abi", derive(solana_frozen_abi_macro::AbiExample))]
#[cfg_attr(feature = "serde", derive(Deserialize, Serialize))]
#[derive(PartialEq, Clone, Debug, Copy)]
#[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))]
pub struct Inflation {
/// Initial inflation percentage, from time=0
pub initial: f64,
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/genesis_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl FromStr for ClusterType {
#[cfg_attr(
feature = "frozen-abi",
derive(AbiExample),
frozen_abi(digest = "3GwiwngfwuPnrUyCcnTDYEWfQQzWGuBWR9RRyf9YYgif")
frozen_abi(digest = "41wPwgEZLhp9AS4tjTQebW7cvHnkbSSTN19vaKwVett6")
)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct GenesisConfig {
Expand Down
3 changes: 2 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ pub mod fee;
pub mod genesis_config;
pub mod hard_forks;
pub mod hash;
pub mod inflation;
pub mod inner_instruction;
pub mod log;
pub mod native_loader;
Expand Down Expand Up @@ -119,6 +118,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-inflation` crate instead")]
pub use solana_inflation as inflation;
#[deprecated(since = "2.1.0", note = "Use `solana-packet` crate instead")]
pub use solana_packet as packet;
#[deprecated(since = "2.1.0", note = "Use `solana-program-memory` crate instead")]
Expand Down
Loading