From 481fea3dd747231b385684cffbdab116533c721e 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 | 78 +++++++++++++++++++++---------------------- solana/src/carrier.rs | 5 +-- 2 files changed, 42 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8f4ebc39..afac90ced 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", ] @@ -1823,7 +1823,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ "borsh-derive 0.10.3", - "hashbrown 0.13.1", + "hashbrown 0.12.3", ] [[package]] @@ -2117,10 +2117,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -2759,10 +2759,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -3137,10 +3137,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -3707,10 +3707,10 @@ 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", + "anchor-lang 0.29.0", "circuit-breaker", "data-credits", "fanout", @@ -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,10 +3754,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -3826,11 +3826,11 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -3881,10 +3881,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -4692,19 +4692,19 @@ 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", + "anchor-lang 0.29.0", ] [[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", + "anchor-lang 0.29.0", ] [[package]] @@ -5076,11 +5076,11 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -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,10 +5931,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -6090,7 +6090,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91e6559643f0b377b6f293269251f6a804ae7332c37f7310371f50c833453cd0" dependencies = [ - "anchor-lang 0.30.1", + "anchor-lang 0.29.0", "hex", "pythnet-sdk", "solana-program", @@ -6102,7 +6102,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d674382ba4798254178b47c8a4cdd9ace09cb8d1554a6de180f8ab326c4d5c41" dependencies = [ - "anchor-lang 0.30.1", + "anchor-lang 0.29.0", "bincode", "borsh 0.10.3", "bytemuck", @@ -6547,10 +6547,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -9162,10 +9162,10 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -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,11 +9403,11 @@ 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", + "anchor-lang 0.29.0", ] [[package]] @@ -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) }