From 2f32e7cff52fdea85eb9c65be3ecc03bb1367fb1 Mon Sep 17 00:00:00 2001 From: Michael Jeffrey Date: Tue, 10 Sep 2024 09:30:47 -0700 Subject: [PATCH] update helium-anchor-gen for `incentive_escrow_fund_bps` field --- Cargo.lock | 44 +++++++++++++++++++++---------------------- solana/src/carrier.rs | 5 +++-- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8f4ebc39..7ae3345b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1627,7 +1627,7 @@ dependencies = [ "rand_chacha 0.3.0", "rust_decimal", "serde", - "sha2 0.9.9", + "sha2 0.10.8", "thiserror", ] @@ -2117,7 +2117,7 @@ dependencies = [ [[package]] name = "circuit-breaker" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -2759,7 +2759,7 @@ dependencies = [ [[package]] name = "data-credits" version = "0.2.2" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -3137,7 +3137,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fanout" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -3707,7 +3707,7 @@ dependencies = [ [[package]] name = "helium-anchor-gen" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -3736,7 +3736,7 @@ dependencies = [ "bs58 0.5.1", "byteorder", "ed25519-compact", - "getrandom 0.1.16", + "getrandom 0.2.10", "k256", "lazy_static", "multihash", @@ -3754,7 +3754,7 @@ dependencies = [ [[package]] name = "helium-entity-manager" version = "0.3.1" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -3826,8 +3826,8 @@ dependencies = [ [[package]] name = "helium-sub-daos" -version = "0.1.7" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +version = "0.1.8" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -3881,7 +3881,7 @@ checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" [[package]] name = "hexboosting" version = "0.1.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -4692,7 +4692,7 @@ dependencies = [ [[package]] name = "lazy-distributor" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -4701,7 +4701,7 @@ dependencies = [ [[package]] name = "lazy-transactions" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -5076,8 +5076,8 @@ dependencies = [ [[package]] name = "mobile-entity-manager" -version = "0.1.2" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +version = "0.1.3" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -5815,7 +5815,7 @@ dependencies = [ "anyhow", "base64 0.21.7", "blake3", - "bs58 0.4.0", + "bs58 0.5.1", "chrono", "clap 4.4.8", "config", @@ -5931,7 +5931,7 @@ dependencies = [ [[package]] name = "price-oracle" version = "0.2.1" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -6547,7 +6547,7 @@ dependencies = [ [[package]] name = "rewards-oracle" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -9162,7 +9162,7 @@ dependencies = [ [[package]] name = "treasury-management" version = "0.2.0" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -9208,7 +9208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.7.3", + "rand 0.8.5", "static_assertions", ] @@ -9403,8 +9403,8 @@ dependencies = [ [[package]] name = "voter-stake-registry" -version = "0.3.2" -source = "git+https://github.com/helium/helium-anchor-gen.git#c46be05d46225141199b847a0b70f387295e0cb9" +version = "0.3.3" +source = "git+https://github.com/helium/helium-anchor-gen.git#54392f522436bc8a8c8b8c0a0b4ec407a28f66ed" dependencies = [ "anchor-gen", "anchor-lang 0.30.1", @@ -9863,7 +9863,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "sha2 0.9.9", + "sha2 0.10.8", "thiserror", "twox-hash", "xorf", diff --git a/solana/src/carrier.rs b/solana/src/carrier.rs index 9d0130c10..aba072138 100644 --- a/solana/src/carrier.rs +++ b/solana/src/carrier.rs @@ -35,8 +35,9 @@ impl SolanaNetwork for SolanaRpc { ); let carrier_data = self.provider.get_account_data(&carrier_pda).await?; let mut carrier_data = carrier_data.as_ref(); - let _carrier = CarrierV0::try_deserialize(&mut carrier_data)?; - let bps: u16 = 0; // carrier.incentive_escrow_fund_bps (not available right now) + let carrier = CarrierV0::try_deserialize(&mut carrier_data)?; + + let bps = carrier.incentive_escrow_fund_bps; let percent = Decimal::from(bps) / dec!(10_000); Ok(percent) }