diff --git a/Cargo.toml b/Cargo.toml index 356e04bb..b11a461f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,6 +32,8 @@ bytes = { workspace = true } prost = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } +strum = { version = "0.26.3", features = ["derive"] } +strum_macros = "0.26.4" [build-dependencies] tonic-build = { workspace = true, optional = true } diff --git a/build.rs b/build.rs index 58a118f5..b5c2cda4 100644 --- a/build.rs +++ b/build.rs @@ -36,6 +36,10 @@ macro_rules! config { ($config:expr) => { $config .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]") + .enum_attribute( + ".helium.service_provider", + "#[derive(strum_macros::EnumIter)]", + ) .field_attribute( ".helium.tagged_spreading.region_spreading", "#[serde(with = \"serde_region_spreading\" )]", diff --git a/src/lib.rs b/src/lib.rs index 6c84d431..2c1d585b 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,6 +5,7 @@ include!(concat!(env!("OUT_DIR"), "/helium.rs")); pub use blockchain_txn::Txn; pub use prost::{DecodeError, EncodeError, Message}; +pub use strum::IntoEnumIterator; #[cfg(feature = "services")] pub mod services { diff --git a/src/service_provider.proto b/src/service_provider.proto index 313ee295..ebf85e50 100644 --- a/src/service_provider.proto +++ b/src/service_provider.proto @@ -5,3 +5,17 @@ package helium; enum service_provider { helium_mobile = 0; } + +message service_provider_promotion_fund_v1 { + /// The timestamp for this report in milliseconds since unix epoch + uint64 timestamp = 1; + + /// Service Provider that is allocating funds for promotions + service_provider service_provider = 2; + + /// Percentage of Rewards allocated for promotions + /// stored in Basis Points + /// + /// https://www.investopedia.com/terms/b/basispoint.asp + uint32 bps = 3; +}