From 045f0eb08878861448eedfd4157d6d90133479b7 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 | 56 +++++++++++++++++++++++-------------------- solana/src/carrier.rs | 5 ++-- 2 files changed, 33 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8f4ebc39..6c8fe705a 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", @@ -3763,7 +3763,7 @@ dependencies = [ [[package]] name = "helium-lib" version = "0.0.0" -source = "git+https://github.com/helium/helium-wallet-rs.git?branch=master#a4db666b45a531d690e561c225ca23c503a08bd1" +source = "git+https://github.com/helium/helium-wallet-rs.git?branch=master#b54819ac4c4bd73be37d25d7d6d48842bbc95ea9" dependencies = [ "anchor-client", "anchor-spl", @@ -3778,6 +3778,7 @@ dependencies = [ "helium-crypto", "helium-proto 0.1.0 (git+https://github.com/helium/proto?branch=master)", "hex", + "hex-literal", "itertools", "jsonrpc_client", "lazy_static", @@ -3792,8 +3793,9 @@ dependencies = [ "solana-sdk", "solana-transaction-status", "spl-account-compression", - "spl-associated-token-account 3.0.2", + "spl-associated-token-account 2.3.0", "thiserror", + "tonic", "tracing", "url", ] @@ -3815,19 +3817,21 @@ dependencies = [ [[package]] name = "helium-proto" version = "0.1.0" -source = "git+https://github.com/helium/proto?branch=master#0bc158704baa751b0f8025a189a07b13e48dcff2" +source = "git+https://github.com/helium/proto?branch=master#376765fe006051d6dcccf709def58e7ed291b845" dependencies = [ "bytes", "prost", "prost-build", "serde", "serde_json", + "tonic", + "tonic-build", ] [[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 +3885,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 +4696,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 +4705,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 +5080,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", @@ -5508,7 +5512,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 2.0.58", @@ -5815,7 +5819,7 @@ dependencies = [ "anyhow", "base64 0.21.7", "blake3", - "bs58 0.4.0", + "bs58 0.5.1", "chrono", "clap 4.4.8", "config", @@ -5931,7 +5935,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 +6551,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 +9166,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 +9212,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 +9407,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 +9867,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) }