From 393267cd47b4621f577130f3ed3b09a56a1cb038 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Mon, 9 Sep 2024 16:00:08 +0200 Subject: [PATCH 1/5] add treasuries pallet --- Cargo.lock | 105 ++++++++++++--------- Cargo.toml | 48 +++++----- client/src/commands/encointer_democracy.rs | 10 +- node/Cargo.toml | 2 + node/src/rpc.rs | 3 + runtime/Cargo.toml | 6 ++ runtime/src/lib.rs | 18 ++++ runtime/src/weights/mod.rs | 2 +- 8 files changed, 121 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70da1d70..48710f4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1999,8 +1999,6 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0a21785d37fcc1d2bc52c4b962ed0ecc1ea0ad7b1421c84c57edb9e11a3d34" dependencies = [ "encointer-primitives", "frame-support", @@ -2016,8 +2014,6 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be52dbf60dfd2fb559b495667ec20dc426fc61486e7aecf92ad668240cdfee8" dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", @@ -2041,8 +2037,6 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc-runtime-api" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449bca6d70a53456d223f2da58189e56a69eff96249b3d660d7d6123d0c824e9" dependencies = [ "encointer-primitives", "frame-support", @@ -2055,8 +2049,6 @@ dependencies = [ [[package]] name = "encointer-ceremonies-assignment" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b698a2f681dee5795ef660661df3165d3287807ba4e78fcc874880b18b3f7ec" dependencies = [ "encointer-primitives", "sp-runtime", @@ -2104,8 +2096,6 @@ dependencies = [ [[package]] name = "encointer-meetup-validation" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf1aa5d61d721fdee928075eac65a2e457d9f63043d3ad43904dab6b4e16938" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -2138,6 +2128,8 @@ dependencies = [ "pallet-encointer-ceremonies-rpc-runtime-api", "pallet-encointer-communities-rpc", "pallet-encointer-communities-rpc-runtime-api", + "pallet-encointer-treasuries-rpc", + "pallet-encointer-treasuries-rpc-runtime-api", "pallet-transaction-payment-rpc", "sc-basic-authorship", "sc-chain-spec", @@ -2204,6 +2196,8 @@ dependencies = [ "pallet-encointer-faucet", "pallet-encointer-reputation-commitments", "pallet-encointer-scheduler", + "pallet-encointer-treasuries", + "pallet-encointer-treasuries-rpc-runtime-api", "pallet-grandpa", "pallet-insecure-randomness-collective-flip", "pallet-proxy", @@ -2237,9 +2231,7 @@ dependencies = [ [[package]] name = "encointer-primitives" -version = "13.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29aaceec9b0e69c648b760ffdf6b52e21e7a95dc3a3dbae2a0de0745ad43ea00" +version = "13.3.0" dependencies = [ "bs58 0.5.1", "crc", @@ -2259,8 +2251,6 @@ dependencies = [ [[package]] name = "encointer-rpc" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e395feb33949c57d56411323afe3691f55c1ab2065f3b5b7b5102b338b96b679" dependencies = [ "jsonrpsee", "jsonrpsee-core", @@ -2327,8 +2317,6 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "ep-core" version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764f4e44c23280f490bcc465af0f0f790f860f2cb1a378d8caf6da4c3cc5c013" dependencies = [ "array-bytes", "impl-serde", @@ -5647,8 +5635,6 @@ dependencies = [ [[package]] name = "pallet-encointer-balances" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85fe03301d9f19ce476b6ce91e0531c6c91b6cb26df88ff4a490ab7493afe026" dependencies = [ "approx", "encointer-primitives", @@ -5667,8 +5653,6 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d38c490fdd90b649b3ec68a8bb25d3cdfaa11223122482737114e00e29f8a5" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5685,8 +5669,6 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a5d30a0befb2ecf70e6685799b6df7d6dfc41d090667955ac78b17eb7b2345" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5706,8 +5688,6 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc-runtime-api" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfc381df1d6346e244994d4a5729b79b60f964ba4c13e29ea2f057627e1db25" dependencies = [ "encointer-primitives", "frame-support", @@ -5719,8 +5699,6 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b76d07f98908e1528413fc4f07162adaaadec0ebe8043fe1beb23ccd2b571b7a" dependencies = [ "encointer-ceremonies-assignment", "encointer-meetup-validation", @@ -5745,8 +5723,6 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256f3d3dfc1cc47f0907a25799bb341ff24fc330fe7cd5e520bced57f1aaab35" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5766,8 +5742,6 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc-runtime-api" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c186e855a19f98ba75ef8d674e71533584620a3d7a8ff653631c391f7a4a9b79" dependencies = [ "encointer-primitives", "frame-support", @@ -5779,8 +5753,6 @@ dependencies = [ [[package]] name = "pallet-encointer-communities" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbd4cb15599fc47c662234cfdb2c1c63f39106c4099383d84c981fe5c40af0e" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5799,8 +5771,6 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "386da89b693e17af39c43c929a08f06e70311eecf97f666394e5c0a3bc47ccb5" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5821,8 +5791,6 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc-runtime-api" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf0ab6667ef6adb7712810f90301e3047e2b7d18ef0e81017dfc9b823d8696f" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -5832,9 +5800,7 @@ dependencies = [ [[package]] name = "pallet-encointer-democracy" -version = "13.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84cfc352962c834b01fd83f1fa855e13d4bb619035754bd3f54d420606450d8f" +version = "13.3.0" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5845,6 +5811,7 @@ dependencies = [ "pallet-encointer-communities", "pallet-encointer-reputation-commitments", "pallet-encointer-scheduler", + "pallet-encointer-treasuries", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -5858,8 +5825,6 @@ dependencies = [ [[package]] name = "pallet-encointer-faucet" version = "13.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3493685d55804d44c674429c7f6eae641700542a4295eea9604677a006ecd46" dependencies = [ "approx", "encointer-primitives", @@ -5879,8 +5844,6 @@ dependencies = [ [[package]] name = "pallet-encointer-reputation-commitments" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb74f5a90b77739db9829a5aa640afc002fd9ebe05ecf07dd61898a98909d5d" dependencies = [ "approx", "encointer-primitives", @@ -5902,8 +5865,6 @@ dependencies = [ [[package]] name = "pallet-encointer-scheduler" version = "13.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc3be9d4a09bd65fad4968354b320cd3cd1913950891293e00fbc879fc09b5d6" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5918,6 +5879,58 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-encointer-treasuries" +version = "13.3.0" +dependencies = [ + "approx", + "encointer-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-encointer-communities", + "pallet-encointer-reputation-commitments", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-encointer-treasuries-rpc" +version = "13.3.0" +dependencies = [ + "encointer-primitives", + "encointer-rpc", + "jsonrpsee", + "log", + "pallet-encointer-treasuries-rpc-runtime-api", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-rpc", + "sc-rpc-api", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-rpc", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "pallet-encointer-treasuries-rpc-runtime-api" +version = "13.3.0" +dependencies = [ + "encointer-primitives", + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-std", +] + [[package]] name = "pallet-grandpa" version = "36.0.0" diff --git a/Cargo.toml b/Cargo.toml index be738c67..c4c578cc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ encointer-balances-tx-payment = { default-features = false, version = "~13.1.0" encointer-balances-tx-payment-rpc = { version = "~13.1.0" } encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "~13.1.0" } encointer-ceremonies-assignment = { version = "~13.1.0" } -encointer-primitives = { default-features = false, version = "~13.2.0" } +encointer-primitives = { default-features = false, version = "~13.3.0" } pallet-encointer-balances = { default-features = false, version = "~13.1.0" } pallet-encointer-bazaar = { default-features = false, version = "~13.1.0" } pallet-encointer-bazaar-rpc = { version = "~13.1.0" } @@ -42,10 +42,13 @@ pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, versio pallet-encointer-communities = { default-features = false, version = "~13.1.0" } pallet-encointer-communities-rpc = { version = "~13.1.0" } pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "~13.1.0" } -pallet-encointer-democracy = { default-features = false, version = "~13.2.0" } +pallet-encointer-democracy = { default-features = false, version = "~13.3.0" } pallet-encointer-faucet = { default-features = false, version = "~13.2.0" } pallet-encointer-reputation-commitments = { default-features = false, version = "~13.1.0" } pallet-encointer-scheduler = { default-features = false, version = "~13.1.0" } +pallet-encointer-treasuries = { default-features = false, version = "~13.3.0" } +pallet-encointer-treasuries-rpc = { version = "~13.3.0" } +pallet-encointer-treasuries-rpc-runtime-api = { default-features = false, version = "~13.3.0" } # substrate deps @@ -140,25 +143,28 @@ substrate-api-client = { git = "https://github.com/encointer/substrate-api-clien ## encointer -#encointer-balances-tx-payment = { path = "../pallets/balances-tx-payment" } -#encointer-balances-tx-payment-rpc = { path = "../pallets/balances-tx-payment/rpc" } -#encointer-balances-tx-payment-rpc-runtime-api = { path = "../pallets/balances-tx-payment/rpc/runtime-api" } -#encointer-ceremonies-assignment = { path = "../pallets/ceremonies/assignment" } -#encointer-primitives = { path = "../pallets/primitives" } -#pallet-encointer-balances = { path = "../pallets/balances" } -#pallet-encointer-bazaar = { path = "../pallets/bazaar" } -#pallet-encointer-bazaar-rpc = { path = "../pallets/bazaar/rpc" } -#pallet-encointer-bazaar-rpc-runtime-api = { path = "../pallets/bazaar/rpc/runtime-api" } -#pallet-encointer-ceremonies = { path = "../pallets/ceremonies" } -#pallet-encointer-ceremonies-rpc = { path = "../pallets/ceremonies/rpc" } -#pallet-encointer-ceremonies-rpc-runtime-api = { path = "../pallets/ceremonies/rpc/runtime-api" } -#pallet-encointer-communities = { path = "../pallets/communities" } -#pallet-encointer-communities-rpc = { path = "../pallets/communities/rpc" } -#pallet-encointer-communities-rpc-runtime-api = { path = "../pallets/communities/rpc/runtime-api" } -#pallet-encointer-democracy = { path = "../pallets/democracy" } -#pallet-encointer-faucet = { path = "../pallets/faucet" } -#pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commitments" } -#pallet-encointer-scheduler = { path = "../pallets/scheduler" } +encointer-balances-tx-payment = { path = "../pallets/balances-tx-payment" } +encointer-balances-tx-payment-rpc = { path = "../pallets/balances-tx-payment/rpc" } +encointer-balances-tx-payment-rpc-runtime-api = { path = "../pallets/balances-tx-payment/rpc/runtime-api" } +encointer-ceremonies-assignment = { path = "../pallets/ceremonies/assignment" } +encointer-primitives = { path = "../pallets/primitives" } +pallet-encointer-balances = { path = "../pallets/balances" } +pallet-encointer-bazaar = { path = "../pallets/bazaar" } +pallet-encointer-bazaar-rpc = { path = "../pallets/bazaar/rpc" } +pallet-encointer-bazaar-rpc-runtime-api = { path = "../pallets/bazaar/rpc/runtime-api" } +pallet-encointer-ceremonies = { path = "../pallets/ceremonies" } +pallet-encointer-ceremonies-rpc = { path = "../pallets/ceremonies/rpc" } +pallet-encointer-ceremonies-rpc-runtime-api = { path = "../pallets/ceremonies/rpc/runtime-api" } +pallet-encointer-communities = { path = "../pallets/communities" } +pallet-encointer-communities-rpc = { path = "../pallets/communities/rpc" } +pallet-encointer-communities-rpc-runtime-api = { path = "../pallets/communities/rpc/runtime-api" } +pallet-encointer-democracy = { path = "../pallets/democracy" } +pallet-encointer-faucet = { path = "../pallets/faucet" } +pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commitments" } +pallet-encointer-scheduler = { path = "../pallets/scheduler" } +pallet-encointer-treasuries = { path = "../pallets/treasuries" } +pallet-encointer-treasuries-rpc = { path = "../pallets/treasuries/rpc" } +pallet-encointer-treasuries-rpc-runtime-api = { path = "../pallets/treasuries/rpc/runtime-api" } # [patch."https://github.com/encointer/substrate-fixed"] # substrate-fixed = { path = "../substrate-fixed" } diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index 007f0d16..a6ac9693 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -7,7 +7,7 @@ use encointer_api_client_extension::{ set_api_extrisic_params_builder, Api, CeremoniesApi, CommunitiesApi, DemocracyApi, EncointerXt, Moment, ParentchainExtrinsicSigner, SchedulerApi, }; -use encointer_node_notee_runtime::Hash; +use encointer_node_notee_runtime::{AccountId, Balance, Hash}; use encointer_primitives::{ ceremonies::{CeremonyIndexType, CommunityCeremony, ReputationCountType}, democracy::{ @@ -39,7 +39,7 @@ pub fn submit_set_inactivity_timeout_proposal( api, "EncointerDemocracy", "submit_proposal", - ProposalAction::SetInactivityTimeout(inactivity_timeout) + ProposalAction::::SetInactivityTimeout(inactivity_timeout) ) .unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; @@ -70,7 +70,7 @@ pub fn submit_update_nominal_income_proposal( api, "EncointerDemocracy", "submit_proposal", - ProposalAction::UpdateNominalIncome(cid, new_income) + ProposalAction::::UpdateNominalIncome(cid, new_income) ) .unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; @@ -100,13 +100,13 @@ pub fn list_proposals(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap: let proposal_lifetime = api.get_proposal_lifetime().await.unwrap(); let min_turnout_permill = api.get_min_turnout().await.unwrap(); println!("📜 Number of proposals: {}, global config: proposal lifetime: {:?}, confirmation period: {:?}, min turnout: {:.3}%", storage_keys.len(), proposal_lifetime, confirmation_period, min_turnout_permill as f64 / 10f64); - let mut proposals: Vec<(ProposalIdType, Proposal)> = Vec::new(); + let mut proposals: Vec<(ProposalIdType, Proposal)> = Vec::new(); for storage_key in storage_keys.iter() { let key_postfix = storage_key.as_ref(); let proposal_id = ProposalIdType::decode(&mut key_postfix[key_postfix.len() - 16..].as_ref()) .unwrap(); - let proposal: Proposal = + let proposal: Proposal = api.get_storage_by_key(storage_key.clone(), maybe_at).await.unwrap().unwrap(); if !matches.all_flag() && proposal.state.has_failed() { continue diff --git a/node/Cargo.toml b/node/Cargo.toml index de639b2c..59f55cbc 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -81,6 +81,8 @@ pallet-encointer-ceremonies-rpc = { workspace = true } pallet-encointer-ceremonies-rpc-runtime-api = { workspace = true, features = ["std"] } pallet-encointer-communities-rpc = { workspace = true } pallet-encointer-communities-rpc-runtime-api = { workspace = true, features = ["std"] } +pallet-encointer-treasuries-rpc = { workspace = true } +pallet-encointer-treasuries-rpc-runtime-api = { workspace = true, features = ["std"] } # CLI-specific dependencies frame-try-runtime = { workspace = true, optional = true } diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 0f255b59..a2ebc028 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -49,6 +49,7 @@ where C::Api: pallet_encointer_communities_rpc_runtime_api::CommunitiesApi, C::Api: pallet_encointer_bazaar_rpc_runtime_api::BazaarApi, + C::Api: pallet_encointer_treasuries_rpc_runtime_api::TreasuriesApi, C::Api: encointer_balances_tx_payment_rpc_runtime_api::BalancesTxPaymentApi< Block, Balance, @@ -63,6 +64,7 @@ where use pallet_encointer_bazaar_rpc::{BazaarApiServer, BazaarRpc}; use pallet_encointer_ceremonies_rpc::{CeremoniesApiServer, CeremoniesRpc}; use pallet_encointer_communities_rpc::{CommunitiesApiServer, CommunitiesRpc}; + use pallet_encointer_treasuries_rpc::{TreasuriesApiServer, TreasuriesRpc}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; use substrate_frame_rpc_system::{System, SystemApiServer}; @@ -75,6 +77,7 @@ where module.merge(BalancesTxPaymentRpc::new(client.clone()).into_rpc())?; module.merge(BazaarRpc::new(client.clone()).into_rpc())?; + module.merge(TreasuriesRpc::new(client.clone()).into_rpc())?; // Extend this RPC with a custom API by using the following syntax. // `YourRpcStruct` should have a reference to a client, which is needed diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index b3c6e03f..50ceaa6f 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -31,6 +31,8 @@ pallet-encointer-democracy = { workspace = true } pallet-encointer-faucet = { workspace = true } pallet-encointer-reputation-commitments = { workspace = true } pallet-encointer-scheduler = { workspace = true } +pallet-encointer-treasuries = { workspace = true } +pallet-encointer-treasuries-rpc-runtime-api = { workspace = true } # substrate deps frame-executive = { workspace = true } @@ -108,6 +110,8 @@ std = [ "pallet-encointer-faucet/std", "pallet-encointer-reputation-commitments/std", "pallet-encointer-scheduler/std", + "pallet-encointer-treasuries-rpc-runtime-api/std", + "pallet-encointer-treasuries/std", "pallet-grandpa/std", "pallet-insecure-randomness-collective-flip/std", "pallet-proxy/std", @@ -157,6 +161,7 @@ runtime-benchmarks = [ "pallet-encointer-faucet/runtime-benchmarks", "pallet-encointer-reputation-commitments/runtime-benchmarks", "pallet-encointer-scheduler/runtime-benchmarks", + "pallet-encointer-treasuries/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-proxy/runtime-benchmarks", "pallet-scheduler/runtime-benchmarks", @@ -186,6 +191,7 @@ try-runtime = [ "pallet-encointer-faucet/try-runtime", "pallet-encointer-reputation-commitments/try-runtime", "pallet-encointer-scheduler/try-runtime", + "pallet-encointer-treasuries/try-runtime", "pallet-grandpa/try-runtime", "pallet-insecure-randomness-collective-flip/try-runtime", "pallet-proxy/try-runtime", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 6e0495e1..80bfdbb6 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -536,6 +536,15 @@ impl pallet_encointer_democracy::Config for Runtime { type WeightInfo = weights::pallet_encointer_democracy::WeightInfo; } +parameter_types! { + pub const TreasuriesPalletId: PalletId = PalletId(*b"trsrysId"); +} +impl pallet_encointer_treasuries::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Currency = pallet_balances::Pallet; + type PalletId = TreasuriesPalletId; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub struct Runtime @@ -566,6 +575,8 @@ construct_runtime!( EncointerReputationCommitments: pallet_encointer_reputation_commitments::{Pallet, Call, Storage, Event} = 65, EncointerFaucet: pallet_encointer_faucet::{Pallet, Call, Storage, Config, Event} = 66, EncointerDemocracy: pallet_encointer_democracy::{Pallet, Call, Storage, Config, Event} = 67, + EncointerTreasuries: pallet_encointer_treasuries::{Pallet, Event} = 68, + } ); @@ -866,6 +877,13 @@ impl_runtime_apis! { } } + impl pallet_encointer_treasuries_rpc_runtime_api::TreasuriesApi for Runtime { + + fn get_community_treasury_account_unchecked(maybecid: &Option) -> AccountId { + EncointerTreasuries::get_community_treasury_account_unchecked(*maybecid) + } + } + #[cfg(feature = "runtime-benchmarks")] impl frame_benchmarking::Benchmark for Runtime { fn benchmark_metadata(extra: bool) -> ( diff --git a/runtime/src/weights/mod.rs b/runtime/src/weights/mod.rs index e8833431..42cb7397 100644 --- a/runtime/src/weights/mod.rs +++ b/runtime/src/weights/mod.rs @@ -9,4 +9,4 @@ pub mod pallet_encointer_democracy; pub mod pallet_encointer_faucet; pub mod pallet_encointer_reputation_commitments; pub mod pallet_encointer_scheduler; -pub mod pallet_treasury; +// pub mod pallet_treasury; From a173c8506d914418991de3e5eaa75fa2dbc3f96c Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Mon, 9 Sep 2024 19:05:15 +0200 Subject: [PATCH 2/5] add cli for treasuries rpc --- .../encointer-api-client-extension/src/lib.rs | 2 ++ .../src/treasuries.rs | 26 +++++++++++++++++++ client/src/commands/encointer_treasuries.rs | 21 +++++++++++++++ client/src/commands/mod.rs | 1 + client/src/main.rs | 5 ++++ 5 files changed, 55 insertions(+) create mode 100644 client/encointer-api-client-extension/src/treasuries.rs create mode 100644 client/src/commands/encointer_treasuries.rs diff --git a/client/encointer-api-client-extension/src/lib.rs b/client/encointer-api-client-extension/src/lib.rs index 1792be8b..78dacf8e 100644 --- a/client/encointer-api-client-extension/src/lib.rs +++ b/client/encointer-api-client-extension/src/lib.rs @@ -23,6 +23,7 @@ pub use democracy::*; pub use extrinsic_params::*; pub use reputation_commitments::*; pub use scheduler::*; +pub use treasuries::*; mod bazaar; mod ceremonies; @@ -31,3 +32,4 @@ mod democracy; mod extrinsic_params; mod reputation_commitments; mod scheduler; +mod treasuries; diff --git a/client/encointer-api-client-extension/src/treasuries.rs b/client/encointer-api-client-extension/src/treasuries.rs new file mode 100644 index 00000000..a7ef57ec --- /dev/null +++ b/client/encointer-api-client-extension/src/treasuries.rs @@ -0,0 +1,26 @@ +use crate::Api; +use encointer_node_notee_runtime::AccountId; +use encointer_primitives::communities::CommunityIdentifier; + +use substrate_api_client::{ac_compose_macros::rpc_params, rpc::Request}; + +#[maybe_async::maybe_async(?Send)] +pub trait TreasuriesApi { + async fn get_community_treasury_account_unchecked( + &self, + maybecid: Option, + ) -> Option; +} + +#[maybe_async::maybe_async(?Send)] +impl TreasuriesApi for Api { + async fn get_community_treasury_account_unchecked( + &self, + maybecid: Option, + ) -> Option { + self.client() + .request("encointer_getCommunityTreasuryAccountUnchecked", rpc_params![maybecid]) + .await + .expect("Could not get treasury address...") + } +} diff --git a/client/src/commands/encointer_treasuries.rs b/client/src/commands/encointer_treasuries.rs new file mode 100644 index 00000000..7eb666a9 --- /dev/null +++ b/client/src/commands/encointer_treasuries.rs @@ -0,0 +1,21 @@ +use crate::{cli_args::EncointerArgsExtractor, utils::get_chain_api}; +use clap::ArgMatches; +use encointer_api_client_extension::{CommunitiesApi, TreasuriesApi}; + +pub fn get_treasury_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let api = get_chain_api(matches).await; + + let maybecid = if let Some(cid) = matches.cid_arg() { + Some(api.verify_cid(cid, None).await) + } else { + None + }; + let treasury = api.get_community_treasury_account_unchecked(maybecid).await.unwrap(); + // only print plain businesses to be able to parse them in python scripts + println!("{treasury}"); + Ok(()) + }) + .into() +} diff --git a/client/src/commands/mod.rs b/client/src/commands/mod.rs index b3db8d42..eb68631d 100644 --- a/client/src/commands/mod.rs +++ b/client/src/commands/mod.rs @@ -6,5 +6,6 @@ pub mod encointer_democracy; pub mod encointer_faucet; pub mod encointer_reputation_commitments; pub mod encointer_scheduler; +pub mod encointer_treasuries; pub mod frame; pub mod keystore; diff --git a/client/src/main.rs b/client/src/main.rs index 68db6023..eb09f237 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -650,6 +650,11 @@ fn main() { }) .runner(commands::encointer_democracy::update_proposal_state), ) + .add_cmd( + Command::new("get-treasury") + .description("get treasury address for a community") + .runner(commands::encointer_treasuries::get_treasury_account), + ) // To handle when no subcommands match .no_cmd(|_args, _matches| { println!("No subcommand matched"); From 48f0bc1c1bf31d2fd51a9221bd36f9663e06e5a5 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 10 Sep 2024 08:39:11 +0200 Subject: [PATCH 3/5] tested successfully --- client/src/commands/encointer_democracy.rs | 43 +++++++++++++++++++++- client/src/main.rs | 23 ++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index a6ac9693..8efbd4b2 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -1,6 +1,9 @@ use crate::cli_args::EncointerArgsExtractor; -use crate::utils::{ensure_payment, get_chain_api, keys::get_pair_from_str}; +use crate::utils::{ + ensure_payment, get_chain_api, + keys::{get_accountid_from_str, get_pair_from_str}, +}; use chrono::{prelude::*, Utc}; use clap::ArgMatches; use encointer_api_client_extension::{ @@ -81,6 +84,44 @@ pub fn submit_update_nominal_income_proposal( .into() } +pub fn submit_spend_native_proposal( + _args: &str, + matches: &ArgMatches<'_>, +) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let who = matches.account_arg().map(get_pair_from_str).unwrap(); + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone()))); + let maybecid = if let Some(cid) = matches.cid_arg() { + Some(api.verify_cid(cid, None).await) + } else { + None + }; + let arg_to = matches.value_of("to").unwrap(); + let to = get_accountid_from_str(arg_to); + let amount = matches + .value_of("amount") + .unwrap() + .parse::() + .expect("amount can be converted to u128"); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerDemocracy", + "submit_proposal", + ProposalAction::::SpendNative(maybecid, to.clone(), amount) + ) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let _result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + println!("Proposal Submitted: Spend Native for cid {maybecid:?} to {to}, amount {amount}"); + Ok(()) + }) + .into() +} pub fn list_proposals(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { diff --git a/client/src/main.rs b/client/src/main.rs index eb09f237..56ad16cf 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -611,6 +611,29 @@ fn main() { }) .runner(commands::encointer_democracy::submit_update_nominal_income_proposal), ) + .add_cmd( + Command::new("submit-spend-native-proposal") + .description("Submit 'spend native' proposal for specified community, amount and beneficiary") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .arg( + Arg::with_name("to") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("beneficiary's AccountId in ss58check format"), + ) + .arg( + Arg::with_name("amount") + .takes_value(true) + .required(true) + .value_name("U128") + .help("amount to be transferred"), + ) + }) + .runner(commands::encointer_democracy::submit_spend_native_proposal), + ) .add_cmd( Command::new("list-proposals") .description("list all proposals.") From f0d4eac3678e04bd47bdce1863cc2dd5c8b56096 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 10 Sep 2024 09:03:33 +0200 Subject: [PATCH 4/5] lift patches and bump crate versions --- Cargo.lock | 58 +++++++++++++++++-- Cargo.toml | 44 +++++++------- client/Cargo.toml | 2 +- .../encointer-api-client-extension/Cargo.toml | 3 +- node/Cargo.toml | 2 +- runtime/Cargo.toml | 4 +- runtime/src/lib.rs | 2 +- 7 files changed, 83 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 48710f4f..d3a39134 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1977,7 +1977,7 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encointer-api-client-extension" -version = "0.8.2" +version = "13.3.2" dependencies = [ "ac-keystore", "async-trait", @@ -1999,6 +1999,8 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0a21785d37fcc1d2bc52c4b962ed0ecc1ea0ad7b1421c84c57edb9e11a3d34" dependencies = [ "encointer-primitives", "frame-support", @@ -2014,6 +2016,8 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1be52dbf60dfd2fb559b495667ec20dc426fc61486e7aecf92ad668240cdfee8" dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", @@ -2037,6 +2041,8 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc-runtime-api" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449bca6d70a53456d223f2da58189e56a69eff96249b3d660d7d6123d0c824e9" dependencies = [ "encointer-primitives", "frame-support", @@ -2049,6 +2055,8 @@ dependencies = [ [[package]] name = "encointer-ceremonies-assignment" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b698a2f681dee5795ef660661df3165d3287807ba4e78fcc874880b18b3f7ec" dependencies = [ "encointer-primitives", "sp-runtime", @@ -2057,7 +2065,7 @@ dependencies = [ [[package]] name = "encointer-client-notee" -version = "1.14.0" +version = "1.14.1" dependencies = [ "ac-keystore", "array-bytes", @@ -2096,6 +2104,8 @@ dependencies = [ [[package]] name = "encointer-meetup-validation" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdf1aa5d61d721fdee928075eac65a2e457d9f63043d3ad43904dab6b4e16938" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -2107,7 +2117,7 @@ dependencies = [ [[package]] name = "encointer-node-notee" -version = "1.14.0" +version = "1.14.1" dependencies = [ "clap 4.5.16", "encointer-balances-tx-payment-rpc", @@ -2167,7 +2177,7 @@ dependencies = [ [[package]] name = "encointer-node-notee-runtime" -version = "1.14.350" +version = "1.14.360" dependencies = [ "encointer-balances-tx-payment", "encointer-balances-tx-payment-rpc-runtime-api", @@ -2232,6 +2242,8 @@ dependencies = [ [[package]] name = "encointer-primitives" version = "13.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66f3cfb30d32e288aee27656132ebac5cc30b82ffb7e82eba92e568cdd0b1f25" dependencies = [ "bs58 0.5.1", "crc", @@ -2251,6 +2263,8 @@ dependencies = [ [[package]] name = "encointer-rpc" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e395feb33949c57d56411323afe3691f55c1ab2065f3b5b7b5102b338b96b679" dependencies = [ "jsonrpsee", "jsonrpsee-core", @@ -2317,6 +2331,8 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "ep-core" version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "764f4e44c23280f490bcc465af0f0f790f860f2cb1a378d8caf6da4c3cc5c013" dependencies = [ "array-bytes", "impl-serde", @@ -5635,6 +5651,8 @@ dependencies = [ [[package]] name = "pallet-encointer-balances" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fe03301d9f19ce476b6ce91e0531c6c91b6cb26df88ff4a490ab7493afe026" dependencies = [ "approx", "encointer-primitives", @@ -5653,6 +5671,8 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d38c490fdd90b649b3ec68a8bb25d3cdfaa11223122482737114e00e29f8a5" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5669,6 +5689,8 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a5d30a0befb2ecf70e6685799b6df7d6dfc41d090667955ac78b17eb7b2345" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5688,6 +5710,8 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc-runtime-api" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfc381df1d6346e244994d4a5729b79b60f964ba4c13e29ea2f057627e1db25" dependencies = [ "encointer-primitives", "frame-support", @@ -5699,6 +5723,8 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b76d07f98908e1528413fc4f07162adaaadec0ebe8043fe1beb23ccd2b571b7a" dependencies = [ "encointer-ceremonies-assignment", "encointer-meetup-validation", @@ -5723,6 +5749,8 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "256f3d3dfc1cc47f0907a25799bb341ff24fc330fe7cd5e520bced57f1aaab35" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5742,6 +5770,8 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc-runtime-api" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c186e855a19f98ba75ef8d674e71533584620a3d7a8ff653631c391f7a4a9b79" dependencies = [ "encointer-primitives", "frame-support", @@ -5753,6 +5783,8 @@ dependencies = [ [[package]] name = "pallet-encointer-communities" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbd4cb15599fc47c662234cfdb2c1c63f39106c4099383d84c981fe5c40af0e" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5771,6 +5803,8 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "386da89b693e17af39c43c929a08f06e70311eecf97f666394e5c0a3bc47ccb5" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5791,6 +5825,8 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc-runtime-api" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf0ab6667ef6adb7712810f90301e3047e2b7d18ef0e81017dfc9b823d8696f" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -5801,6 +5837,8 @@ dependencies = [ [[package]] name = "pallet-encointer-democracy" version = "13.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9727ac7dc16c57b6e8de5b21f60d3f7554b93817d41f25c11e0c809cba174ef" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5825,6 +5863,8 @@ dependencies = [ [[package]] name = "pallet-encointer-faucet" version = "13.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3493685d55804d44c674429c7f6eae641700542a4295eea9604677a006ecd46" dependencies = [ "approx", "encointer-primitives", @@ -5844,6 +5884,8 @@ dependencies = [ [[package]] name = "pallet-encointer-reputation-commitments" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfb74f5a90b77739db9829a5aa640afc002fd9ebe05ecf07dd61898a98909d5d" dependencies = [ "approx", "encointer-primitives", @@ -5865,6 +5907,8 @@ dependencies = [ [[package]] name = "pallet-encointer-scheduler" version = "13.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc3be9d4a09bd65fad4968354b320cd3cd1913950891293e00fbc879fc09b5d6" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5882,6 +5926,8 @@ dependencies = [ [[package]] name = "pallet-encointer-treasuries" version = "13.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65f42991fce5d96f04106e5d27d4c12c77250d70da9ac95497e8fb17a3ebe99f" dependencies = [ "approx", "encointer-primitives", @@ -5901,6 +5947,8 @@ dependencies = [ [[package]] name = "pallet-encointer-treasuries-rpc" version = "13.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658ed30fe3057ca0fe7dcae5036710bfab4a90c9b48dc306f2d0c441c75ed26c" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5922,6 +5970,8 @@ dependencies = [ [[package]] name = "pallet-encointer-treasuries-rpc-runtime-api" version = "13.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8bcfc738dde3b75aba337d33ffb9cc109ac5c9f3fed24ce32f1f8c0ee39ab0" dependencies = [ "encointer-primitives", "frame-support", diff --git a/Cargo.toml b/Cargo.toml index c4c578cc..c683d3f6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -143,28 +143,28 @@ substrate-api-client = { git = "https://github.com/encointer/substrate-api-clien ## encointer -encointer-balances-tx-payment = { path = "../pallets/balances-tx-payment" } -encointer-balances-tx-payment-rpc = { path = "../pallets/balances-tx-payment/rpc" } -encointer-balances-tx-payment-rpc-runtime-api = { path = "../pallets/balances-tx-payment/rpc/runtime-api" } -encointer-ceremonies-assignment = { path = "../pallets/ceremonies/assignment" } -encointer-primitives = { path = "../pallets/primitives" } -pallet-encointer-balances = { path = "../pallets/balances" } -pallet-encointer-bazaar = { path = "../pallets/bazaar" } -pallet-encointer-bazaar-rpc = { path = "../pallets/bazaar/rpc" } -pallet-encointer-bazaar-rpc-runtime-api = { path = "../pallets/bazaar/rpc/runtime-api" } -pallet-encointer-ceremonies = { path = "../pallets/ceremonies" } -pallet-encointer-ceremonies-rpc = { path = "../pallets/ceremonies/rpc" } -pallet-encointer-ceremonies-rpc-runtime-api = { path = "../pallets/ceremonies/rpc/runtime-api" } -pallet-encointer-communities = { path = "../pallets/communities" } -pallet-encointer-communities-rpc = { path = "../pallets/communities/rpc" } -pallet-encointer-communities-rpc-runtime-api = { path = "../pallets/communities/rpc/runtime-api" } -pallet-encointer-democracy = { path = "../pallets/democracy" } -pallet-encointer-faucet = { path = "../pallets/faucet" } -pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commitments" } -pallet-encointer-scheduler = { path = "../pallets/scheduler" } -pallet-encointer-treasuries = { path = "../pallets/treasuries" } -pallet-encointer-treasuries-rpc = { path = "../pallets/treasuries/rpc" } -pallet-encointer-treasuries-rpc-runtime-api = { path = "../pallets/treasuries/rpc/runtime-api" } +#encointer-balances-tx-payment = { path = "../pallets/balances-tx-payment" } +#encointer-balances-tx-payment-rpc = { path = "../pallets/balances-tx-payment/rpc" } +#encointer-balances-tx-payment-rpc-runtime-api = { path = "../pallets/balances-tx-payment/rpc/runtime-api" } +#encointer-ceremonies-assignment = { path = "../pallets/ceremonies/assignment" } +#encointer-primitives = { path = "../pallets/primitives" } +#pallet-encointer-balances = { path = "../pallets/balances" } +#pallet-encointer-bazaar = { path = "../pallets/bazaar" } +#pallet-encointer-bazaar-rpc = { path = "../pallets/bazaar/rpc" } +#pallet-encointer-bazaar-rpc-runtime-api = { path = "../pallets/bazaar/rpc/runtime-api" } +#pallet-encointer-ceremonies = { path = "../pallets/ceremonies" } +#pallet-encointer-ceremonies-rpc = { path = "../pallets/ceremonies/rpc" } +#pallet-encointer-ceremonies-rpc-runtime-api = { path = "../pallets/ceremonies/rpc/runtime-api" } +#pallet-encointer-communities = { path = "../pallets/communities" } +#pallet-encointer-communities-rpc = { path = "../pallets/communities/rpc" } +#pallet-encointer-communities-rpc-runtime-api = { path = "../pallets/communities/rpc/runtime-api" } +#pallet-encointer-democracy = { path = "../pallets/democracy" } +#pallet-encointer-faucet = { path = "../pallets/faucet" } +#pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commitments" } +#pallet-encointer-scheduler = { path = "../pallets/scheduler" } +#pallet-encointer-treasuries = { path = "../pallets/treasuries" } +#pallet-encointer-treasuries-rpc = { path = "../pallets/treasuries/rpc" } +#pallet-encointer-treasuries-rpc-runtime-api = { path = "../pallets/treasuries/rpc/runtime-api" } # [patch."https://github.com/encointer/substrate-fixed"] # substrate-fixed = { path = "../substrate-fixed" } diff --git a/client/Cargo.toml b/client/Cargo.toml index 10cfcb67..bddfa475 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -3,7 +3,7 @@ name = "encointer-client-notee" authors = ["encointer.org "] edition = "2021" #keep with node version. major, minor and patch -version = "1.14.0" +version = "1.14.1" [dependencies] # todo migrate to clap >=3 https://github.com/encointer/encointer-node/issues/107 diff --git a/client/encointer-api-client-extension/Cargo.toml b/client/encointer-api-client-extension/Cargo.toml index 644fe76f..56083b02 100644 --- a/client/encointer-api-client-extension/Cargo.toml +++ b/client/encointer-api-client-extension/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "encointer-api-client-extension" -version = "0.8.2" +# align with encointer pallet crates versions +version = "13.3.2" edition = "2021" [dependencies] diff --git a/node/Cargo.toml b/node/Cargo.toml index 59f55cbc..26789a93 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -11,7 +11,7 @@ repository = "https://github.com/encointer/encointer-node" # * Align major and minor version with polkadot-sdk major.minor. # * Bump patch version for new releases, and make it the release tag. # * The client should follow this version. -version = "1.14.0" +version = "1.14.1" [[bin]] name = "encointer-node-notee" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 50ceaa6f..c2a96376 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -7,7 +7,7 @@ name = "encointer-node-notee-runtime" repository = "https://github.com/encointer/encointer-node/" # minor revision must match node/client # patch revision must match runtime spec_version -version = "1.14.350" +version = "1.14.360" [dependencies] log = { workspace = true } @@ -210,4 +210,4 @@ metadata-hash = ["substrate-wasm-builder?/metadata-hash"] # A feature that should be enabled when the runtime should be built for on-chain # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller, like logging for example. -on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] \ No newline at end of file +on-chain-release-build = ["metadata-hash", "sp-api/disable-logging"] diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 80bfdbb6..bcfb14be 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -137,7 +137,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("encointer-node-notee"), impl_name: create_runtime_str!("encointer-node-notee"), authoring_version: 0, - spec_version: 350, + spec_version: 360, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 5, From fd9d25e3f47b355dac6761e2587601a093f6a929 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 10 Sep 2024 10:12:05 +0200 Subject: [PATCH 5/5] comment fix --- client/src/commands/encointer_treasuries.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/commands/encointer_treasuries.rs b/client/src/commands/encointer_treasuries.rs index 7eb666a9..96e30e16 100644 --- a/client/src/commands/encointer_treasuries.rs +++ b/client/src/commands/encointer_treasuries.rs @@ -13,7 +13,6 @@ pub fn get_treasury_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), None }; let treasury = api.get_community_treasury_account_unchecked(maybecid).await.unwrap(); - // only print plain businesses to be able to parse them in python scripts println!("{treasury}"); Ok(()) })