From d73d15888ccc91f6005a29db367709257637dc94 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 16:45:19 +0100 Subject: [PATCH 01/41] bump to crates.io --- Cargo.toml | 236 ++++++++++++++++++++++++++--------------------------- 1 file changed, 117 insertions(+), 119 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 52434b2c..4d353b72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,139 +11,137 @@ members = [ panic = 'unwind' [workspace.dependencies] -parity-scale-codec = { version = "3.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } -serde = { features = ["derive"], version = "1.0.136" } -clap = { version = "4.0.9", features = ["derive"] } -futures = { version = "0.3.21", features = ["thread-pool"] } -log = "0.4.14" -serde_json = "1.0.81" +parity-scale-codec = { version = "3.6.5", default-features = false, features = ["derive"] } +scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } +serde = { features = ["derive"], version = "1.0.197" } +clap = { version = "4.5.1", features = ["derive"] } +futures = { version = "0.3.30", features = ["thread-pool"] } +log = "0.4.20" +serde_json = "1.0.114" env_logger = "0.9.0" geojson = "0.22.2" hex = "0.4.3" -tokio = { version = "1.24", features = ["rt-multi-thread", "macros", "time"] } +tokio = { version = "1.33", features = ["rt-multi-thread", "macros", "time"] } # encointer deps -encointer-balances-tx-payment = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-balances-tx-payment-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-ceremonies-assignment = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -encointer-primitives = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-balances = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-bazaar = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-bazaar-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-ceremonies = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-ceremonies-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-communities = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-communities-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-communities-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-democracy = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-faucet = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-reputation-commitments = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } -pallet-encointer-scheduler = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v1.0.0-pallets-v1.3.0" } +encointer-balances-tx-payment = { default-features = false, version = "7.0.0" } +encointer-balances-tx-payment-rpc = { version = "7.0.0" } +encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, version = "7.0.0" } +encointer-ceremonies-assignment = { version = "7.0.0" } +encointer-primitives = { default-features = false, version = "7.0.0" } +pallet-encointer-balances = { default-features = false, version = "7.0.0" } +pallet-encointer-bazaar = { default-features = false, version = "7.0.0" } +pallet-encointer-bazaar-rpc = { version = "7.0.0" } +pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, version = "7.0.0" } +pallet-encointer-ceremonies = { default-features = false, version = "7.0.0" } +pallet-encointer-ceremonies-rpc = { version = "7.0.0" } +pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, version = "7.0.0" } +pallet-encointer-communities = { default-features = false, version = "7.0.0" } +pallet-encointer-communities-rpc = { version = "7.0.0" } +pallet-encointer-communities-rpc-runtime-api = { default-features = false, version = "7.0.0" } +pallet-encointer-democracy = { default-features = false, version = "7.0.0" } +pallet-encointer-faucet = { default-features = false, version = "7.0.0" } +pallet-encointer-reputation-commitments = { default-features = false, version = "7.0.0" } +pallet-encointer-scheduler = { default-features = false, version = "7.0.0" } # substrate deps -frame-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-executive = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system-benchmarking = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-system-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -frame-try-runtime = { git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "polkadot-v1.0.0" } -hex-literal = { version = "0.3.4" } -jsonrpsee = { version = "0.16.2", features = ["server"] } -pallet-asset-tx-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-aura = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-balances = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-grandpa = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-insecure-randomness-collective-flip = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-proxy = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-scheduler = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-sudo = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-timestamp = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-transaction-payment = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-transaction-payment-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-transaction-payment-rpc-runtime-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-treasury = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -pallet-utility = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-basic-authorship = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-cli = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-client-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-consensus-aura = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-consensus-grandpa = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-executor = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-keystore = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-network = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-offchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-rpc = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-rpc-api = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-service = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-transaction-pool = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sc-transaction-pool-api = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-api = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-application-crypto = { version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-block-builder = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-blockchain = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-consensus = { version = "0.10.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-consensus-aura = { version = "0.10.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-consensus-grandpa = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-core = { version = "21.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-inherents = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-io = { version = "23.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-keyring = { version = "24.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-keystore = { version = "0.27.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-offchain = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-rpc = { version = "6.0.0", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-runtime = { version = "24.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-session = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-staking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-std = { version = "8.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-timestamp = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-transaction-pool = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -sp-version = { version = "22.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -substrate-frame-rpc-system = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -try-runtime-cli = { git = 'https://github.com/paritytech/substrate.git', default-features = false, branch = "polkadot-v1.0.0" } +frame-benchmarking = { default-features = false, version = "30.0.0" } +frame-benchmarking-cli = { version = "34.0.0" } +frame-executive = { version = "30.0.0" } +frame-support = { default-features = false, version = "30.0.0" } +frame-system = { default-features = false, version = "30.0.0" } +frame-system-benchmarking = { version = "30.0.0", default-features = false } +frame-system-rpc-runtime-api = { version = "28.0.0", default-features = false } +frame-try-runtime = { version = "0.36.0", default-features = false } +hex-literal = { version = "0.4.1" } +jsonrpsee = { version = "0.22.0", features = ["server"] } +pallet-asset-tx-payment = { default-features = false, version = "30.0.0" } +pallet-aura = { version = "29.0.0", default-features = false } +pallet-balances = { default-features = false, version = "30.0.0" } +pallet-grandpa = { version = "30.0.0", default-features = false } +pallet-insecure-randomness-collective-flip = { version = "18.0.0", default-features = false } +pallet-proxy = { version = "30.0.0", default-features = false } +pallet-scheduler = { version = "31.0.0", default-features = false } +pallet-sudo = { version = "30.0.0", default-features = false } +pallet-timestamp = { default-features = false, version = "29.0.0" } +pallet-transaction-payment = { default-features = false, version = "30.0.0" } +pallet-transaction-payment-rpc = { version = "32.0.0" } +pallet-transaction-payment-rpc-runtime-api = { version = "30.0.0", default-features = false } +pallet-treasury = { default-features = false, version = "29.0.0" } +pallet-utility = { version = "30.0.0", default-features = false } +sc-basic-authorship = { version = "0.36.0" } +sc-cli = { version = "0.38.0" } +sc-client-api = { version = "30.0.0" } +sc-consensus = { version = "0.35.0" } +sc-consensus-aura = { version = "0.36.0" } +sc-consensus-grandpa = { version = "0.13.0" } +sc-executor = { version = "0.34.0" } +sc-keystore = { version = "27.0.0" } +sc-network = { version = "0.36.0" } +sc-offchain = { version = "31.0.0" } +sc-rpc = "31.0.0" +sc-rpc-api = "0.35.0" +sc-service = { version = "0.37.0" } +sc-telemetry = { version = "17.0.0" } +sc-transaction-pool = { version = "30.0.0" } +sc-transaction-pool-api = { version = "30.0.0" } +sp-api = { default-features = false, version = "28.0.0" } +sp-application-crypto = { default-features = false, version = "32.0.0" } +sp-arithmetic = { default-features = false, version = "25.0.0" } +sp-block-builder = { version = "28.0.0", default-features = false } +sp-blockchain = "30.0.0" +sp-consensus = { version = "0.34.0" } +sp-consensus-aura = { version = "0.34.0", default-features = false } +sp-consensus-grandpa = { version = "15.0.0" } +sp-core = { default-features = false, version = "30.0.0" } +sp-inherents = "28.0.0" +sp-io = { default-features = false, version = "32.0.0" } +sp-keyring = "33.0.0" +sp-keystore = "0.36.0" +sp-offchain = { version = "28.0.0", default-features = false } +sp-rpc = "28.0.0" +sp-runtime = { default-features = false, version = "33.0.0" } +sp-session = { version = "29.0.0", default-features = false } +sp-staking = { version = "28.0.0", default-features = false } +sp-std = { default-features = false, version = "14.0.0" } +sp-timestamp = { version = "28.0.0" } +sp-transaction-pool = { version = "28.0.0", default-features = false } +sp-version = { version = "31.0.0", default-features = false } +substrate-frame-rpc-system = { version = "30.0.0" } +try-runtime-cli = { version = "0.39.0", default-features = false } +substrate-wasm-builder = "19.0.0" +substrate-build-script-utils = "11.0.0" -substrate-wasm-builder = { version = "5.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" } -substrate-build-script-utils = "3.0.0" - -substrate-api-client = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v1.0.0-tag-v0.12.0", features = ["ws-client"] } -substrate-client-keystore = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v1.0.0-tag-v0.12.0" } +substrate-api-client = { version = "0.17.0", features = ["ws-client"] } +substrate-client-keystore = "0.10.0" #only while debugging -#[patch."https://github.com/encointer/pallets"] -# encointer-balances-tx-payment = { path = "../encointer-pallets/balances-tx-payment" } -# encointer-balances-tx-payment-rpc = { path = "../encointer-pallets/balances-tx-payment/rpc" } -# encointer-balances-tx-payment-rpc-runtime-api = { path = "../encointer-pallets/balances-tx-payment/rpc/runtime-api" } -# encointer-ceremonies-assignment = { path = "../encointer-pallets/ceremonies/assignment" } -# encointer-primitives = { path = "../encointer-pallets/primitives" } -# pallet-encointer-balances = { path = "../encointer-pallets/balances" } -# pallet-encointer-bazaar = { path = "../encointer-pallets/bazaar" } -# pallet-encointer-bazaar-rpc = { path = "../encointer-pallets/bazaar/rpc" } -# pallet-encointer-bazaar-rpc-runtime-api = { path = "../encointer-pallets/bazaar/rpc/runtime-api" } -# pallet-encointer-ceremonies = { path = "../encointer-pallets/ceremonies" } -# pallet-encointer-ceremonies-rpc = { path = "../encointer-pallets/ceremonies/rpc" } -# pallet-encointer-ceremonies-rpc-runtime-api = { path = "../encointer-pallets/ceremonies/rpc/runtime-api" } -# pallet-encointer-communities = { path = "../encointer-pallets/communities" } -# pallet-encointer-communities-rpc = { path = "../encointer-pallets/communities/rpc" } -# pallet-encointer-communities-rpc-runtime-api = { path = "../encointer-pallets/communities/rpc/runtime-api" } -# pallet-encointer-democracy = { path = "../encointer-pallets/democracy" } -# pallet-encointer-faucet = { path = "../encointer-pallets/faucet" } -# pallet-encointer-reputation-commitments = { path = "../encointer-pallets/reputation-commitments" } -# pallet-encointer-scheduler = { path = "../encointer-pallets/scheduler" } - -# [patch."https://github.com/scs/substrate-api-client"] -# substrate-api-client = { path = "../substrate-api-client" } -# substrate-client-keystore = { path = "../substrate-api-client/client-keystore" } +[patch.crates-io] +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" } +substrate-api-client = { path = "../../substrate-api-client" } +substrate-client-keystore = { path = "../../substrate-api-client/client-keystore" } # [patch."https://github.com/encointer/substrate-fixed"] # substrate-fixed = { path = "../substrate-fixed" } From bea1abc9a459cb4214582ec869940d4035f390e8 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 17:32:37 +0100 Subject: [PATCH 02/41] fixes --- Cargo.lock | 3708 +++++++++++++++++++++++-------------------- Cargo.toml | 6 +- node/Cargo.toml | 8 +- runtime/Cargo.toml | 2 - rust-toolchain.toml | 4 +- 5 files changed, 1974 insertions(+), 1754 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8686db4f..cff00d14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,8 +14,9 @@ dependencies = [ [[package]] name = "ac-compose-macros" -version = "0.4.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd62974353f0e96a110d08b59b670bf6b3af6095da1d1d410687c456546d302" dependencies = [ "ac-primitives", "log", @@ -24,33 +25,37 @@ dependencies = [ [[package]] name = "ac-node-api" -version = "0.4.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.6.0" dependencies = [ "ac-primitives", "bitvec", "derive_more", "either", - "frame-metadata 15.1.0", + "frame-metadata 16.0.0", "hex", "log", "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", "scale-info", + "scale-value", "serde", "serde_json", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-runtime", "sp-runtime-interface", + "sp-storage", ] [[package]] name = "ac-primitives" -version = "0.7.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.9.1" dependencies = [ "frame-system", - "impl-serde 0.4.0", + "impl-serde", "pallet-assets", "pallet-balances", "parity-scale-codec", @@ -60,7 +65,7 @@ dependencies = [ "serde_json", "sp-application-crypto", "sp-core", - "sp-core-hashing", + "sp-crypto-hashing", "sp-runtime", "sp-runtime-interface", "sp-staking", @@ -92,15 +97,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "aead" version = "0.4.3" @@ -108,7 +104,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ "generic-array 0.14.7", - "rand_core 0.6.4", ] [[package]] @@ -121,17 +116,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "aes" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" -dependencies = [ - "aes-soft", - "aesni", - "cipher 0.2.5", -] - [[package]] name = "aes" version = "0.7.5" @@ -157,16 +141,16 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.9.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" dependencies = [ "aead 0.4.3", "aes 0.7.5", "cipher 0.3.0", - "ctr 0.8.0", + "ctr 0.7.0", "ghash 0.4.4", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -180,27 +164,7 @@ dependencies = [ "cipher 0.4.4", "ctr 0.9.2", "ghash 0.5.0", - "subtle", -] - -[[package]] -name = "aes-soft" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aesni" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" -dependencies = [ - "cipher 0.2.5", - "opaque-debug 0.3.0", + "subtle 2.5.0", ] [[package]] @@ -216,14 +180,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ "cfg-if 1.0.0", "getrandom 0.2.10", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -235,6 +200,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -261,9 +232,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -299,12 +270,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -323,10 +294,147 @@ dependencies = [ ] [[package]] -name = "arc-swap" -version = "1.6.0" +name = "aquamarine" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" +dependencies = [ + "include_dir", + "itertools", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "ark-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb00293ba84f51ce3bd026bd0de55899c4e68f0a39a5728cebae3a73ffdc0a4f" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest 0.10.7", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] [[package]] name = "array-bytes" @@ -336,9 +444,9 @@ checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" [[package]] name = "array-bytes" -version = "6.1.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b1c5a481ec30a5abd8dfbd94ab5cf1bb4e9a66be7f1b3b322f2f1170c200fd" +checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" [[package]] name = "arrayref" @@ -358,29 +466,13 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "asn1-rs" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ff05a702273012438132f449575dbc804e27b2f3cbe3069aa237d26c98fa33" -dependencies = [ - "asn1-rs-derive 0.1.0", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "asn1-rs" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" dependencies = [ - "asn1-rs-derive 0.4.0", + "asn1-rs-derive", "asn1-rs-impl", "displaydoc", "nom", @@ -390,18 +482,6 @@ dependencies = [ "time", ] -[[package]] -name = "asn1-rs-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8b7511298d5b7784b40b092d9e9dcd3a627a5707e4b5e507931ab0d44eeebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - [[package]] name = "asn1-rs-derive" version = "0.4.0" @@ -432,7 +512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] @@ -442,7 +522,7 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if 1.0.0", "concurrent-queue", @@ -462,29 +542,29 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", ] [[package]] -name = "async-recursion" -version = "1.0.5" +name = "async-lock" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.37", + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite 0.2.13", ] [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -500,12 +580,6 @@ dependencies = [ "pin-project-lite 0.2.13", ] -[[package]] -name = "atomic-waker" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" - [[package]] name = "atty" version = "0.2.14" @@ -544,12 +618,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -610,9 +678,28 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.37", + "syn 2.0.52", +] + +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", ] +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" @@ -637,6 +724,18 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +dependencies = [ + "byte-tools", + "crypto-mac 0.7.0", + "digest 0.8.1", + "opaque-debug 0.2.3", +] + [[package]] name = "blake2" version = "0.10.6" @@ -687,7 +786,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder", "generic-array 0.12.4", @@ -711,16 +810,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "block-modes" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a0e8073e8baa88212fb5823574c02ebccb395136ba9a164ab89379ec6072f0" -dependencies = [ - "block-padding 0.2.1", - "cipher 0.2.5", -] - [[package]] name = "block-padding" version = "0.1.5" @@ -730,17 +819,11 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "bounded-collections" -version = "0.1.8" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b05133427c07c4776906f673ccf36c21b102c9829c641a5b56bd151d44fd6" +checksum = "d32385ecb91a31bddaf908e8dcf4a15aef1bcd3913cc03ebfad02ff6d568abc1" dependencies = [ "log", "parity-scale-codec", @@ -754,6 +837,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "tinyvec", +] + [[package]] name = "bstr" version = "1.6.2" @@ -830,6 +922,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" +dependencies = [ + "cipher 0.2.5", + "ppv-lite86", +] + [[package]] name = "camino" version = "1.1.6" @@ -872,17 +974,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ccm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca1a8fbc20b50ac9673ff014abfb2b5f4085ee1a850d408f14a159c5853ac7" -dependencies = [ - "aead 0.3.2", - "cipher 0.2.5", - "subtle", -] - [[package]] name = "cexpr" version = "0.6.0" @@ -919,6 +1010,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf3c081b5fba1e5615640aae998e0fbd10c24cbd897ee39ed754a77601a4862" +dependencies = [ + "byteorder", + "keystream", +] + [[package]] name = "chacha20" version = "0.8.2" @@ -1027,9 +1128,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.3" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -1046,33 +1147,34 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.10.0", + "strsim 0.11.0", + "terminal_size", ] [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "codespan-reporting" @@ -1092,15 +1194,21 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "comfy-table" -version = "7.0.1" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab77dbd8adecaf3f0db40581631b995f312a8a5ae3aa9993188bb8f23d83a5b" +checksum = "7c64043d6c7b7a4c58e39e7efccfdea7b93d885a795d0c054a69dbbf4dd52686" dependencies = [ - "strum", - "strum_macros", + "strum 0.25.0", + "strum_macros 0.25.3", "unicode-width", ] +[[package]] +name = "common-path" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" + [[package]] name = "concurrent-queue" version = "2.2.0" @@ -1112,15 +1220,15 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -1157,6 +1265,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "constcat" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" + [[package]] name = "convert_case" version = "0.4.0" @@ -1230,7 +1344,7 @@ dependencies = [ "gimli 0.27.3", "hashbrown 0.13.2", "log", - "regalloc2", + "regalloc2 0.6.1", "smallvec", "target-lexicon", ] @@ -1310,16 +1424,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23" dependencies = [ - "crc-catalog 1.1.1", -] - -[[package]] -name = "crc" -version = "3.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" -dependencies = [ - "crc-catalog 2.2.0", + "crc-catalog", ] [[package]] @@ -1328,12 +1433,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" -[[package]] -name = "crc-catalog" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" - [[package]] name = "crc32fast" version = "1.3.2" @@ -1392,18 +1491,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array 0.14.7", - "rand_core 0.6.4", - "subtle", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.3" @@ -1412,7 +1499,7 @@ checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -1424,7 +1511,17 @@ checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "typenum 1.17.0", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +dependencies = [ + "generic-array 0.12.4", + "subtle 1.0.0", ] [[package]] @@ -1434,24 +1531,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle", + "subtle 2.5.0", ] [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", - "subtle", + "subtle 2.5.0", ] [[package]] name = "ctr" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" dependencies = [ "cipher 0.3.0", ] @@ -1474,7 +1571,7 @@ dependencies = [ "byteorder", "digest 0.8.1", "rand_core 0.5.1", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -1487,24 +1584,24 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle", + "subtle 2.5.0", "zeroize", ] [[package]] name = "curve25519-dalek" -version = "4.1.0" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622178105f911d937a42cdb140730ba4a3ed2becd8ae6ce39c7d28b5d75d4588" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if 1.0.0", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms 3.1.2", + "platforms", "rustc_version 0.4.0", - "subtle", + "subtle 2.5.0", "zeroize", ] @@ -1516,7 +1613,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -1543,7 +1640,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -1560,7 +1657,7 @@ checksum = "2fa16a70dd58129e4dfffdff535fb1bce66673f7bbeec4a5a1765a504e1ccd84" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -1598,6 +1695,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown 0.14.3", + "lock_api", + "once_cell", + "parking_lot_core 0.9.8", +] + [[package]] name = "data-encoding" version = "2.4.0" @@ -1625,38 +1735,13 @@ dependencies = [ ] [[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "der" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "der-parser" -version = "7.0.0" +name = "der" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe398ac75057914d7d07307bf67dc7f3f574a26783b4fc7805a20ffa9f506e82" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "asn1-rs 0.3.1", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", + "const-oid", + "zeroize", ] [[package]] @@ -1665,7 +1750,7 @@ version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "displaydoc", "nom", "num-bigint", @@ -1680,10 +1765,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] -name = "derive-syn-parse" -version = "0.1.5" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", @@ -1691,36 +1776,16 @@ dependencies = [ ] [[package]] -name = "derive_builder" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07adf7be193b71cc36b193d0f5fe60b918a3a9db4dad0449f57bcfd519704a3" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.11.2" +name = "derive-syn-parse" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f91d4cfa921f1c05904dc3c57b4a32c38aed3340cce209f3a6fd1478babafc4" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" dependencies = [ - "darling", "proc-macro2", "quote", "syn 1.0.109", ] -[[package]] -name = "derive_builder_macro" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0314b72bed045f3a68671b3c86328386762c93f82d98c65c3cb5e5f573dd68" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.17" @@ -1767,14 +1832,14 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle", + "subtle 2.5.0", ] [[package]] name = "directories" -version = "4.0.1" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" dependencies = [ "dirs-sys", ] @@ -1791,13 +1856,14 @@ dependencies = [ [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] @@ -1819,7 +1885,34 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", +] + +[[package]] +name = "docify" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc4fd38aaa9fb98ac70794c82a00360d1e165a87fbf96a8a91f9dfc602aaee2" +dependencies = [ + "docify_macros", +] + +[[package]] +name = "docify_macros" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63fa215f3a0d40fb2a221b3aa90d8e1fbb8379785a990cb60d62ac71ebdc6460" +dependencies = [ + "common-path", + "derive-syn-parse", + "once_cell", + "proc-macro2", + "quote", + "regex", + "syn 2.0.52", + "termcolor", + "toml 0.8.10", + "walkdir", ] [[package]] @@ -1861,39 +1954,18 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.7.8", + "der", "digest 0.10.7", - "elliptic-curve 0.13.5", - "rfc6979 0.4.0", - "signature 2.1.0", - "spki 0.7.2", -] - -[[package]] -name = "ed25519" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature 1.6.4", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] @@ -1902,33 +1974,22 @@ version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "pkcs8 0.10.2", - "signature 2.1.0", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek 3.2.0", - "ed25519 1.5.3", - "sha2 0.9.9", - "zeroize", + "pkcs8", + "signature", ] [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.0", - "ed25519 2.2.2", + "curve25519-dalek 4.1.2", + "ed25519", "rand_core 0.6.4", "serde", "sha2 0.10.7", + "subtle 2.5.0", "zeroize", ] @@ -1952,44 +2013,22 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array 0.14.7", - "group 0.12.1", - "hkdf", - "pem-rfc7468", - "pkcs8 0.9.0", - "rand_core 0.6.4", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.3", + "base16ct", + "crypto-bigint", "digest 0.10.7", - "ff 0.13.0", + "ff", "generic-array 0.14.7", - "group 0.13.0", - "pkcs8 0.10.2", + "group", + "pkcs8", "rand_core 0.6.4", - "sec1 0.7.3", - "subtle", + "sec1", + "subtle 2.5.0", "zeroize", ] @@ -2018,8 +2057,7 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-support", @@ -2034,13 +2072,12 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", "encointer-rpc", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -2058,8 +2095,7 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc-runtime-api" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-support", @@ -2071,8 +2107,7 @@ dependencies = [ [[package]] name = "encointer-ceremonies-assignment" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "sp-runtime", @@ -2115,8 +2150,7 @@ dependencies = [ [[package]] name = "encointer-meetup-validation" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -2130,7 +2164,7 @@ dependencies = [ name = "encointer-node-notee" version = "1.5.4" dependencies = [ - "clap 4.4.3", + "clap 4.5.1", "encointer-balances-tx-payment-rpc", "encointer-balances-tx-payment-rpc-runtime-api", "encointer-node-notee-runtime", @@ -2139,7 +2173,7 @@ dependencies = [ "frame-system", "frame-try-runtime", "futures", - "jsonrpsee", + "jsonrpsee 0.16.3", "log", "pallet-asset-tx-payment", "pallet-encointer-bazaar-rpc", @@ -2180,7 +2214,6 @@ dependencies = [ "sp-timestamp", "substrate-build-script-utils", "substrate-frame-rpc-system", - "try-runtime-cli", ] [[package]] @@ -2238,19 +2271,16 @@ dependencies = [ "sp-transaction-pool", "sp-version", "substrate-wasm-builder", - "try-runtime-cli", ] [[package]] name = "encointer-primitives" -version = "1.3.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ - "bs58", - "crc 2.1.0", + "bs58 0.5.0", + "crc", "ep-core", "frame-support", - "geohash", "log", "parity-scale-codec", "scale-info", @@ -2259,14 +2289,16 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "substrate-geohash", ] [[package]] name = "encointer-rpc" -version = "0.1.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.22.1", + "jsonrpsee-core 0.22.1", + "jsonrpsee-types 0.22.1", "thiserror", ] @@ -2316,11 +2348,10 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "ep-core" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ - "array-bytes 6.1.0", - "impl-serde 0.3.2", + "array-bytes 6.2.2", + "impl-serde", "parity-scale-codec", "scale-info", "serde", @@ -2364,6 +2395,27 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite 0.2.13", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite 0.2.13", +] + [[package]] name = "exit-future" version = "0.2.0" @@ -2379,11 +2431,11 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f86a749cf851891866c10515ef6c299b5c69661465e9c3bbe7e07a2b77fb0f7" dependencies = [ - "blake2", + "blake2 0.10.6", "fs-err", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -2398,6 +2450,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "1.9.0" @@ -2415,21 +2473,12 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "fdlimit" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4c9e43643f5a3be4ca5b67d26b98031ff9db6806c3440ae32e02e3ceac3f1b" +checksum = "e182f7dbc2ef73d9ef67351c5fbbea084729c48362d3ce9dd44c28e32e277fe5" dependencies = [ "libc", -] - -[[package]] -name = "ff" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" -dependencies = [ - "rand_core 0.6.4", - "subtle", + "thiserror", ] [[package]] @@ -2439,7 +2488,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -2547,8 +2596,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e93d3f0315c2eccf23453609e0ab92fe7c6ad1ca8129bcaf80b9a08c8d7fc52b" dependencies = [ "parity-scale-codec", ] @@ -2570,8 +2620,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34134abd64876c2cba150b703d8c74b1b222147e61dbc33cbb9db72f7c1cdb2f" dependencies = [ "frame-support", "frame-support-procedural", @@ -2595,13 +2646,14 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e618a6cbce60ed9a94850b2cb7d08a08e391ee0f287ee20082430da2d385916b" dependencies = [ "Inflector", - "array-bytes 6.1.0", + "array-bytes 6.2.2", "chrono", - "clap 4.4.3", + "clap 4.5.1", "comfy-table", "frame-benchmarking", "frame-support", @@ -2643,12 +2695,14 @@ dependencies = [ [[package]] name = "frame-executive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4542ef9abae48cb665f9992ece20ecded914ecfdaafb3f76968c645358b8df" dependencies = [ "frame-support", "frame-system", "frame-try-runtime", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -2667,7 +2721,6 @@ dependencies = [ "cfg-if 1.0.0", "parity-scale-codec", "scale-info", - "serde", ] [[package]] @@ -2682,33 +2735,16 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-remote-externalities" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" -dependencies = [ - "async-recursion", - "futures", - "indicatif", - "jsonrpsee", - "log", - "parity-scale-codec", - "serde", - "sp-core", - "sp-io", - "sp-runtime", - "spinners", - "substrate-rpc-client", - "tokio", - "tokio-retry", -] - [[package]] name = "frame-support" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40bde5b74ac70a1c9fe4f846220ea10e78b81b0ffcdb567d16d28472bc332f95" dependencies = [ + "aquamarine", + "array-bytes 6.2.2", "bitflags 1.3.2", + "docify", "environmental", "frame-metadata 16.0.0", "frame-support-procedural", @@ -2720,27 +2756,32 @@ dependencies = [ "paste", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", "sp-arithmetic", "sp-core", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-debug-derive", + "sp-genesis-builder", "sp-inherents", "sp-io", + "sp-metadata-ir", "sp-runtime", "sp-staking", "sp-state-machine", "sp-std", "sp-tracing", "sp-weights", + "static_assertions", "tt-call", ] [[package]] name = "frame-support-procedural" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bf871c6655636a40a74d06f7f1bf69813f8037ad269704ae35b1c56c42ec" dependencies = [ "Inflector", "cfg-expr", @@ -2752,37 +2793,42 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.37", + "sp-crypto-hashing", + "syn 2.0.52", ] [[package]] name = "frame-support-procedural-tools" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c302f711acf3196b4bf2b4629a07a2ac6e44cd1782434ec88b85d59adfb1204d" dependencies = [ "cfg-if 1.0.0", + "docify", "frame-support", "log", "parity-scale-codec", @@ -2798,8 +2844,9 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e41213421daaf14370e6d59016bd1be5e8d8c990bb336b72e72b3c60d874d3df" dependencies = [ "frame-benchmarking", "frame-support", @@ -2813,8 +2860,9 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b48b28339a07bb7e797d3546c29600dd0b7c97ffd9d6642665dc96d81c0b475" dependencies = [ "parity-scale-codec", "sp-api", @@ -2822,8 +2870,9 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be404b49a2c947a77ec813b372ca5119182f8de131ee98a5656bc1043958b8b" dependencies = [ "frame-support", "parity-scale-codec", @@ -2872,9 +2921,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -2887,9 +2936,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -2897,15 +2946,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -2915,9 +2964,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -2936,13 +2985,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -2953,20 +3002,20 @@ checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", "rustls 0.20.9", - "webpki 0.22.1", + "webpki", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -2976,9 +3025,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -3007,7 +3056,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" dependencies = [ - "typenum 1.17.0", + "typenum", ] [[package]] @@ -3016,21 +3065,11 @@ version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "typenum 1.17.0", + "typenum", "version_check", "zeroize", ] -[[package]] -name = "geohash" -version = "0.13.0" -source = "git+https://github.com/encointer/geohash?tag=polkadot-v1.0.0#c5a8e70ea8b5db68571e51838b54612b556a4c7e" -dependencies = [ - "parity-scale-codec", - "scale-info", - "substrate-fixed", -] - [[package]] name = "geojson" version = "0.22.4" @@ -3075,6 +3114,16 @@ dependencies = [ "wasi 0.11.0+wasi-snapshot-preview1", ] +[[package]] +name = "getrandom_or_panic" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" +dependencies = [ + "rand 0.8.5", + "rand_core 0.6.4", +] + [[package]] name = "ghash" version = "0.4.4" @@ -3101,7 +3150,7 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.2.0", "indexmap 1.9.3", "stable_deref_trait", ] @@ -3111,6 +3160,10 @@ name = "gimli" version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +dependencies = [ + "fallible-iterator 0.3.0", + "stable_deref_trait", +] [[package]] name = "glob" @@ -3132,14 +3185,23 @@ dependencies = [ ] [[package]] -name = "group" -version = "0.12.1" +name = "governor" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" dependencies = [ - "ff 0.12.1", - "rand_core 0.6.4", - "subtle", + "cfg-if 1.0.0", + "dashmap", + "futures", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot 0.12.1", + "portable-atomic", + "quanta", + "rand 0.8.5", + "smallvec", + "spinning_top", ] [[package]] @@ -3148,9 +3210,9 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", + "ff", "rand_core 0.6.4", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -3216,14 +3278,27 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.10", ] [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.10", + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.3", +] [[package]] name = "heck" @@ -3254,9 +3329,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-literal" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" @@ -3283,7 +3358,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -3408,10 +3483,9 @@ dependencies = [ "hyper", "log", "rustls 0.21.7", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", - "webpki-roots 0.23.1", + "tokio-rustls 0.24.1", ] [[package]] @@ -3502,15 +3576,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-serde" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" -dependencies = [ - "serde", -] - [[package]] name = "impl-serde" version = "0.4.0" @@ -3531,6 +3596,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "include_dir" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +dependencies = [ + "include_dir_macros", +] + +[[package]] +name = "include_dir_macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -3549,20 +3633,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "indicatif" -version = "0.17.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b297dc40733f23a0e52728a58fa9489a5b7638a324932de16b41adc3ef80730" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", + "hashbrown 0.14.3", ] [[package]] @@ -3589,26 +3660,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" dependencies = [ - "num-traits", -] - -[[package]] -name = "interceptor" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8a11ae2da61704edada656798b61c94b35ecac2c58eb955156987d5e6be90b" -dependencies = [ - "async-trait", - "bytes 1.5.0", - "log", - "rand 0.8.5", - "rtcp", - "rtp", - "thiserror", - "tokio", - "waitgroup", - "webrtc-srtp", - "webrtc-util", + "num-traits", ] [[package]] @@ -3643,7 +3695,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.4", + "socket2 0.5.6", "widestring", "windows-sys 0.48.0", "winreg", @@ -3704,36 +3756,46 @@ name = "jsonrpsee" version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" +dependencies = [ + "jsonrpsee-core 0.16.3", + "jsonrpsee-server 0.16.3", + "jsonrpsee-types 0.16.3", +] + +[[package]] +name = "jsonrpsee" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16fcc9dd231e72d22993f1643d5f7f0db785737dbe3c3d7ca222916ab4280795" dependencies = [ "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-http-client", + "jsonrpsee-core 0.22.1", "jsonrpsee-proc-macros", - "jsonrpsee-server", - "jsonrpsee-types", - "jsonrpsee-ws-client", + "jsonrpsee-server 0.22.1", + "jsonrpsee-types 0.22.1", + "tokio", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.16.3" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" +checksum = "0476c96eb741b40d39dcb39d0124e3b9be9840ec77653c42a0996563ae2a53f7" dependencies = [ "futures-util", "http", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.22.1", "pin-project", - "rustls-native-certs", + "rustls-native-certs 0.7.0", + "rustls-pki-types", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-util", "tracing", - "webpki-roots 0.25.2", + "url", ] [[package]] @@ -3744,15 +3806,13 @@ checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" dependencies = [ "anyhow", "arrayvec 0.7.4", - "async-lock", "async-trait", "beef", "futures-channel", - "futures-timer", "futures-util", "globset", "hyper", - "jsonrpsee-types", + "jsonrpsee-types 0.16.3", "parking_lot 0.12.1", "rand 0.8.5", "rustc-hash", @@ -3765,32 +3825,39 @@ dependencies = [ ] [[package]] -name = "jsonrpsee-http-client" -version = "0.16.3" +name = "jsonrpsee-core" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" +checksum = "b974d8f6139efbe8425f32cb33302aba6d5e049556b5bfc067874e7a0da54a2e" dependencies = [ + "anyhow", + "async-lock 3.3.0", "async-trait", + "beef", + "futures-timer", + "futures-util", "hyper", - "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-types 0.22.1", + "parking_lot 0.12.1", + "pin-project", + "rand 0.8.5", "rustc-hash", "serde", "serde_json", "thiserror", "tokio", + "tokio-stream", "tracing", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.3" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +checksum = "68e79a7109506831bf0cbeaad08729cdf0e592300c00f626bccd6d479974221e" dependencies = [ "heck", - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3806,11 +3873,35 @@ dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core", - "jsonrpsee-types", + "jsonrpsee-core 0.16.3", + "jsonrpsee-types 0.16.3", + "serde", + "serde_json", + "soketto", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tracing", +] + +[[package]] +name = "jsonrpsee-server" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "344440ccd8492c1ca65f1391c5aa03f91189db38d602d189b9266a1a5c6a4d22" +dependencies = [ + "futures-util", + "http", + "hyper", + "jsonrpsee-core 0.22.1", + "jsonrpsee-types 0.22.1", + "pin-project", + "route-recognizer", "serde", "serde_json", "soketto", + "thiserror", "tokio", "tokio-stream", "tokio-util", @@ -3833,15 +3924,16 @@ dependencies = [ ] [[package]] -name = "jsonrpsee-ws-client" -version = "0.16.3" +name = "jsonrpsee-types" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +checksum = "b13dac43c1a9fc2648b37f306b0a5b0e29b2a6e1c36a33b95c1948da2494e9c5" dependencies = [ - "http", - "jsonrpsee-client-transport", - "jsonrpsee-core", - "jsonrpsee-types", + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", ] [[package]] @@ -3851,8 +3943,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", - "ecdsa 0.16.8", - "elliptic-curve 0.13.5", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.7", ] @@ -3876,6 +3968,12 @@ dependencies = [ "winapi-build", ] +[[package]] +name = "keystream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" + [[package]] name = "kvdb" version = "0.13.0" @@ -3923,9 +4021,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -3937,11 +4035,17 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "libp2p" -version = "0.51.3" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f210d259724eae82005b5c48078619b7745edb7b76de370b03f8ba59ea103097" +checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ "bytes 1.5.0", "futures", @@ -3964,7 +4068,6 @@ dependencies = [ "libp2p-swarm", "libp2p-tcp", "libp2p-wasm-ext", - "libp2p-webrtc", "libp2p-websocket", "libp2p-yamux", "multiaddr", @@ -4065,8 +4168,8 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ - "bs58", - "ed25519-dalek 2.0.0", + "bs58 0.4.0", + "ed25519-dalek", "log", "multiaddr", "multihash", @@ -4276,12 +4379,12 @@ dependencies = [ "futures-rustls", "libp2p-core", "libp2p-identity", - "rcgen 0.10.0", - "ring", + "rcgen", + "ring 0.16.20", "rustls 0.20.9", "thiserror", - "webpki 0.22.1", - "x509-parser 0.14.0", + "webpki", + "x509-parser", "yasna", ] @@ -4299,37 +4402,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "libp2p-webrtc" -version = "0.4.0-alpha.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48592edbc2f60b4bc7c10d65445b0c3964c07df26fdf493b6880d33be36f8" -dependencies = [ - "async-trait", - "asynchronous-codec", - "bytes 1.5.0", - "futures", - "futures-timer", - "hex", - "if-watch", - "libp2p-core", - "libp2p-identity", - "libp2p-noise", - "log", - "multihash", - "quick-protobuf", - "quick-protobuf-codec", - "rand 0.8.5", - "rcgen 0.9.3", - "serde", - "stun", - "thiserror", - "tinytemplate", - "tokio", - "tokio-util", - "webrtc", -] - [[package]] name = "libp2p-websocket" version = "0.41.0" @@ -4346,7 +4418,7 @@ dependencies = [ "rw-stream-sink", "soketto", "url", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -4393,7 +4465,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.9.9", - "typenum 1.17.0", + "typenum", ] [[package]] @@ -4404,7 +4476,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -4487,6 +4559,18 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +[[package]] +name = "lioness" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae926706ba42c425c9457121178330d75e273df2e82e28b758faf3de3a9acb9" +dependencies = [ + "arrayref", + "blake2 0.8.1", + "chacha", + "keystream", +] + [[package]] name = "lock_api" version = "0.4.10" @@ -4552,58 +4636,52 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aee866bfee30d2d7e83835a4574aad5b45adba4cc807f2a3bbba974e5d4383c9" +checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "macro_magic_core" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e766a20fd9c72bab3e1e64ed63f36bd08410e75803813df210d1ce297d7ad00" +checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" dependencies = [ "const-random", "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "macro_magic_core_macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c12469fc165526520dff2807c2975310ab47cf7190a45b99b49a7dc8befab17b" +checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "macro_magic_macros" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" +checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.37", + "syn 2.0.52", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -4646,15 +4724,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.6.3" @@ -4680,12 +4749,12 @@ dependencies = [ ] [[package]] -name = "memoffset" -version = "0.6.5" +name = "memmap2" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ - "autocfg", + "libc", ] [[package]] @@ -4727,6 +4796,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "merlin" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.6.4", + "zeroize", +] + [[package]] name = "minimal-lexical" version = "0.2.1" @@ -4763,9 +4844,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -4796,6 +4877,31 @@ dependencies = [ "ws2_32-sys", ] +[[package]] +name = "mixnet" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daa3eb39495d8e2e2947a1d862852c90cc6a4a8845f8b41c8829cb9fcc047f4a" +dependencies = [ + "arrayref", + "arrayvec 0.7.4", + "bitflags 1.3.2", + "blake2 0.10.6", + "c2-chacha", + "curve25519-dalek 4.1.2", + "either", + "hashlink", + "lioness", + "log", + "parking_lot 0.12.1", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_distr", + "subtle 2.5.0", + "thiserror", + "zeroize", +] + [[package]] name = "mockall" version = "0.11.4" @@ -4876,7 +4982,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro-error", "proc-macro2", "quote", @@ -4917,7 +5023,7 @@ dependencies = [ "num-rational", "num-traits", "simba", - "typenum 1.17.0", + "typenum", ] [[package]] @@ -4933,9 +5039,9 @@ dependencies = [ [[package]] name = "names" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d66043b25d4a6cccb23619d10c19c25304b355a7dccd4a8e11423dd2382146" +checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ "rand 0.8.5", ] @@ -5026,9 +5132,14 @@ dependencies = [ "bitflags 1.3.2", "cfg-if 1.0.0", "libc", - "memoffset 0.6.5", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -5045,6 +5156,12 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + [[package]] name = "normalize-line-endings" version = "0.3.0" @@ -5104,11 +5221,12 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -5121,12 +5239,6 @@ dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "object" version = "0.30.4" @@ -5148,29 +5260,20 @@ dependencies = [ "memchr", ] -[[package]] -name = "oid-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e20717fa0541f39bd146692035c37bedfa532b3e5071b35761082407546b2a" -dependencies = [ - "asn1-rs 0.3.1", -] - [[package]] name = "oid-registry" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -5207,7 +5310,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -5229,31 +5332,16 @@ dependencies = [ ] [[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] - -[[package]] -name = "p384" -version = "0.11.2" +name = "option-ext" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc8c5bf642dde52bb9e87c0ecd8ca5a76faac2eeed98dedb7c717997e1080aa" -dependencies = [ - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", -] +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "pallet-asset-tx-payment" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6530bad86d493df89539037e6dca0114d979f8e6c3c9f0c704ff6ee2dc6df676" dependencies = [ "frame-benchmarking", "frame-support", @@ -5270,12 +5358,14 @@ dependencies = [ [[package]] name = "pallet-assets" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c54b67fb2fab83382f7cd860aa5e0e0d478c914f81b87a7c24df2d93f740a89" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -5285,11 +5375,13 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b1085f847e49c5a56d4a7f87815f4ac6d37cd7e3997e2444abc105e2207aeca" dependencies = [ "frame-support", "frame-system", + "log", "pallet-timestamp", "parity-scale-codec", "scale-info", @@ -5301,8 +5393,9 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa1f02863403c1cf5e9f49fd492c8cdb329d4b45029f3f19f278b3ba832a2b81" dependencies = [ "frame-support", "frame-system", @@ -5315,9 +5408,11 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f68b79a1f9f10c63377177155a4ac3ac08db356027a3d8bc826e1af65c885b8d" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5330,8 +5425,7 @@ dependencies = [ [[package]] name = "pallet-encointer-balances" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "approx", "encointer-primitives", @@ -5349,8 +5443,7 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar" -version = "1.1.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5366,14 +5459,14 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "pallet-encointer-bazaar-rpc-runtime-api", + "parity-scale-codec", "parking_lot 0.12.1", "sc-rpc", "sc-rpc-api", @@ -5385,19 +5478,18 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc-runtime-api" -version = "1.0.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-support", + "parity-scale-codec", "sp-api", "sp-std", ] [[package]] name = "pallet-encointer-ceremonies" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-ceremonies-assignment", "encointer-meetup-validation", @@ -5421,14 +5513,14 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "pallet-encointer-ceremonies-rpc-runtime-api", + "parity-scale-codec", "parking_lot 0.12.1", "sc-rpc", "sc-rpc-api", @@ -5440,19 +5532,18 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc-runtime-api" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-support", + "parity-scale-codec", "sp-api", "sp-std", ] [[package]] name = "pallet-encointer-communities" -version = "1.3.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5470,37 +5561,37 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "pallet-encointer-communities-rpc-runtime-api", + "parity-scale-codec", "parking_lot 0.12.1", "sc-rpc", "sc-rpc-api", "sp-api", "sp-blockchain", + "sp-core", "sp-runtime", "thiserror", ] [[package]] name = "pallet-encointer-communities-rpc-runtime-api" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", + "parity-scale-codec", "sp-api", "sp-std", ] [[package]] name = "pallet-encointer-democracy" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5509,6 +5600,7 @@ dependencies = [ "log", "pallet-encointer-ceremonies", "pallet-encointer-communities", + "pallet-encointer-reputation-commitments", "pallet-encointer-scheduler", "pallet-timestamp", "parity-scale-codec", @@ -5522,8 +5614,7 @@ dependencies = [ [[package]] name = "pallet-encointer-faucet" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "approx", "encointer-primitives", @@ -5543,8 +5634,7 @@ dependencies = [ [[package]] name = "pallet-encointer-reputation-commitments" -version = "1.2.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "approx", "encointer-primitives", @@ -5565,8 +5655,7 @@ dependencies = [ [[package]] name = "pallet-encointer-scheduler" -version = "1.1.0" -source = "git+https://github.com/encointer/pallets?branch=polkadot-v1.0.0-pallets-v1.3.0#7072b59b805690d154f195dc20073cfea5b2bd43" +version = "7.0.0" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5583,8 +5672,9 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b22d7b2ad0fa9811c441051cc90792924d58fe6d0cfeff8db231da68fcc9fa" dependencies = [ "frame-benchmarking", "frame-support", @@ -5606,8 +5696,9 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fe899a5ccb1bf4934f9ea344b9c45040d6cae4f9553be642580738afe5ff8ea" dependencies = [ "frame-support", "frame-system", @@ -5620,8 +5711,9 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d6b9f7210b6cd4dcf531c1f8729eaeb7dfbed8e8b1b01b1747240b0f8a715d" dependencies = [ "frame-benchmarking", "frame-support", @@ -5635,9 +5727,11 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5daf9f2a35fb6902011fc66e0d8c9831acd86512a78f298b52aba4970b121075" dependencies = [ + "docify", "frame-support", "frame-system", "log", @@ -5651,8 +5745,9 @@ dependencies = [ [[package]] name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42218759d10405996ae378968751a9b1142b47f6b887562f2df50cc14b1c7eaa" dependencies = [ "frame-support", "frame-system", @@ -5666,15 +5761,18 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", + "sp-state-machine", "sp-std", "sp-trie", ] [[package]] name = "pallet-sudo" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78e1b72aeabc9f0ba731229ccef31d8e5a160faae5edf2651a8cdacaa2690124" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5687,9 +5785,11 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c307589adc04a0d578ae00231bc04f1a53ef07a0aa2f3e9d4c7e4bf419bf6e3d" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5700,13 +5800,15 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "sp-storage", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d598d0ad779d19fa44ce6f80c57192537fa9f84995953bf2a8c104b7676b6b7" dependencies = [ "frame-support", "frame-system", @@ -5721,10 +5823,11 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4fac4e459db3c002ddebfbce82d055dbe8885eb4c2f9dcd9da5675eafef9bb7" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.22.1", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -5737,8 +5840,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d34487aec13e174906b6bba112f672e72948d16b8ee0752b8bebd659ac528dc" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5749,9 +5853,11 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317d231ff8a773e94fe5be8d3710213215208e7993bfeedd96bd6f4402da114a" dependencies = [ + "docify", "frame-benchmarking", "frame-support", "frame-system", @@ -5760,14 +5866,16 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-runtime", "sp-std", ] [[package]] name = "pallet-utility" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b879fb8c20405663309986621856050efc31969c2d2a209d78373356a62e27" dependencies = [ "frame-support", "frame-system", @@ -5781,22 +5889,23 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab512a34b3c2c5e465731cc7668edf79208bbe520be03484eeb05e63ed221735" +checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" dependencies = [ - "blake2", + "blake2 0.10.6", "crc32fast", "fs2", "hex", "libc", "log", "lz4", - "memmap2", + "memmap2 0.5.10", "parking_lot 0.12.1", "rand 0.8.5", "siphasher", "snap", + "winapi 0.3.9", ] [[package]] @@ -5820,7 +5929,7 @@ version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -5910,16 +6019,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" dependencies = [ - "crypto-mac 0.11.1", -] - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.7", + "crypto-mac 0.11.0", ] [[package]] @@ -5937,15 +6037,6 @@ dependencies = [ "base64 0.13.1", ] -[[package]] -name = "pem-rfc7468" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" -dependencies = [ - "base64ct", -] - [[package]] name = "percent-encoding" version = "2.3.0" @@ -5983,7 +6074,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -6024,7 +6115,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -6045,24 +6136,14 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", - "spki 0.7.2", + "der", + "spki", ] [[package]] @@ -6073,15 +6154,61 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "1.1.0" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" +checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" [[package]] -name = "platforms" -version = "3.1.2" +name = "polkavm-common" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" + +[[package]] +name = "polkavm-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" +dependencies = [ + "polkavm-derive-impl-macro", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" +dependencies = [ + "polkavm-common", + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +dependencies = [ + "polkavm-derive-impl", + "syn 2.0.52", +] + +[[package]] +name = "polkavm-linker" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdec1451cb18261d5d01de82acc15305e417fb59588cdcb3127d3dcc9672b925" +dependencies = [ + "gimli 0.28.0", + "hashbrown 0.14.3", + "log", + "object 0.32.1", + "polkavm-common", + "regalloc2 0.9.3", + "rustc-demangle", +] [[package]] name = "polling" @@ -6107,7 +6234,7 @@ checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash 0.4.0", ] [[package]] @@ -6119,7 +6246,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "opaque-debug 0.3.0", - "universal-hash 0.4.1", + "universal-hash 0.4.0", ] [[package]] @@ -6136,9 +6263,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.3" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31114a898e107c51bb1609ffaf55a0e011cf6a4d7f1170d0015a165082c0338b" +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "ppv-lite86" @@ -6193,7 +6320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -6204,7 +6331,7 @@ checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ "fixed-hash", "impl-codec", - "impl-serde 0.4.0", + "impl-serde", "scale-info", "uint", ] @@ -6219,6 +6346,15 @@ dependencies = [ "toml 0.5.11", ] +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -6251,20 +6387,20 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro-warning" -version = "0.4.2" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" +checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -6303,7 +6439,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -6313,7 +6449,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes 1.5.0", - "prost-derive", + "prost-derive 0.11.9", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes 1.5.0", + "prost-derive 0.12.3", ] [[package]] @@ -6330,7 +6476,7 @@ dependencies = [ "multimap", "petgraph", "prettyplease 0.1.25", - "prost", + "prost 0.11.9", "prost-types", "regex", "syn 1.0.109", @@ -6351,13 +6497,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "prost-types" version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ - "prost", + "prost 0.11.9", ] [[package]] @@ -6369,6 +6528,21 @@ dependencies = [ "cc", ] +[[package]] +name = "quanta" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.0+wasi-snapshot-preview1", + "web-sys", + "winapi 0.3.9", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -6416,21 +6590,21 @@ checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" dependencies = [ "bytes 1.5.0", "rand 0.8.5", - "ring", + "ring 0.16.20", "rustc-hash", "rustls 0.20.9", "slab", "thiserror", "tinyvec", "tracing", - "webpki 0.22.1", + "webpki", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -6503,6 +6677,16 @@ dependencies = [ "getrandom 0.2.10", ] +[[package]] +name = "rand_distr" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -6521,6 +6705,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "11.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +dependencies = [ + "bitflags 2.4.0", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -6549,19 +6742,6 @@ dependencies = [ "num_cpus", ] -[[package]] -name = "rcgen" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6413f3de1edee53342e6138e75b56d32e7bc6e332b3bd62d497b1929d4cfbcdd" -dependencies = [ - "pem", - "ring", - "time", - "x509-parser 0.13.2", - "yasna", -] - [[package]] name = "rcgen" version = "0.10.0" @@ -6569,7 +6749,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbe84efe2f38dea12e9bfc1f65377fdf03e53a18cb3b995faedf7934c7e785b" dependencies = [ "pem", - "ring", + "ring 0.16.20", "time", "yasna", ] @@ -6620,7 +6800,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -6635,6 +6815,19 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" version = "1.9.5" @@ -6689,17 +6882,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -6707,7 +6889,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -6719,12 +6901,27 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi 0.3.9", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.52.0", +] + [[package]] name = "rocksdb" version = "0.21.0" @@ -6735,6 +6932,12 @@ dependencies = [ "librocksdb-sys", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rpassword" version = "7.2.0" @@ -6746,17 +6949,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rtcp" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1919efd6d4a6a85d13388f9487549bb8e359f17198cc03ffd72f79b553873691" -dependencies = [ - "bytes 1.5.0", - "thiserror", - "webrtc-util", -] - [[package]] name = "rtnetlink" version = "0.10.1" @@ -6782,20 +6974,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "rtp" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a095411ff00eed7b12e4c6a118ba984d113e1079582570d56a5ee723f11f80" -dependencies = [ - "async-trait", - "bytes 1.5.0", - "rand 0.8.5", - "serde", - "thiserror", - "webrtc-util", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -6884,39 +7062,40 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ - "base64 0.13.1", "log", - "ring", - "sct 0.6.1", - "webpki 0.21.4", + "ring 0.16.20", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.20.9" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", - "ring", - "sct 0.7.0", - "webpki 0.22.1", + "ring 0.16.20", + "rustls-webpki 0.101.5", + "sct", ] [[package]] name = "rustls" -version = "0.21.7" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", - "ring", - "rustls-webpki 0.101.5", - "sct 0.7.0", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle 2.5.0", + "zeroize", ] [[package]] @@ -6926,7 +7105,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.3", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.1", + "rustls-pki-types", "schannel", "security-framework", ] @@ -6941,23 +7133,40 @@ dependencies = [ ] [[package]] -name = "rustls-webpki" -version = "0.100.3" +name = "rustls-pemfile" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6a5fc258f1c1276dfe3016516945546e2d5383911efc0fc4f1cdc5df3a4ae3" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" dependencies = [ - "ring", - "untrusted", + "base64 0.21.4", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" + [[package]] name = "rustls-webpki" version = "0.101.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", ] [[package]] @@ -7012,8 +7221,9 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97e78cc21b2bb1d13b33d9c64fbb02a10efde428e8f0a68a0ca2084203123933" dependencies = [ "log", "sp-core", @@ -7023,15 +7233,15 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cede898c7079b789b42c4fdd8f1ff74f7007232406cd0299e2c3a5ada1db2910" dependencies = [ "futures", "futures-timer", "log", "parity-scale-codec", "sc-block-builder", - "sc-client-api", "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", @@ -7046,25 +7256,31 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb2a2f425079daf382b0f1cf3b9085bed25db13ec8ad0ff64b0dc75ff457c0f7" dependencies = [ "parity-scale-codec", - "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", "sp-core", "sp-inherents", "sp-runtime", + "sp-trie", ] [[package]] name = "sc-chain-spec" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41472507ca721651ef117a2702a9bd6d9d9e8ce5f16840a71741993319926191" dependencies = [ - "memmap2", + "array-bytes 6.2.2", + "docify", + "log", + "memmap2 0.9.4", + "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", "sc-executor", @@ -7074,31 +7290,38 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core", + "sp-crypto-hashing", + "sp-genesis-builder", + "sp-io", "sp-runtime", "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "sc-cli" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "274117ab32d7b3b2f790c841b61f22027d80f344c00b8ce38df772553a8a5409" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", + "bip39", "chrono", - "clap 4.4.3", + "clap 4.5.1", "fdlimit", "futures", + "itertools", "libp2p-identity", "log", "names", @@ -7109,6 +7332,7 @@ dependencies = [ "sc-client-api", "sc-client-db", "sc-keystore", + "sc-mixnet", "sc-network", "sc-service", "sc-telemetry", @@ -7124,14 +7348,14 @@ dependencies = [ "sp-runtime", "sp-version", "thiserror", - "tiny-bip39", "tokio", ] [[package]] name = "sc-client-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acaa6df639ac7a7f10060daf50461afddf6635ea148514a1eceba3384046c30" dependencies = [ "fnv", "futures", @@ -7151,13 +7375,15 @@ dependencies = [ "sp-state-machine", "sp-statement-store", "sp-storage", + "sp-trie", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d946e00b4bef179ef7c2d29966935d96e38176a543249c1b17fdeacfc3446bb4" dependencies = [ "hash-db", "kvdb", @@ -7182,8 +7408,9 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "081b1b7bd2894e4614acbfa47424771a5102bf907b31d2bbd379e8c4f3b55b09" dependencies = [ "async-trait", "futures", @@ -7207,8 +7434,9 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca4c0040ba696f6eac9a6b627dbb487b27076203c5ed1b03fac6c993df5b627" dependencies = [ "async-trait", "futures", @@ -7236,11 +7464,12 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ea4771511dfcabe0e0dd3a43368ba3f430b0aaf736463b14286cc10a6494e6" dependencies = [ - "ahash 0.8.3", - "array-bytes 6.1.0", + "ahash 0.8.10", + "array-bytes 6.2.2", "async-trait", "dyn-clone", "finality-grandpa", @@ -7258,6 +7487,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-gossip", + "sc-network-sync", "sc-telemetry", "sc-transaction-pool-api", "sc-utils", @@ -7269,6 +7499,7 @@ dependencies = [ "sp-consensus", "sp-consensus-grandpa", "sp-core", + "sp-crypto-hashing", "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", @@ -7277,8 +7508,9 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ddad1b613fa5118016c11f1015ba5ff9a9f2ce914a72482ec0303d4d828e2f9" dependencies = [ "async-trait", "futures", @@ -7300,8 +7532,9 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a331ae16b0a17ed474eaf9c2dc01b145511cf4bd62ffc165d7dd1d3f13e48a94" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -7322,8 +7555,9 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f414028dc468aafd449cb659f7664e39540f3308945ec9cf2209c1359fa67e" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -7334,13 +7568,15 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcacfc88265486c337ef97a042ba42ccd1903520dbff40116dbe837e3ee6b89" dependencies = [ "anyhow", "cfg-if 1.0.0", "libc", "log", + "parking_lot 0.12.1", "rustix 0.36.15", "sc-allocator", "sc-executor-common", @@ -7351,8 +7587,9 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea5d24b1f02efd53092a78be46b7e6fc4805b3fb723bbcc8928574d9fa309a94" dependencies = [ "ansi_term", "futures", @@ -7361,30 +7598,63 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", + "sc-network-sync", "sp-blockchain", "sp-runtime", ] [[package]] name = "sc-keystore" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0413f82a27eded5a12e1f3d02c478b378e72912fbdf3b8b9cae7c5995c5a8f89" +dependencies = [ + "array-bytes 6.2.2", + "parking_lot 0.12.1", + "serde_json", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "thiserror", +] + +[[package]] +name = "sc-mixnet" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9aaa5a9d17d0ea54a5da0af04f0c187f65500d7597395eaae313c511a08db6c" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 4.2.0", + "arrayvec 0.7.4", + "blake2 0.10.6", + "bytes 1.5.0", + "futures", + "futures-timer", + "libp2p-identity", + "log", + "mixnet", + "multiaddr", + "parity-scale-codec", "parking_lot 0.12.1", - "serde_json", - "sp-application-crypto", + "sc-client-api", + "sc-network", + "sc-transaction-pool-api", + "sp-api", + "sp-consensus", "sp-core", "sp-keystore", + "sp-mixnet", + "sp-runtime", "thiserror", ] [[package]] name = "sc-network" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf955c8966573e7e3cc940e831d792945a41d6e443766ad50e50a5af75e1ef74" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "async-channel", "async-trait", "asynchronous-codec", @@ -7415,6 +7685,8 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", + "tokio-stream", "unsigned-varint", "wasm-timer", "zeroize", @@ -7422,15 +7694,16 @@ dependencies = [ [[package]] name = "sc-network-bitswap" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b34047c641db262b9035ef809b1184e55b3f6c45bf3f6110f293d3652ec663" dependencies = [ "async-channel", "cid", "futures", "libp2p-identity", "log", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-network", @@ -7442,8 +7715,9 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7cfe68e017be02fd9911cd1e4db50bae31671e01e988ef5c375d0092ff7c71" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -7459,16 +7733,18 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6c4ffd60fe240d9b0963ec60752810660a201755a77b922aa5e8ef7256f6b5" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.10", "futures", "futures-timer", "libp2p", "log", "sc-network", "sc-network-common", + "sc-network-sync", "schnellru", "sp-runtime", "substrate-prometheus-endpoint", @@ -7477,16 +7753,17 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01f3ca1b7e567ca60535bb76b3f8617e8d40de0067f7d1794d3f5ef7ed7a4d0e" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "async-channel", "futures", "libp2p-identity", "log", "parity-scale-codec", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-network", @@ -7498,10 +7775,11 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50a16e2817ef6def510a89b2e439b13f53b31d783344061b8551a37b6fb61ef4" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "async-channel", "async-trait", "fork-tree", @@ -7511,7 +7789,7 @@ dependencies = [ "log", "mockall", "parity-scale-codec", - "prost", + "prost 0.12.3", "prost-build", "sc-client-api", "sc-consensus", @@ -7528,20 +7806,24 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", + "tokio-stream", ] [[package]] name = "sc-network-transactions" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658a81c4a24f874ada1cac70db349ff7983956563e39e1468eb6e8703f07057e" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "futures", "libp2p", "log", "parity-scale-codec", "sc-network", "sc-network-common", + "sc-network-sync", "sc-utils", "sp-consensus", "sp-runtime", @@ -7550,10 +7832,11 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d099f8d2f399be5b7d163e4236faaa47e7ce131f4021b9fe8e3e607e0ca51364" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "bytes 1.5.0", "fnv", "futures", @@ -7584,8 +7867,9 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8dadb2ae5a316e4d08cad6aacd5de1dec792f3bd94e3960795ff7ffd07211c" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7593,17 +7877,19 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61faa018966cb794e36be31af4ed4d19deaa93c751ff32512637c7bca104e9e8" dependencies = [ "futures", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "parking_lot 0.12.1", "sc-block-builder", "sc-chain-spec", "sc-client-api", + "sc-mixnet", "sc-rpc-api", "sc-tracing", "sc-transaction-pool-api", @@ -7624,12 +7910,14 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f716a273af4f4782430ebe4fe6d0f8b1490ff7c103dc78193706bfff370c250f" dependencies = [ - "jsonrpsee", + "jsonrpsee 0.22.1", "parity-scale-codec", "sc-chain-spec", + "sc-mixnet", "sc-transaction-pool-api", "scale-info", "serde", @@ -7643,12 +7931,17 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ae724afa9862381f77b6d3a205baef5daceec9e584f17069546eb7dfca5400" dependencies = [ + "futures", + "governor", "http", - "jsonrpsee", + "hyper", + "jsonrpsee 0.22.1", "log", + "pin-project", "serde_json", "substrate-prometheus-endpoint", "tokio", @@ -7658,47 +7951,53 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8599ca0b78580328cafa11fdb2d89d8678ba64e937c957515816492e87066bad" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", "futures", "futures-util", "hex", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "parking_lot 0.12.1", + "rand 0.8.5", "sc-chain-spec", "sc-client-api", + "sc-rpc", "sc-transaction-pool-api", + "sc-utils", "serde", "sp-api", "sp-blockchain", "sp-core", + "sp-rpc", "sp-runtime", "sp-version", "thiserror", + "tokio", "tokio-stream", ] [[package]] name = "sc-service" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32ea0efa7cf58f6cacb04034939e62f12ce7bf2df6a60f67e2d5c2f27fe54999" dependencies = [ "async-trait", "directories", "exit-future", "futures", "futures-timer", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", - "sc-block-builder", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -7748,8 +8047,9 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "748f92aa2827647932a04685df8e00b9763d4060635ca84eaeb3788822198013" dependencies = [ "log", "parity-scale-codec", @@ -7759,9 +8059,11 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399e72ba964c0394181db8680c34b3503116c217b0fe3564696857ea9ca4aa68" dependencies = [ + "derive_more", "futures", "libc", "log", @@ -7772,14 +8074,16 @@ dependencies = [ "serde", "serde_json", "sp-core", + "sp-crypto-hashing", "sp-io", "sp-std", ] [[package]] name = "sc-telemetry" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c6807ebd9f43ab628931842d3aaa9404ddfd07013e9c7027ca603f496939577" dependencies = [ "chrono", "futures", @@ -7797,15 +8101,17 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7abee1c60e6f55a09ae0b9055093709bc84ff2bb55a3828167d556f724f82cc" dependencies = [ "ansi_term", - "atty", "chrono", + "is-terminal", "lazy_static", "libc", "log", + "parity-scale-codec", "parking_lot 0.12.1", "regex", "rustc-hash", @@ -7826,19 +8132,21 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "sc-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe004c916f4be7eebf52f05df1d44a240b653cb42c7a6c49692553620b46d5f" dependencies = [ "async-trait", "futures", @@ -7854,6 +8162,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-core", + "sp-crypto-hashing", "sp-runtime", "sp-tracing", "sp-transaction-pool", @@ -7863,8 +8172,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe0eeb21d4f09a9edffee481df544bb6fc83cccc0788c19ceebd760f1afd167" dependencies = [ "async-trait", "futures", @@ -7879,8 +8189,9 @@ dependencies = [ [[package]] name = "sc-utils" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1863d482be044f4768ef5de6119dc70b5e31e6e9f71ad225c177474d6540e424" dependencies = [ "async-channel", "futures", @@ -7892,11 +8203,78 @@ dependencies = [ "sp-arithmetic", ] +[[package]] +name = "scale-bits" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "036575c29af9b6e4866ffb7fa055dbf623fe7a9cc159b33786de6013a6969d89" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-decode-derive", + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-decode-derive" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" +dependencies = [ + "darling", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "scale-encode" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" +dependencies = [ + "derive_more", + "parity-scale-codec", + "primitive-types", + "scale-bits", + "scale-encode-derive", + "scale-info", + "smallvec", +] + +[[package]] +name = "scale-encode-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" +dependencies = [ + "darling", + "proc-macro-crate 1.1.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-info" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "bitvec", "cfg-if 1.0.0", @@ -7908,16 +8286,32 @@ dependencies = [ [[package]] name = "scale-info-derive" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "scale-value" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58223c7691bf0bd46b43c9aea6f0472d1067f378d574180232358d7c6e0a8089" +dependencies = [ + "derive_more", + "either", + "frame-metadata 15.1.0", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-encode", + "scale-info", +] + [[package]] name = "schannel" version = "0.1.22" @@ -7933,7 +8327,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.10", "cfg-if 1.0.0", "hashbrown 0.13.2", ] @@ -7947,12 +8341,29 @@ dependencies = [ "arrayref", "arrayvec 0.5.2", "curve25519-dalek 2.1.3", - "getrandom 0.1.16", - "merlin", - "rand 0.7.3", + "merlin 2.0.1", "rand_core 0.5.1", "sha2 0.8.2", - "subtle", + "subtle 2.5.0", + "zeroize", +] + +[[package]] +name = "schnorrkel" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" +dependencies = [ + "aead 0.5.2", + "arrayref", + "arrayvec 0.7.4", + "curve25519-dalek 4.1.2", + "getrandom_or_panic", + "merlin 3.0.0", + "rand_core 0.6.4", + "serde_bytes", + "sha2 0.10.7", + "subtle 2.5.0", "zeroize", ] @@ -7968,50 +8379,14 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sct" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "sdp" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d22a5ef407871893fd72b4562ee15e4742269b173959db4b8df6f538c414e13" -dependencies = [ - "rand 0.8.5", - "substring", - "thiserror", - "url", -] - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array 0.14.7", - "pkcs8 0.9.0", - "subtle", - "zeroize", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -8020,28 +8395,28 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.8", + "base16ct", + "der", "generic-array 0.14.7", - "pkcs8 0.10.2", - "subtle", + "pkcs8", + "subtle 2.5.0", "zeroize", ] [[package]] name = "secp256k1" -version = "0.24.3" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.6.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" dependencies = [ "cc", ] @@ -8113,29 +8488,38 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -8144,9 +8528,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -8176,17 +8560,6 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - [[package]] name = "sha2" version = "0.8.2" @@ -8257,16 +8630,6 @@ dependencies = [ "libc", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core 0.6.4", -] - [[package]] name = "signature" version = "2.1.0" @@ -8290,6 +8653,12 @@ dependencies = [ "wide", ] +[[package]] +name = "simple-mermaid" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "620a1d43d70e142b1d46a929af51d44f383db9c7a2ec122de2cd992ccfcf3c18" + [[package]] name = "siphasher" version = "0.3.11" @@ -8329,15 +8698,15 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ - "aes-gcm 0.9.4", - "blake2", + "aes-gcm 0.9.2", + "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.1.0", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", - "ring", + "ring 0.16.20", "rustc_version 0.4.0", "sha2 0.10.7", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -8352,12 +8721,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -8379,8 +8748,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298331cb47a948244f6fb4921b5cbeece267d72139fb90760993b6ec37b2212c" dependencies = [ "hash-db", "log", @@ -8391,6 +8761,7 @@ dependencies = [ "sp-externalities", "sp-metadata-ir", "sp-runtime", + "sp-runtime-interface", "sp-state-machine", "sp-std", "sp-trie", @@ -8400,22 +8771,24 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18cfbb3ae0216e842dfb805ea8e896e85b07a7c34d432a6c7b7d770924431ed2" dependencies = [ "Inflector", - "blake2", + "blake2 0.10.6", "expander", - "proc-macro-crate", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "sp-application-crypto" -version = "23.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b4b7b12922cb90cf8dff0cab14087ba0ca25c1f04ba060c7294ce42c78d89ab" dependencies = [ "parity-scale-codec", "scale-info", @@ -8427,8 +8800,9 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "16.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" dependencies = [ "integer-sqrt", "num-traits", @@ -8441,8 +8815,9 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b35d0992e2183686215dccb4bcb5003b4eb52feec82d82dabd81db7401d845a" dependencies = [ "sp-api", "sp-inherents", @@ -8452,8 +8827,9 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c24a17e8e5406725ab805ee5cbab4b2a9181b7b8dd93f9c302eed76216c6321a" dependencies = [ "futures", "log", @@ -8470,8 +8846,9 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e3841d5b5929080c92ef846db7e1a8323d6352b981a6b5cbccd0886fdf1a85e" dependencies = [ "async-trait", "futures", @@ -8485,34 +8862,16 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-application-crypto", - "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-std", - "sp-timestamp", -] - -[[package]] -name = "sp-consensus-babe" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14dc8e041fcb128e9e6a0d706c243b7263dae7d45098a9450498a1657abac2f3" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "serde", "sp-api", "sp-application-crypto", "sp-consensus-slots", - "sp-core", "sp-inherents", "sp-runtime", "sp-std", @@ -8521,8 +8880,9 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47109ea7b003030bc7cff2724e785859b9b8e6504866ffa1a3b55380cb11d53" dependencies = [ "finality-grandpa", "log", @@ -8539,8 +8899,9 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c72408adadb54b6f4eb287729166528cdb83e08c796685edc9bee09571b6474" dependencies = [ "parity-scale-codec", "scale-info", @@ -8551,36 +8912,37 @@ dependencies = [ [[package]] name = "sp-core" -version = "21.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "586e0d5185e4545f465fc9a04fb9c4572d3e294137312496db2b67b0bb579e1f" dependencies = [ - "array-bytes 6.1.0", + "array-bytes 6.2.2", + "bip39", "bitflags 1.3.2", - "blake2", + "blake2 0.10.6", "bounded-collections", - "bs58", + "bs58 0.5.0", "dyn-clonable", "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", - "impl-serde 0.4.0", - "lazy_static", + "impl-serde", + "itertools", "libsecp256k1", "log", - "merlin", + "merlin 3.0.0", "parity-scale-codec", "parking_lot 0.12.1", "paste", "primitive-types", "rand 0.8.5", - "regex", "scale-info", - "schnorrkel", + "schnorrkel 0.11.4", "secp256k1", "secrecy", "serde", - "sp-core-hashing", + "sp-crypto-hashing", "sp-debug-derive", "sp-externalities", "sp-runtime-interface", @@ -8589,15 +8951,16 @@ dependencies = [ "ss58-registry", "substrate-bip39", "thiserror", - "tiny-bip39", "tracing", + "w3f-bls", "zeroize", ] [[package]] -name = "sp-core-hashing" -version = "9.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +name = "sp-crypto-hashing" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" dependencies = [ "blake2b_simd", "byteorder", @@ -8608,19 +8971,21 @@ dependencies = [ ] [[package]] -name = "sp-core-hashing-proc-macro" -version = "9.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +name = "sp-crypto-hashing-proc-macro" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", - "sp-core-hashing", - "syn 2.0.37", + "sp-crypto-hashing", + "syn 2.0.52", ] [[package]] name = "sp-database" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -8628,18 +8993,20 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "sp-externalities" -version = "0.19.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" dependencies = [ "environmental", "parity-scale-codec", @@ -8647,10 +9014,23 @@ dependencies = [ "sp-storage", ] +[[package]] +name = "sp-genesis-builder" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a862db099e8a799417b63ea79c90079811cdf68fcf3013d81cdceeddcec8f142" +dependencies = [ + "serde_json", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-inherents" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42eb3c88572c7c80e7ecb6365601a490350b09d11000fcc7839efd304e172177" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -8663,18 +9043,19 @@ dependencies = [ [[package]] name = "sp-io" -version = "23.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" dependencies = [ "bytes 1.5.0", - "ed25519 1.5.3", - "ed25519-dalek 1.0.1", + "ed25519-dalek", "libsecp256k1", "log", "parity-scale-codec", "rustversion", "secp256k1", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-keystore", "sp-runtime-interface", @@ -8688,31 +9069,32 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "24.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9c74648e593b45309dfddf34f4edfd0a91816d1d97dd5e0bd93c46e7cdb0d6" dependencies = [ - "lazy_static", "sp-core", "sp-runtime", - "strum", + "strum 0.24.1", ] [[package]] name = "sp-keystore" -version = "0.27.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd4bf9e5fa486416c92c2bb497b7ce2c43eac80cbdc407ffe2d34b365694ac29" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "sp-core", "sp-externalities", - "thiserror", ] [[package]] name = "sp-maybe-compressed-blob" -version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" dependencies = [ "thiserror", "zstd 0.12.4", @@ -8720,8 +9102,9 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.1.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" dependencies = [ "frame-metadata 16.0.0", "parity-scale-codec", @@ -8729,10 +9112,24 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-mixnet" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15a8078f19b1292220b7110115b49f4fcd427324f3b184f6d8dbeb6b4dd40d4d" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-std", +] + [[package]] name = "sp-offchain" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f826efe7bdd6d142ced34f5ef1ed9a2070887e78d3146220250edeb67e6791d5" dependencies = [ "sp-api", "sp-core", @@ -8741,8 +9138,9 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8f5a17a0a11de029a8b811cb6e8b32ce7e02183cc04a3e965c383246798c416" dependencies = [ "backtrace", "lazy_static", @@ -8751,8 +9149,9 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffa9924fc1d0e7b79550493b8b8ac3fa58593cbdb169ee6cf6c1ee3ef25882dd" dependencies = [ "rustc-hash", "serde", @@ -8761,9 +9160,11 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "24.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b28fcf8f53d917e420e783dd27d06fd276f55160301c5bc977cc5898c4130f6f" dependencies = [ + "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", @@ -8773,6 +9174,7 @@ dependencies = [ "rand 0.8.5", "scale-info", "serde", + "simple-mermaid", "sp-application-crypto", "sp-arithmetic", "sp-core", @@ -8783,12 +9185,14 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "17.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ "bytes 1.5.0", "impl-trait-for-tuples", "parity-scale-codec", + "polkavm-derive", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -8801,20 +9205,23 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "11.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", - "proc-macro-crate", + "expander", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0399eb885209b51b2999fe35883a579b0848674f0679019ce262f19d0a853325" dependencies = [ "parity-scale-codec", "scale-info", @@ -8828,8 +9235,9 @@ dependencies = [ [[package]] name = "sp-staking" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48b92f4f66b40cbf7cf00d7808d8eec16e25cb420a29ec4060a74c0e9f7c2938" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8842,8 +9250,9 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.28.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ae47765916d342b53d07be012a71efc4c1377d875ade31340cc4fb784b9921" dependencies = [ "hash-db", "log", @@ -8863,32 +9272,43 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95ede4523fc978585383465a406289235a71dd6febe7f79e1114794afae5cd0" dependencies = [ + "aes-gcm 0.10.2", + "curve25519-dalek 4.1.2", + "ed25519-dalek", + "hkdf", "parity-scale-codec", + "rand 0.8.5", "scale-info", + "sha2 0.10.7", "sp-api", "sp-application-crypto", "sp-core", + "sp-crypto-hashing", "sp-externalities", "sp-runtime", "sp-runtime-interface", "sp-std", "thiserror", + "x25519-dalek 2.0.0", ] [[package]] name = "sp-std" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "13.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" dependencies = [ - "impl-serde 0.4.0", + "impl-serde", "parity-scale-codec", "ref-cast", "serde", @@ -8898,8 +9318,9 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee9532c2e4c8fcd7753cb4c741daeb8d9e3ac7cbc15a84c78d4c96492ed20eba" dependencies = [ "async-trait", "parity-scale-codec", @@ -8911,8 +9332,9 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "10.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" dependencies = [ "parity-scale-codec", "sp-std", @@ -8923,8 +9345,9 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e8b3208d1c8347ab75b28192dc7354489369ae652f2d9936521c8ccd92ca06" dependencies = [ "sp-api", "sp-runtime", @@ -8932,8 +9355,9 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa2b7cfb16da80934eab7e37c317969f0a19f31396c530279ce1110b3ecbd95" dependencies = [ "async-trait", "parity-scale-codec", @@ -8947,20 +9371,22 @@ dependencies = [ [[package]] name = "sp-trie" -version = "22.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.10", "hash-db", - "hashbrown 0.13.2", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", + "rand 0.8.5", "scale-info", "schnellru", "sp-core", + "sp-externalities", "sp-std", "thiserror", "tracing", @@ -8970,15 +9396,16 @@ dependencies = [ [[package]] name = "sp-version" -version = "22.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "973478ac076be7cb8e0a7968ee43cd7c46fb26e323d36020a9f3bb229e033cd2" dependencies = [ - "impl-serde 0.4.0", + "impl-serde", "parity-scale-codec", "parity-wasm", "scale-info", "serde", - "sp-core-hashing-proc-macro", + "sp-crypto-hashing-proc-macro", "sp-runtime", "sp-std", "sp-version-proc-macro", @@ -8987,19 +9414,21 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "8.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "sp-wasm-interface" -version = "14.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -9011,15 +9440,16 @@ dependencies = [ [[package]] name = "sp-weights" -version = "20.0.0" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab8a9c7a1b64fa7dba38622ad1de26f0b2e595727c0e42c7b109ecb8e7120688" dependencies = [ + "bounded-collections", "parity-scale-codec", "scale-info", "serde", "smallvec", "sp-arithmetic", - "sp-core", "sp-debug-derive", "sp-std", ] @@ -9031,24 +9461,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "spinners" -version = "4.1.0" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08615eea740067d9899969bc2891c68a19c315cb1f66640af9a9ecb91b13bcab" -dependencies = [ - "lazy_static", - "maplit", - "strum", -] +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spki" -version = "0.6.0" +name = "spinning_top" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" dependencies = [ - "base64ct", - "der 0.6.1", + "lock_api", ] [[package]] @@ -9058,7 +9482,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.8", + "der", ] [[package]] @@ -9128,15 +9552,27 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" dependencies = [ - "strum_macros", + "strum_macros 0.24.3", ] +[[package]] +name = "strum" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" + [[package]] name = "strum_macros" version = "0.24.3" @@ -9151,79 +9587,72 @@ dependencies = [ ] [[package]] -name = "stun" -version = "0.4.4" +name = "strum_macros" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "base64 0.13.1", - "crc 3.0.1", - "lazy_static", - "md-5", - "rand 0.8.5", - "ring", - "subtle", - "thiserror", - "tokio", - "url", - "webrtc-util", + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.52", ] [[package]] name = "substrate-api-client" -version = "0.12.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.17.0" dependencies = [ "ac-compose-macros", "ac-node-api", "ac-primitives", "async-trait", "derive_more", - "frame-metadata 15.1.0", + "frame-metadata 16.0.0", "frame-support", - "futures", + "futures-util", "hex", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "maybe-async", "parity-scale-codec", "serde", "serde_json", "sp-core", + "sp-crypto-hashing", + "sp-inherents", "sp-runtime", "sp-runtime-interface", + "sp-storage", + "sp-version", "url", "ws", ] [[package]] name = "substrate-bip39" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +checksum = "e620c7098893ba667438b47169c00aacdd9e7c10e042250ce2b60b087ec97328" dependencies = [ "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", + "pbkdf2", + "schnorrkel 0.9.1", "sha2 0.9.9", "zeroize", ] [[package]] name = "substrate-build-script-utils" -version = "3.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd540ba72520174c2c73ce96bf507eeba3cc8a481f58be92525b69110e1fa645" -dependencies = [ - "platforms 1.1.0", -] +checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" [[package]] name = "substrate-client-keystore" -version = "0.9.0" -source = "git+https://github.com/scs/substrate-api-client.git?branch=polkadot-v1.0.0-tag-v0.12.0#7858fdaa00e5ff8a1448ce95344807732d7638fb" +version = "0.10.0" dependencies = [ - "array-bytes 4.2.0", + "array-bytes 6.2.2", "async-trait", "parking_lot 0.12.1", "sc-keystore", @@ -9237,22 +9666,24 @@ dependencies = [ [[package]] name = "substrate-fixed" version = "0.5.9" -source = "git+https://github.com/encointer/substrate-fixed?tag=polkadot-v1.0.0#df67f97a6db9b40215f105613b381ca82f1e2ff4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e83ba2b4f68f12ec6b0f55bac0a23a5bcaaf2676f1109c7a5ead6121c7f0622" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "typenum 1.16.0", + "substrate-typenum", ] [[package]] name = "substrate-frame-rpc-system" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fba95234990a0eecb3199ee2589112a1a3763db1fa7739a316f3e26f7693c9" dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "sc-rpc-api", @@ -9264,10 +9695,22 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "substrate-geohash" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa2aad67d4ac1b37d97338ab6fd18fd5ec79c35a24112028e6feda0d67142e9a" +dependencies = [ + "parity-scale-codec", + "scale-info", + "substrate-fixed", +] + [[package]] name = "substrate-prometheus-endpoint" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8fe06b03b8a291c09507c42f92a2c2c10dd3d62975d02c7f64a92d87bfe09b" dependencies = [ "hyper", "log", @@ -9277,50 +9720,46 @@ dependencies = [ ] [[package]] -name = "substrate-rpc-client" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +name = "substrate-typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f0091e93c2c75b233ae39424c52cb8a662c0811fb68add149e20e5d7e8a788" dependencies = [ - "async-trait", - "jsonrpsee", - "log", - "sc-rpc-api", - "serde", - "sp-runtime", + "parity-scale-codec", + "scale-info", ] [[package]] name = "substrate-wasm-builder" -version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d182ae093d473b5947e32c392b10fb12125318c4470ff8adf32b0cbf2e9e6611" dependencies = [ - "ansi_term", "build-helper", "cargo_metadata", + "console", "filetime", "parity-wasm", + "polkavm-linker", "sp-maybe-compressed-blob", - "strum", + "strum 0.24.1", "tempfile", - "toml 0.7.8", + "toml 0.8.10", "walkdir", "wasm-opt", ] [[package]] -name = "substring" -version = "1.4.5" +name = "subtle" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ee6433ecef213b2e72f587ef64a2f5943e7cd16fbd82dbe8bc07486c534c86" -dependencies = [ - "autocfg", -] +checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -9335,9 +9774,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -9411,6 +9850,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix 0.38.13", + "windows-sys 0.48.0", +] + [[package]] name = "termtree" version = "0.4.1" @@ -9428,22 +9877,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] @@ -9509,25 +9958,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny-bip39" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" -dependencies = [ - "anyhow", - "hmac 0.12.1", - "once_cell", - "pbkdf2 0.11.0", - "rand 0.8.5", - "rustc-hash", - "sha2 0.10.7", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -9537,16 +9967,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -9564,52 +9984,52 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes 1.5.0", "libc", - "mio 0.8.8", + "mio 0.8.10", "num_cpus", "parking_lot 0.12.1", "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.6", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] -name = "tokio-retry" -version = "0.3.0" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "pin-project", - "rand 0.8.5", + "rustls 0.21.7", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.7", + "rustls 0.22.2", + "rustls-pki-types", "tokio", ] @@ -9651,36 +10071,47 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.22.6", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.0.0", + "toml_datetime", + "winnow 0.5.15", +] + +[[package]] +name = "toml_edit" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ "indexmap 2.0.0", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -9689,6 +10120,10 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", "tracing", @@ -9745,14 +10180,14 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -9814,9 +10249,9 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" +checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" dependencies = [ "hash-db", "hashbrown 0.13.2", @@ -9886,86 +10321,22 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" -[[package]] -name = "try-runtime-cli" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" -dependencies = [ - "async-trait", - "clap 4.4.3", - "frame-remote-externalities", - "frame-try-runtime", - "hex", - "log", - "parity-scale-codec", - "sc-cli", - "sc-executor", - "serde", - "serde_json", - "sp-api", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-core", - "sp-debug-derive", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-rpc", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "sp-transaction-storage-proof", - "sp-version", - "sp-weights", - "substrate-rpc-client", - "zstd 0.12.4", -] - [[package]] name = "tt-call" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" -[[package]] -name = "turn" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4712ee30d123ec7ae26d1e1b218395a16c87cdbaf4b3925d170d684af62ea5e8" -dependencies = [ - "async-trait", - "base64 0.13.1", - "futures", - "log", - "md-5", - "rand 0.8.5", - "ring", - "stun", - "thiserror", - "tokio", - "webrtc-util", -] - [[package]] name = "twox-hash" version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", - "digest 0.10.7", - "rand 0.8.5", - "static_assertions", -] - -[[package]] -name = "typenum" -version = "1.16.0" -source = "git+https://github.com/encointer/typenum?tag=polkadot-v1.0.0#4cba9a73f7e94ba38c824616efab93f177c9a556" -dependencies = [ - "parity-scale-codec", - "scale-info", + "cfg-if 1.0.0", + "digest 0.10.7", + "rand 0.8.5", + "static_assertions", ] [[package]] @@ -10027,12 +10398,12 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array 0.14.7", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -10042,7 +10413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle", + "subtle 2.5.0", ] [[package]] @@ -10063,6 +10434,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.4.1" @@ -10080,15 +10457,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" -dependencies = [ - "getrandom 0.2.10", -] - [[package]] name = "valuable" version = "0.1.0" @@ -10120,12 +10488,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] -name = "waitgroup" -version = "0.1.2" +name = "w3f-bls" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f50000a783467e6c0200f9d10642f4bc424e39efc1b770203e88b488f79292" +checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" dependencies = [ - "atomic-waker", + "ark-bls12-377", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-serialize-derive", + "arrayref", + "constcat", + "digest 0.10.7", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "sha2 0.10.7", + "sha3", + "thiserror", + "zeroize", ] [[package]] @@ -10186,7 +10569,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -10220,7 +10603,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10233,23 +10616,23 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-instrument" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa1dafb3e60065305741e83db35c6c2584bb3725b692b5b66148a38d72ace6cd" +checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" dependencies = [ "parity-wasm", ] [[package]] name = "wasm-opt" -version = "0.112.0" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fef6d0d508f08334e0ab0e6877feb4c0ecb3956bcf2cb950699b22fedf3e9c" +checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" dependencies = [ "anyhow", "libc", - "strum", - "strum_macros", + "strum 0.24.1", + "strum_macros 0.24.3", "tempfile", "thiserror", "wasm-opt-cxx-sys", @@ -10258,9 +10641,9 @@ dependencies = [ [[package]] name = "wasm-opt-cxx-sys" -version = "0.112.0" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc816bbc1596c8f2e8127e137a760c798023ef3d378f2ae51f0f1840e2dfa445" +checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" dependencies = [ "anyhow", "cxx", @@ -10270,9 +10653,9 @@ dependencies = [ [[package]] name = "wasm-opt-sys" -version = "0.112.0" +version = "0.116.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40199e4f68ef1071b3c6d0bd8026a12b481865d4b9e49c156932ea9a6234dd14" +checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" dependencies = [ "anyhow", "cc", @@ -10510,24 +10893,14 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -10536,230 +10909,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.1", -] - -[[package]] -name = "webpki-roots" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" -dependencies = [ - "rustls-webpki 0.100.3", -] - -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "webrtc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3bc9049bdb2cea52f5fd4f6f728184225bdb867ed0dc2410eab6df5bdd67bb" -dependencies = [ - "arc-swap", - "async-trait", - "bytes 1.5.0", - "hex", - "interceptor", - "lazy_static", - "log", - "rand 0.8.5", - "rcgen 0.9.3", - "regex", - "ring", - "rtcp", - "rtp", - "rustls 0.19.1", - "sdp", - "serde", - "serde_json", - "sha2 0.10.7", - "stun", - "thiserror", - "time", - "tokio", - "turn", - "url", - "waitgroup", - "webrtc-data", - "webrtc-dtls", - "webrtc-ice", - "webrtc-mdns", - "webrtc-media", - "webrtc-sctp", - "webrtc-srtp", - "webrtc-util", -] - -[[package]] -name = "webrtc-data" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef36a4d12baa6e842582fe9ec16a57184ba35e1a09308307b67d43ec8883100" -dependencies = [ - "bytes 1.5.0", - "derive_builder", - "log", - "thiserror", - "tokio", - "webrtc-sctp", - "webrtc-util", -] - -[[package]] -name = "webrtc-dtls" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a00f4242f2db33307347bd5be53263c52a0331c96c14292118c9a6bb48d267" -dependencies = [ - "aes 0.6.0", - "aes-gcm 0.10.2", - "async-trait", - "bincode", - "block-modes", - "byteorder", - "ccm", - "curve25519-dalek 3.2.0", - "der-parser 8.2.0", - "elliptic-curve 0.12.3", - "hkdf", - "hmac 0.12.1", - "log", - "p256", - "p384", - "rand 0.8.5", - "rand_core 0.6.4", - "rcgen 0.10.0", - "ring", - "rustls 0.19.1", - "sec1 0.3.0", - "serde", - "sha1", - "sha2 0.10.7", - "signature 1.6.4", - "subtle", - "thiserror", - "tokio", - "webpki 0.21.4", - "webrtc-util", - "x25519-dalek 2.0.0", - "x509-parser 0.13.2", -] - -[[package]] -name = "webrtc-ice" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465a03cc11e9a7d7b4f9f99870558fe37a102b65b93f8045392fef7c67b39e80" -dependencies = [ - "arc-swap", - "async-trait", - "crc 3.0.1", - "log", - "rand 0.8.5", - "serde", - "serde_json", - "stun", - "thiserror", - "tokio", - "turn", - "url", - "uuid", - "waitgroup", - "webrtc-mdns", - "webrtc-util", -] - -[[package]] -name = "webrtc-mdns" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08dfd7a6e3987e255c4dbe710dde5d94d0f0574f8a21afa95d171376c143106" -dependencies = [ - "log", - "socket2 0.4.9", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-media" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f72e1650a8ae006017d1a5280efb49e2610c19ccc3c0905b03b648aee9554991" -dependencies = [ - "byteorder", - "bytes 1.5.0", - "rand 0.8.5", - "rtp", - "thiserror", -] - -[[package]] -name = "webrtc-sctp" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d47adcd9427eb3ede33d5a7f3424038f63c965491beafcc20bc650a2f6679c0" -dependencies = [ - "arc-swap", - "async-trait", - "bytes 1.5.0", - "crc 3.0.1", - "log", - "rand 0.8.5", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-srtp" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6183edc4c1c6c0175f8812eefdce84dfa0aea9c3ece71c2bf6ddd3c964de3da5" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "aes-gcm 0.9.4", - "async-trait", - "byteorder", - "bytes 1.5.0", - "ctr 0.8.0", - "hmac 0.11.0", - "log", - "rtcp", - "rtp", - "sha-1 0.9.8", - "subtle", - "thiserror", - "tokio", - "webrtc-util", -] - -[[package]] -name = "webrtc-util" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" -dependencies = [ - "async-trait", - "bitflags 1.3.2", - "bytes 1.5.0", - "cc", - "ipnet", - "lazy_static", - "libc", - "log", - "nix", - "rand 0.8.5", - "thiserror", - "tokio", - "winapi 0.3.9", + "webpki", ] [[package]] @@ -10873,6 +11023,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -10903,6 +11062,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -10915,6 +11089,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + [[package]] name = "windows_aarch64_msvc" version = "0.34.0" @@ -10933,6 +11113,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + [[package]] name = "windows_i686_gnu" version = "0.34.0" @@ -10951,6 +11137,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + [[package]] name = "windows_i686_msvc" version = "0.34.0" @@ -10969,6 +11161,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + [[package]] name = "windows_x86_64_gnu" version = "0.34.0" @@ -10987,6 +11185,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -10999,6 +11203,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + [[package]] name = "windows_x86_64_msvc" version = "0.34.0" @@ -11017,6 +11227,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + [[package]] name = "winnow" version = "0.5.15" @@ -11026,6 +11242,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -11091,44 +11316,25 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ - "curve25519-dalek 4.1.0", + "curve25519-dalek 4.1.2", "rand_core 0.6.4", "serde", "zeroize", ] -[[package]] -name = "x509-parser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9bace5b5589ffead1afb76e43e34cff39cd0f3ce7e170ae0c29e53b88eb1c" -dependencies = [ - "asn1-rs 0.3.1", - "base64 0.13.1", - "data-encoding", - "der-parser 7.0.0", - "lazy_static", - "nom", - "oid-registry 0.4.0", - "ring", - "rusticata-macros", - "thiserror", - "time", -] - [[package]] name = "x509-parser" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0ecbeb7b67ce215e40e3cc7f2ff902f94a223acf44995934763467e7b1febc8" dependencies = [ - "asn1-rs 0.5.2", + "asn1-rs", "base64 0.13.1", "data-encoding", - "der-parser 8.2.0", + "der-parser", "lazy_static", "nom", - "oid-registry 0.6.1", + "oid-registry", "rusticata-macros", "thiserror", "time", @@ -11157,6 +11363,26 @@ dependencies = [ "time", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "zeroize" version = "1.6.0" @@ -11174,7 +11400,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.52", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4d353b72..9e31aa55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ sc-cli = { version = "0.38.0" } sc-client-api = { version = "30.0.0" } sc-consensus = { version = "0.35.0" } sc-consensus-aura = { version = "0.36.0" } -sc-consensus-grandpa = { version = "0.13.0" } +sc-consensus-grandpa = { version = "0.21.0" } sc-executor = { version = "0.34.0" } sc-keystore = { version = "27.0.0" } sc-network = { version = "0.36.0" } @@ -109,7 +109,7 @@ sp-timestamp = { version = "28.0.0" } sp-transaction-pool = { version = "28.0.0", default-features = false } sp-version = { version = "31.0.0", default-features = false } substrate-frame-rpc-system = { version = "30.0.0" } -try-runtime-cli = { version = "0.39.0", default-features = false } + substrate-wasm-builder = "19.0.0" substrate-build-script-utils = "11.0.0" @@ -142,6 +142,8 @@ pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commit pallet-encointer-scheduler = { path = "../pallets/scheduler" } substrate-api-client = { path = "../../substrate-api-client" } substrate-client-keystore = { path = "../../substrate-api-client/client-keystore" } +ac-node-api = { path = "../../substrate-api-client/node-api" } +ac-primitives = { path = "../../substrate-api-client/primitives" } # [patch."https://github.com/encointer/substrate-fixed"] # substrate-fixed = { path = "../substrate-fixed" } diff --git a/node/Cargo.toml b/node/Cargo.toml index f6e2e51e..720e10a7 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -20,7 +20,7 @@ name = "encointer-node-notee" targets = ["x86_64-unknown-linux-gnu"] [build-dependencies] -substrate-build-script-utils = "3.0.0" +substrate-build-script-utils = { workspace = true } [dependencies] clap = { workspace = true } @@ -82,8 +82,6 @@ pallet-encointer-communities-rpc-runtime-api = { workspace = true, features = [" # CLI-specific dependencies frame-try-runtime = { workspace = true, optional = true } -try-runtime-cli = { workspace = true, optional = true } - [features] default = [] @@ -96,9 +94,5 @@ runtime-benchmarks = [ # in the near future. Todo: implement try runtime for encointer-pallets try-runtime = [ "encointer-node-notee-runtime/try-runtime", - "try-runtime-cli/try-runtime", ] -cli = [ - 'try-runtime-cli', -] diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 9f95edf6..2e780ac1 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -60,8 +60,6 @@ sp-transaction-pool = { workspace = true } sp-version = { workspace = true } frame-try-runtime = { workspace = true, optional = true } -try-runtime-cli = { workspace = true, optional = true } - # Used for the node's RPCs frame-system-rpc-runtime-api = { workspace = true } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index be534184..a703c00b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2023-05-22" -targets = ["wasm32-unknown-unknown"] +channel = "nightly-2023-11-01" profile = "default" # include rustfmt, clippy +targets = ["wasm32-unknown-unknown"] From 07a26f9c895836d4fa0ea79a550288a2a8e279a1 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 17:43:54 +0100 Subject: [PATCH 03/41] try to fix simd ahash --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cff00d14..72a46508 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,9 +169,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom 0.2.10", "once_cell", @@ -689,7 +689,7 @@ checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", "rand 0.8.5", - "rand_core 0.6.4", + "rand_core 0.5.1", "serde", "unicode-normalization", ] @@ -3269,7 +3269,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", ] [[package]] @@ -10333,7 +10333,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.7", "rand 0.8.5", "static_assertions", From 1bd040ed439c034d333b180b71769b64ac902267 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 18:01:21 +0100 Subject: [PATCH 04/41] bump nightly --- Cargo.lock | 911 ++++++++++++++++++++++---------------------- rust-toolchain.toml | 2 +- 2 files changed, 454 insertions(+), 459 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72a46508..187913ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ "aead 0.5.2", "aes 0.8.3", @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.10" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if 1.0.0", "getrandom 0.2.10", @@ -193,9 +193,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2135563fb5c609d2b2b87c1e8ce7bc41b0b45430fa9661f457981503dd5bf0" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -232,9 +232,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -246,9 +246,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "anstyle-parse" @@ -270,12 +270,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -300,11 +300,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21cc1548309245035eb18aa7f0967da6bc65587005170c56e6ef2788a4cf3f4e" dependencies = [ "include_dir", - "itertools", + "itertools 0.10.5", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -342,7 +342,7 @@ dependencies = [ "ark-std", "derivative", "hashbrown 0.13.2", - "itertools", + "itertools 0.10.5", "num-traits", "zeroize", ] @@ -359,7 +359,7 @@ dependencies = [ "ark-std", "derivative", "digest 0.10.7", - "itertools", + "itertools 0.10.5", "num-bigint", "num-traits", "paste", @@ -553,18 +553,18 @@ checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", "event-listener-strategy", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -573,11 +573,11 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -608,7 +608,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.32.1", + "object 0.32.2", "rustc-demangle", ] @@ -632,9 +632,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -672,13 +672,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.15", + "prettyplease 0.2.12", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -747,37 +747,37 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] name = "blake2s_simd" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] name = "blake3" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "199c42ab6972d92c9f8995f086273d25c42fc0f7b2a1fcefba465c1352d25ba5" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", "cfg-if 1.0.0", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -848,9 +848,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", @@ -867,9 +867,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -885,9 +885,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" [[package]] name = "byteorder" @@ -907,9 +907,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bzip2-sys" @@ -1167,7 +1167,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -1259,6 +1259,12 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "constant_time_eq" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" + [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1267,9 +1273,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "constcat" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" +checksum = "f272d0c4cf831b4fa80ee529c7707f76585986e910e1fbce1d7921970bc1a241" [[package]] name = "convert_case" @@ -1411,7 +1417,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser", @@ -1493,9 +1499,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1613,14 +1619,14 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "cxx" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe98ba1789d56fb3db3bee5e032774d4f421b685de7ba703643584ba24effbe" +checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" dependencies = [ "cc", "cxxbridge-flags", @@ -1630,9 +1636,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4ce20f6b8433da4841b1dadfb9468709868022d829d5ca1f2ffbda928455ea3" +checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" dependencies = [ "cc", "codespan-reporting", @@ -1640,24 +1646,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "cxxbridge-flags" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20888d9e1d2298e2ff473cee30efe7d5036e437857ab68bbfea84c74dba91da2" +checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" [[package]] name = "cxxbridge-macro" -version = "1.0.107" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fa16a70dd58129e4dfffdff535fb1bce66673f7bbeec4a5a1765a504e1ccd84" +checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -1697,9 +1703,9 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "5.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" dependencies = [ "cfg-if 1.0.0", "hashbrown 0.14.3", @@ -1885,7 +1891,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -1909,9 +1915,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.52", + "syn 2.0.50", "termcolor", - "toml 0.8.10", + "toml 0.8.8", "walkdir", ] @@ -1950,9 +1956,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" @@ -1980,9 +1986,9 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ "curve25519-dalek 4.1.2", "ed25519", @@ -2077,7 +2083,7 @@ dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -2296,9 +2302,9 @@ dependencies = [ name = "encointer-rpc" version = "7.0.0" dependencies = [ - "jsonrpsee 0.22.1", - "jsonrpsee-core 0.22.1", - "jsonrpsee-types 0.22.1", + "jsonrpsee 0.22.0", + "jsonrpsee-core 0.22.0", + "jsonrpsee-types 0.22.0", "thiserror", ] @@ -2329,9 +2335,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -2370,9 +2376,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", @@ -2403,7 +2409,7 @@ checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -2413,7 +2419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ "event-listener 4.0.3", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -2435,7 +2441,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2493,9 +2499,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "file-per-thread-logger" @@ -2503,7 +2509,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" dependencies = [ - "env_logger 0.10.0", + "env_logger 0.10.1", "log", ] @@ -2660,7 +2666,7 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "itertools", + "itertools 0.10.5", "lazy_static", "linked-hash-map", "log", @@ -2788,13 +2794,13 @@ dependencies = [ "derive-syn-parse", "expander", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2804,10 +2810,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2818,7 +2824,7 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2979,7 +2985,7 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "waker-fn", ] @@ -2991,7 +2997,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -3001,7 +3007,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.9", + "rustls 0.20.8", "webpki", ] @@ -3036,7 +3042,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "pin-utils", "slab", ] @@ -3173,22 +3179,22 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] name = "governor" -version = "0.6.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" dependencies = [ "cfg-if 1.0.0", "dashmap", @@ -3197,11 +3203,9 @@ dependencies = [ "no-std-compat", "nonzero_ext", "parking_lot 0.12.1", - "portable-atomic", "quanta", "rand 0.8.5", "smallvec", - "spinning_top", ] [[package]] @@ -3217,17 +3221,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "futures-core", "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", @@ -3236,9 +3240,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.4.0" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" dependencies = [ "log", "pest", @@ -3278,7 +3282,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", ] [[package]] @@ -3287,7 +3291,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "allocator-api2", ] @@ -3382,15 +3386,6 @@ dependencies = [ "hmac 0.8.1", ] -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys 0.48.0", -] - [[package]] name = "hostname" version = "0.3.1" @@ -3408,7 +3403,7 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "itoa", ] @@ -3419,9 +3414,9 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "http", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -3454,7 +3449,7 @@ version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-channel", "futures-core", "futures-util", @@ -3464,7 +3459,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "socket2 0.4.9", "tokio", "tower-service", @@ -3482,7 +3477,7 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.7", + "rustls 0.21.6", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -3628,9 +3623,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -3695,7 +3690,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.6", + "socket2 0.5.3", "widestring", "windows-sys 0.48.0", "winreg", @@ -3714,7 +3709,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.2", - "rustix 0.38.13", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -3727,6 +3722,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -3764,28 +3768,28 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16fcc9dd231e72d22993f1643d5f7f0db785737dbe3c3d7ca222916ab4280795" +checksum = "4a95f7cc23d5fab0cdeeaf6bad8c8f5e7a3aa7f0d211957ea78232b327ab27b0" dependencies = [ "jsonrpsee-client-transport", - "jsonrpsee-core 0.22.1", + "jsonrpsee-core 0.22.0", "jsonrpsee-proc-macros", - "jsonrpsee-server 0.22.1", - "jsonrpsee-types 0.22.1", + "jsonrpsee-server 0.22.0", + "jsonrpsee-types 0.22.0", "tokio", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0476c96eb741b40d39dcb39d0124e3b9be9840ec77653c42a0996563ae2a53f7" +checksum = "6b1736cfa3845fd9f8f43751f2b8e0e83f7b6081e754502f7d63b6587692cc83" dependencies = [ "futures-util", "http", - "jsonrpsee-core 0.22.1", + "jsonrpsee-core 0.22.0", "pin-project", "rustls-native-certs 0.7.0", "rustls-pki-types", @@ -3826,9 +3830,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b974d8f6139efbe8425f32cb33302aba6d5e049556b5bfc067874e7a0da54a2e" +checksum = "82030d038658974732103e623ba2e0abec03bbbe175b39c0a2fafbada60c5868" dependencies = [ "anyhow", "async-lock 3.3.0", @@ -3837,7 +3841,7 @@ dependencies = [ "futures-timer", "futures-util", "hyper", - "jsonrpsee-types 0.22.1", + "jsonrpsee-types 0.22.0", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", @@ -3852,12 +3856,12 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e79a7109506831bf0cbeaad08729cdf0e592300c00f626bccd6d479974221e" +checksum = "69fc56131589f82e57805f7338b87023db4aafef813555708b159787e34ad6bc" dependencies = [ "heck", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3887,15 +3891,15 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "344440ccd8492c1ca65f1391c5aa03f91189db38d602d189b9266a1a5c6a4d22" +checksum = "d85be77fe5b2a94589e3164fb780017f7aff7d646b49278c0d0346af16975c8e" dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core 0.22.1", - "jsonrpsee-types 0.22.1", + "jsonrpsee-core 0.22.0", + "jsonrpsee-types 0.22.0", "pin-project", "route-recognizer", "serde", @@ -3925,9 +3929,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13dac43c1a9fc2648b37f306b0a5b0e29b2a6e1c36a33b95c1948da2494e9c5" +checksum = "9a48fdc1202eafc51c63e00406575e59493284ace8b8b61aa16f3a6db5d64f1a" dependencies = [ "anyhow", "beef", @@ -4021,9 +4025,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" @@ -4037,9 +4041,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libp2p" @@ -4047,7 +4051,7 @@ version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", "getrandom 0.2.10", @@ -4188,7 +4192,7 @@ checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "either", "fnv", "futures", @@ -4249,7 +4253,7 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "curve25519-dalek 3.2.0", "futures", "libp2p-core", @@ -4289,7 +4293,7 @@ version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", "if-watch", @@ -4300,7 +4304,7 @@ dependencies = [ "parking_lot 0.12.1", "quinn-proto", "rand 0.8.5", - "rustls 0.20.9", + "rustls 0.20.8", "thiserror", "tokio", ] @@ -4381,7 +4385,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.16.20", - "rustls 0.20.9", + "rustls 0.20.8", "thiserror", "webpki", "x509-parser", @@ -4534,9 +4538,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" +checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" dependencies = [ "nalgebra", ] @@ -4555,9 +4559,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lioness" @@ -4634,6 +4638,15 @@ dependencies = [ "libc", ] +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "macro_magic" version = "0.5.0" @@ -4643,7 +4656,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4657,7 +4670,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4668,7 +4681,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4679,7 +4692,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4715,20 +4728,20 @@ dependencies = [ [[package]] name = "maybe-async" -version = "0.2.7" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" +checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.50", ] [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" @@ -4750,9 +4763,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" dependencies = [ "libc", ] @@ -4844,9 +4857,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -4978,11 +4991,11 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", @@ -5002,7 +5015,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "log", "pin-project", @@ -5101,7 +5114,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "log", "netlink-packet-core", @@ -5116,7 +5129,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "libc", "log", @@ -5221,9 +5234,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -5253,9 +5266,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -5289,9 +5302,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.4.0", "cfg-if 1.0.0", @@ -5310,7 +5323,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -5321,9 +5334,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" dependencies = [ "cc", "libc", @@ -5463,7 +5476,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-encointer-bazaar-rpc-runtime-api", "parity-scale-codec", @@ -5517,7 +5530,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-encointer-ceremonies-rpc-runtime-api", "parity-scale-codec", @@ -5565,7 +5578,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-encointer-communities-rpc-runtime-api", "parity-scale-codec", @@ -5827,7 +5840,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4fac4e459db3c002ddebfbce82d055dbe8885eb4c2f9dcd9da5675eafef9bb7" dependencies = [ - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -5889,9 +5902,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.13" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" +checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" dependencies = [ "blake2 0.10.6", "crc32fast", @@ -5905,7 +5918,6 @@ dependencies = [ "rand 0.8.5", "siphasher", "snap", - "winapi 0.3.9", ] [[package]] @@ -5917,7 +5929,7 @@ dependencies = [ "arrayvec 0.7.4", "bitvec", "byte-slice-cast", - "bytes 1.5.0", + "bytes 1.4.0", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -5929,7 +5941,7 @@ version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -6045,20 +6057,19 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ - "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -6066,22 +6077,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", @@ -6095,7 +6106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.2.3", ] [[package]] @@ -6115,7 +6126,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6126,9 +6137,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -6154,9 +6165,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.1.2" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polkavm-common" @@ -6182,7 +6193,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6192,7 +6203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ "polkavm-derive-impl", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6204,7 +6215,7 @@ dependencies = [ "gimli 0.28.0", "hashbrown 0.14.3", "log", - "object 0.32.1", + "object 0.32.2", "polkavm-common", "regalloc2 0.9.3", "rustc-demangle", @@ -6222,7 +6233,7 @@ dependencies = [ "concurrent-queue", "libc", "log", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "windows-sys 0.48.0", ] @@ -6261,12 +6272,6 @@ dependencies = [ "universal-hash 0.5.1", ] -[[package]] -name = "portable-atomic" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -6281,7 +6286,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -6315,12 +6320,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6338,21 +6343,21 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "thiserror", - "toml 0.5.11", + "once_cell", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.21.0", ] [[package]] @@ -6387,20 +6392,20 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro-warning" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" +checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" dependencies = [ "unicode-ident", ] @@ -6439,7 +6444,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6448,7 +6453,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "prost-derive 0.11.9", ] @@ -6458,7 +6463,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "prost-derive 0.12.3", ] @@ -6468,9 +6473,9 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "heck", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", @@ -6491,7 +6496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -6504,10 +6509,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", - "itertools", + "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6530,12 +6535,13 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" dependencies = [ "crossbeam-utils", "libc", + "mach2", "once_cell", "raw-cpuid", "wasi 0.11.0+wasi-snapshot-preview1", @@ -6565,7 +6571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "quick-protobuf", "thiserror", "unsigned-varint", @@ -6584,15 +6590,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31999cfc7927c4e212e60fd50934ab40e8e8bfd2d493d6095d2d306bc0764d9" +checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls 0.20.9", + "rustls 0.20.8", "slab", "thiserror", "tinyvec", @@ -6707,11 +6713,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "10.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" dependencies = [ - "bitflags 2.4.0", + "bitflags 1.3.2", ] [[package]] @@ -6772,6 +6778,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -6800,7 +6815,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6830,14 +6845,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -6851,13 +6866,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", ] [[package]] @@ -6868,9 +6883,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "resolv-conf" @@ -6909,17 +6924,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "cfg-if 1.0.0", "getrandom 0.2.10", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -7049,22 +7063,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.0", "errno", "libc", - "linux-raw-sys 0.4.7", + "linux-raw-sys 0.4.10", "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring 0.16.20", @@ -7074,13 +7088,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", "ring 0.16.20", - "rustls-webpki 0.101.5", + "rustls-webpki 0.101.4", "sct", ] @@ -7091,7 +7105,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", - "ring 0.17.8", + "ring 0.17.7", "rustls-pki-types", "rustls-webpki 0.102.2", "subtle 2.5.0", @@ -7117,7 +7131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.1", + "rustls-pemfile 2.0.0", "rustls-pki-types", "schannel", "security-framework", @@ -7129,30 +7143,30 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.4", + "base64 0.21.2", ] [[package]] name = "rustls-pemfile" -version = "2.1.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" dependencies = [ - "base64 0.21.4", + "base64 0.21.2", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.3.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" +checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" [[package]] name = "rustls-webpki" -version = "0.101.5" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ "ring 0.16.20", "untrusted 0.7.1", @@ -7164,7 +7178,7 @@ version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "rustls-pki-types", "untrusted 0.9.0", ] @@ -7279,7 +7293,7 @@ dependencies = [ "array-bytes 6.2.2", "docify", "log", - "memmap2 0.9.4", + "memmap2 0.9.3", "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", @@ -7303,10 +7317,10 @@ version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -7321,7 +7335,7 @@ dependencies = [ "clap 4.5.1", "fdlimit", "futures", - "itertools", + "itertools 0.10.5", "libp2p-identity", "log", "names", @@ -7468,7 +7482,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86ea4771511dfcabe0e0dd3a43368ba3f430b0aaf736463b14286cc10a6494e6" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "array-bytes 6.2.2", "async-trait", "dyn-clone", @@ -7627,7 +7641,7 @@ dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.4", "blake2 0.10.6", - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", "libp2p-identity", @@ -7658,7 +7672,7 @@ dependencies = [ "async-channel", "async-trait", "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "either", "fnv", "futures", @@ -7737,7 +7751,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6c4ffd60fe240d9b0963ec60752810660a201755a77b922aa5e8ef7256f6b5" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "futures", "futures-timer", "libp2p", @@ -7837,7 +7851,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d099f8d2f399be5b7d163e4236faaa47e7ce131f4021b9fe8e3e607e0ca51364" dependencies = [ "array-bytes 6.2.2", - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "futures", "futures-timer", @@ -7882,7 +7896,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61faa018966cb794e36be31af4ed4d19deaa93c751ff32512637c7bca104e9e8" dependencies = [ "futures", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -7914,7 +7928,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f716a273af4f4782430ebe4fe6d0f8b1490ff7c103dc78193706bfff370c250f" dependencies = [ - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -7939,7 +7953,7 @@ dependencies = [ "governor", "http", "hyper", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pin-project", "serde_json", @@ -7959,7 +7973,7 @@ dependencies = [ "futures", "futures-util", "hex", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -7992,7 +8006,7 @@ dependencies = [ "exit-future", "futures", "futures-timer", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -8136,10 +8150,10 @@ version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8236,7 +8250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" dependencies = [ "darling", - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -8264,7 +8278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ "darling", - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -8290,7 +8304,7 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -8327,7 +8341,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "cfg-if 1.0.0", "hashbrown 0.13.2", ] @@ -8405,18 +8419,18 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.9.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" dependencies = [ "cc", ] @@ -8497,9 +8511,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] @@ -8512,7 +8526,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8528,9 +8542,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -8617,9 +8631,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" @@ -8682,9 +8696,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snap" @@ -8721,12 +8735,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -8736,7 +8750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", - "bytes 1.5.0", + "bytes 1.4.0", "flate2", "futures", "http", @@ -8778,10 +8792,10 @@ dependencies = [ "Inflector", "blake2 0.10.6", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8928,7 +8942,7 @@ dependencies = [ "hash-db", "hash256-std-hasher", "impl-serde", - "itertools", + "itertools 0.10.5", "libsecp256k1", "log", "merlin 3.0.0", @@ -8978,7 +8992,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8999,7 +9013,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9047,7 +9061,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "ed25519-dalek", "libsecp256k1", "log", @@ -9189,7 +9203,7 @@ version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive", @@ -9211,10 +9225,10 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9276,7 +9290,7 @@ version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b95ede4523fc978585383465a406289235a71dd6febe7f79e1114794afae5cd0" dependencies = [ - "aes-gcm 0.10.2", + "aes-gcm 0.10.3", "curve25519-dalek 4.1.2", "ed25519-dalek", "hkdf", @@ -9375,7 +9389,7 @@ version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "hash-db", "lazy_static", "memory-db", @@ -9421,7 +9435,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9466,15 +9480,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinning_top" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" version = "0.7.2" @@ -9596,7 +9601,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9612,7 +9617,7 @@ dependencies = [ "frame-support", "futures-util", "hex", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "maybe-async", "parity-scale-codec", @@ -9683,7 +9688,7 @@ checksum = "74fba95234990a0eecb3199ee2589112a1a3763db1fa7739a316f3e26f7693c9" dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "sc-rpc-api", @@ -9744,7 +9749,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum 0.24.1", "tempfile", - "toml 0.8.10", + "toml 0.8.8", "walkdir", "wasm-opt", ] @@ -9774,9 +9779,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -9830,14 +9835,14 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if 1.0.0", "fastrand 2.0.0", - "redox_syscall 0.3.5", - "rustix 0.38.13", + "redox_syscall 0.4.1", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -9856,7 +9861,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.13", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -9877,22 +9882,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9932,9 +9937,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ "deranged", "itoa", @@ -9951,9 +9956,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" dependencies = [ "time-core", ] @@ -9984,32 +9989,32 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", - "bytes 1.5.0", + "bytes 1.4.0", "libc", - "mio 0.8.10", + "mio 0.8.8", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.3", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -10018,7 +10023,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls 0.21.6", "tokio", ] @@ -10040,7 +10045,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tokio", "tokio-util", ] @@ -10051,11 +10056,11 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tokio", "tracing", ] @@ -10071,14 +10076,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.6", + "toml_edit 0.21.0", ] [[package]] @@ -10092,26 +10097,26 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.2.3", "toml_datetime", - "winnow 0.5.15", + "winnow", ] [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -10123,7 +10128,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", "tracing", @@ -10131,18 +10136,18 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" dependencies = [ "bitflags 2.4.0", - "bytes 1.5.0", + "bytes 1.4.0", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", ] @@ -10167,7 +10172,7 @@ checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tracing-attributes", "tracing-core", ] @@ -10180,7 +10185,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -10341,9 +10346,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -10371,9 +10376,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -10418,12 +10423,12 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "futures-io", "futures-util", ] @@ -10442,9 +10447,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", "idna 0.4.0", @@ -10569,7 +10574,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", "wasm-bindgen-shared", ] @@ -10603,7 +10608,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10732,7 +10737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.4", + "base64 0.21.2", "bincode", "directories-next", "file-per-thread-logger", @@ -10895,12 +10900,12 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.1" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -10914,14 +10919,13 @@ dependencies = [ [[package]] name = "which" -version = "4.4.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", - "home", + "libc", "once_cell", - "rustix 0.38.13", ] [[package]] @@ -11029,7 +11033,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -11064,17 +11068,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -11091,9 +11095,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -11115,9 +11119,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -11139,9 +11143,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -11163,9 +11167,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -11187,9 +11191,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -11205,9 +11209,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -11229,9 +11233,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" @@ -11242,15 +11246,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" -dependencies = [ - "memchr", -] - [[package]] name = "winreg" version = "0.50.0" @@ -11380,7 +11375,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -11400,7 +11395,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a703c00b..ea20b5c1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2023-11-01" +channel = "nightly-2024-03-01" profile = "default" # include rustfmt, clippy targets = ["wasm32-unknown-unknown"] From 76965c63645a9eeec404114698c64a129058cf0a Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 18:26:37 +0100 Subject: [PATCH 05/41] same toolchains as sdk. cargo update. no luck --- Cargo.lock | 1823 ++++++++++++++++++++----------------------- rust-toolchain.toml | 2 +- 2 files changed, 834 insertions(+), 991 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 187913ee..18e7dc12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,7 +88,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.0", + "gimli 0.28.1", ] [[package]] @@ -97,15 +97,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "aead" version = "0.5.2" @@ -118,52 +109,26 @@ dependencies = [ [[package]] name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if 1.0.0", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug 0.3.0", -] - -[[package]] -name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if 1.0.0", "cipher 0.4.4", "cpufeatures", ] -[[package]] -name = "aes-gcm" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" -dependencies = [ - "aead 0.4.3", - "aes 0.7.5", - "cipher 0.3.0", - "ctr 0.7.0", - "ghash 0.4.4", - "subtle 2.5.0", -] - [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead 0.5.2", - "aes 0.8.3", + "aead", + "aes", "cipher 0.4.4", - "ctr 0.9.2", - "ghash 0.5.0", + "ctr", + "ghash", "subtle 2.5.0", ] @@ -173,19 +138,19 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.12", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.10", + "getrandom 0.2.12", "once_cell", "version_check", "zerocopy", @@ -232,9 +197,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -246,43 +211,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.2" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "approx" @@ -304,7 +269,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -518,31 +483,21 @@ dependencies = [ [[package]] name = "async-io" -version = "1.13.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" dependencies = [ - "async-lock 2.8.0", - "autocfg", + "async-lock", "cfg-if 1.0.0", "concurrent-queue", + "futures-io", "futures-lite", - "log", "parking", "polling", - "rustix 0.37.23", + "rustix 0.38.31", "slab", - "socket2 0.4.9", - "waker-fn", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -553,18 +508,18 @@ checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", "event-listener-strategy", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -573,11 +528,11 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] @@ -632,9 +587,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -672,13 +627,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.12", + "prettyplease 0.2.16", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -689,7 +644,7 @@ checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", "rand 0.8.5", - "rand_core 0.5.1", + "rand_core 0.6.4", "serde", "unicode-normalization", ] @@ -708,9 +663,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -747,24 +702,24 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq", ] [[package]] name = "blake2s_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq 0.2.6", + "constant_time_eq", ] [[package]] @@ -777,7 +732,7 @@ dependencies = [ "arrayvec 0.7.4", "cc", "cfg-if 1.0.0", - "constant_time_eq 0.3.0", + "constant_time_eq", ] [[package]] @@ -848,9 +803,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.8.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -867,9 +822,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "byte-slice-cast" @@ -885,15 +840,15 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -907,9 +862,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bzip2-sys" @@ -943,9 +898,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -958,7 +913,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.18", + "semver 1.0.22", "serde", "serde_json", "thiserror", @@ -966,11 +921,10 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ - "jobserver", "libc", ] @@ -985,9 +939,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" dependencies = [ "smallvec", ] @@ -1022,41 +976,40 @@ dependencies = [ [[package]] name = "chacha20" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if 1.0.0", - "cipher 0.3.0", + "cipher 0.4.4", "cpufeatures", - "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ - "aead 0.4.3", + "aead", "chacha20", - "cipher 0.3.0", + "cipher 0.4.4", "poly1305", "zeroize", ] [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.4", ] [[package]] @@ -1081,15 +1034,6 @@ dependencies = [ "generic-array 0.14.7", ] -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "cipher" version = "0.4.4" @@ -1098,13 +1042,14 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -1167,7 +1112,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1211,9 +1156,9 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -1233,38 +1178,30 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-random" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" +checksum = "5aaf16c9c2c612020bcfd042e170f6e32de9b9d75adb5277cdbbd2e2c8c8299a" dependencies = [ "const-random-macro", - "proc-macro-hack", ] [[package]] name = "const-random-macro" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.12", "once_cell", - "proc-macro-hack", "tiny-keccak", ] -[[package]] -name = "constant_time_eq" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" - [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1273,9 +1210,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "constcat" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f272d0c4cf831b4fa80ee529c7707f76585986e910e1fbce1d7921970bc1a241" +checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] name = "convert_case" @@ -1285,9 +1222,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1295,9 +1232,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core2" @@ -1319,9 +1256,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -1441,55 +1378,37 @@ checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if 1.0.0", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if 1.0.0", "crossbeam-utils", - "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -1499,9 +1418,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.2" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1550,15 +1469,6 @@ dependencies = [ "subtle 2.5.0", ] -[[package]] -name = "ctr" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" -dependencies = [ - "cipher 0.3.0", -] - [[package]] name = "ctr" version = "0.9.2" @@ -1613,20 +1523,20 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] name = "cxx" -version = "1.0.106" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" +checksum = "2673ca5ae28334544ec2a6b18ebe666c42a2650abfb48abbd532ed409a44be2b" dependencies = [ "cc", "cxxbridge-flags", @@ -1636,9 +1546,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.106" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" +checksum = "9df46fe0eb43066a332586114174c449a62c25689f85a08f28fdcc8e12c380b9" dependencies = [ "cc", "codespan-reporting", @@ -1646,24 +1556,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] name = "cxxbridge-flags" -version = "1.0.106" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" +checksum = "886acf875df67811c11cd015506b3392b9e1820b1627af1a6f4e93ccdfc74d11" [[package]] name = "cxxbridge-macro" -version = "1.0.106" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" +checksum = "1d151cc139c3080e07f448f93a1284577ab2283d2a44acd902c6fba9ec20b6de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1703,28 +1613,28 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.1" +version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", "hashbrown 0.14.3", "lock_api", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.9", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "data-encoding-macro" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" +checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1732,9 +1642,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" +checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" dependencies = [ "data-encoding", "syn 1.0.109", @@ -1766,9 +1676,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "derivative" @@ -1891,7 +1804,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1915,9 +1828,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.50", + "syn 2.0.52", "termcolor", - "toml 0.8.8", + "toml 0.8.10", "walkdir", ] @@ -1956,15 +1869,15 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -1976,9 +1889,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", "signature", @@ -1986,15 +1899,15 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek 4.1.2", "ed25519", "rand_core 0.6.4", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "subtle 2.5.0", "zeroize", ] @@ -2015,15 +1928,15 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", @@ -2083,7 +1996,7 @@ dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -2302,9 +2215,9 @@ dependencies = [ name = "encointer-rpc" version = "7.0.0" dependencies = [ - "jsonrpsee 0.22.0", - "jsonrpsee-core 0.22.0", - "jsonrpsee-types 0.22.0", + "jsonrpsee 0.22.1", + "jsonrpsee-core 0.22.1", + "jsonrpsee-types 0.22.1", "thiserror", ] @@ -2335,9 +2248,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -2376,23 +2289,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -2409,7 +2311,7 @@ checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] @@ -2419,7 +2321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ "event-listener 4.0.3", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] @@ -2441,7 +2343,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2464,18 +2366,9 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fdlimit" @@ -2499,9 +2392,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" [[package]] name = "file-per-thread-logger" @@ -2509,20 +2402,20 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" dependencies = [ - "env_logger 0.10.1", + "env_logger 0.10.2", "log", ] [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -2561,9 +2454,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "libz-sys", @@ -2611,9 +2504,9 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -2800,7 +2693,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2810,10 +2703,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2824,7 +2717,7 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2889,9 +2782,12 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] [[package]] name = "fs2" @@ -2976,17 +2872,12 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "1.13.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ - "fastrand 1.9.0", "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.12", - "waker-fn", + "pin-project-lite 0.2.13", ] [[package]] @@ -2997,7 +2888,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3007,7 +2898,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.8", + "rustls 0.20.9", "webpki", ] @@ -3025,9 +2916,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" @@ -3042,7 +2933,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "pin-utils", "slab", ] @@ -3111,9 +3002,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if 1.0.0", "libc", @@ -3130,24 +3021,14 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "ghash" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" -dependencies = [ - "opaque-debug 0.3.0", - "polyval 0.5.3", -] - [[package]] name = "ghash" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ - "opaque-debug 0.3.0", - "polyval 0.6.1", + "opaque-debug 0.3.1", + "polyval", ] [[package]] @@ -3163,9 +3044,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator 0.3.0", "stable_deref_trait", @@ -3186,15 +3067,15 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] [[package]] name = "governor" -version = "0.6.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" dependencies = [ "cfg-if 1.0.0", "dashmap", @@ -3203,9 +3084,11 @@ dependencies = [ "no-std-compat", "nonzero_ext", "parking_lot 0.12.1", + "portable-atomic", "quanta", "rand 0.8.5", "smallvec", + "spinning_top", ] [[package]] @@ -3225,13 +3108,13 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "fnv", "futures-core", "futures-sink", "futures-util", "http", - "indexmap 2.2.3", + "indexmap 2.2.5", "slab", "tokio", "tokio-util", @@ -3240,9 +3123,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.3.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -3282,7 +3165,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.10", ] [[package]] @@ -3291,7 +3174,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.10", "allocator-api2", ] @@ -3321,9 +3204,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -3339,9 +3222,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac 0.12.1", ] @@ -3386,6 +3269,15 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -3399,24 +3291,24 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "http", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", ] [[package]] @@ -3445,11 +3337,11 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures-channel", "futures-core", "futures-util", @@ -3459,8 +3351,8 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.12", - "socket2 0.4.9", + "pin-project-lite 0.2.13", + "socket2 0.5.6", "tokio", "tower-service", "tracing", @@ -3469,15 +3361,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", "hyper", "log", - "rustls 0.21.6", + "rustls 0.21.10", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -3485,16 +3377,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core 0.52.0", ] [[package]] @@ -3525,9 +3417,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3535,19 +3427,19 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.7.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" +checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" dependencies = [ "libc", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] name = "if-watch" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" +checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ "async-io", "core-foundation", @@ -3559,7 +3451,7 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows 0.34.0", + "windows", ] [[package]] @@ -3623,9 +3515,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -3664,7 +3556,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -3690,7 +3582,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.3", + "socket2 0.5.6", "widestring", "windows-sys 0.48.0", "winreg", @@ -3698,19 +3590,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.21", - "windows-sys 0.48.0", + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -3733,24 +3625,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "jobserver" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" -dependencies = [ - "libc", -] +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -3768,28 +3651,28 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a95f7cc23d5fab0cdeeaf6bad8c8f5e7a3aa7f0d211957ea78232b327ab27b0" +checksum = "16fcc9dd231e72d22993f1643d5f7f0db785737dbe3c3d7ca222916ab4280795" dependencies = [ "jsonrpsee-client-transport", - "jsonrpsee-core 0.22.0", + "jsonrpsee-core 0.22.1", "jsonrpsee-proc-macros", - "jsonrpsee-server 0.22.0", - "jsonrpsee-types 0.22.0", + "jsonrpsee-server 0.22.1", + "jsonrpsee-types 0.22.1", "tokio", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1736cfa3845fd9f8f43751f2b8e0e83f7b6081e754502f7d63b6587692cc83" +checksum = "0476c96eb741b40d39dcb39d0124e3b9be9840ec77653c42a0996563ae2a53f7" dependencies = [ "futures-util", "http", - "jsonrpsee-core 0.22.0", + "jsonrpsee-core 0.22.1", "pin-project", "rustls-native-certs 0.7.0", "rustls-pki-types", @@ -3830,18 +3713,18 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82030d038658974732103e623ba2e0abec03bbbe175b39c0a2fafbada60c5868" +checksum = "b974d8f6139efbe8425f32cb33302aba6d5e049556b5bfc067874e7a0da54a2e" dependencies = [ "anyhow", - "async-lock 3.3.0", + "async-lock", "async-trait", "beef", "futures-timer", "futures-util", "hyper", - "jsonrpsee-types 0.22.0", + "jsonrpsee-types 0.22.1", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", @@ -3856,12 +3739,12 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fc56131589f82e57805f7338b87023db4aafef813555708b159787e34ad6bc" +checksum = "68e79a7109506831bf0cbeaad08729cdf0e592300c00f626bccd6d479974221e" dependencies = [ "heck", - "proc-macro-crate 3.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3891,15 +3774,15 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85be77fe5b2a94589e3164fb780017f7aff7d646b49278c0d0346af16975c8e" +checksum = "344440ccd8492c1ca65f1391c5aa03f91189db38d602d189b9266a1a5c6a4d22" dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core 0.22.0", - "jsonrpsee-types 0.22.0", + "jsonrpsee-core 0.22.1", + "jsonrpsee-types 0.22.1", "pin-project", "route-recognizer", "serde", @@ -3929,9 +3812,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a48fdc1202eafc51c63e00406575e59493284ace8b8b61aa16f3a6db5d64f1a" +checksum = "b13dac43c1a9fc2648b37f306b0a5b0e29b2a6e1c36a33b95c1948da2494e9c5" dependencies = [ "anyhow", "beef", @@ -3942,22 +3825,22 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if 1.0.0", "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -4025,25 +3908,25 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] name = "libp2p" @@ -4051,10 +3934,10 @@ version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures", "futures-timer", - "getrandom 0.2.10", + "getrandom 0.2.12", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -4179,7 +4062,7 @@ dependencies = [ "multihash", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "zeroize", ] @@ -4192,7 +4075,7 @@ checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", - "bytes 1.4.0", + "bytes 1.5.0", "either", "fnv", "futures", @@ -4204,7 +4087,7 @@ dependencies = [ "log", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "smallvec", "thiserror", "uint", @@ -4227,7 +4110,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "trust-dns-proto", "void", @@ -4253,7 +4136,7 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "curve25519-dalek 3.2.0", "futures", "libp2p-core", @@ -4262,7 +4145,7 @@ dependencies = [ "once_cell", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.7", + "sha2 0.10.8", "snow", "static_assertions", "thiserror", @@ -4293,7 +4176,7 @@ version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures", "futures-timer", "if-watch", @@ -4304,7 +4187,7 @@ dependencies = [ "parking_lot 0.12.1", "quinn-proto", "rand 0.8.5", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", "tokio", ] @@ -4369,7 +4252,7 @@ dependencies = [ "libc", "libp2p-core", "log", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", ] @@ -4385,7 +4268,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.16.20", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", "webpki", "x509-parser", @@ -4438,6 +4321,17 @@ dependencies = [ "yamux", ] +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -4503,9 +4397,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" dependencies = [ "cc", "pkg-config", @@ -4538,9 +4432,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" +checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" dependencies = [ "nalgebra", ] @@ -4553,15 +4447,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lioness" @@ -4577,9 +4465,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -4587,9 +4475,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" @@ -4638,15 +4526,6 @@ dependencies = [ "libc", ] -[[package]] -name = "mach2" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" -dependencies = [ - "libc", -] - [[package]] name = "macro_magic" version = "0.5.0" @@ -4656,7 +4535,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -4670,7 +4549,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -4681,7 +4560,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -4692,7 +4571,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -4718,9 +4597,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" dependencies = [ "autocfg", "rawpointer", @@ -4734,22 +4613,22 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memfd" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix 0.37.23", + "rustix 0.38.31", ] [[package]] @@ -4763,9 +4642,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ "libc", ] @@ -4779,15 +4658,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" @@ -4829,9 +4699,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -4857,9 +4727,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -4984,18 +4854,18 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "unsigned-varint", ] [[package]] name = "multihash-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro-error", "proc-macro2", "quote", @@ -5015,7 +4885,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures", "log", "pin-project", @@ -5025,9 +4895,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.3" +version = "0.32.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" +checksum = "4541eb06dce09c0241ebbaab7102f0a01a0c8994afed2e5d0d66775016e25ac2" dependencies = [ "approx", "matrixmultiply", @@ -5114,7 +4984,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures", "log", "netlink-packet-core", @@ -5129,7 +4999,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures", "libc", "log", @@ -5194,13 +5064,19 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-format" version = "0.4.4" @@ -5213,11 +5089,10 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] @@ -5234,9 +5109,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -5248,7 +5123,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", ] @@ -5296,9 +5171,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" @@ -5306,7 +5181,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if 1.0.0", "foreign-types", "libc", @@ -5323,7 +5198,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -5476,7 +5351,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "pallet-encointer-bazaar-rpc-runtime-api", "parity-scale-codec", @@ -5530,7 +5405,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "pallet-encointer-ceremonies-rpc-runtime-api", "parity-scale-codec", @@ -5578,7 +5453,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "pallet-encointer-communities-rpc-runtime-api", "parity-scale-codec", @@ -5840,7 +5715,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4fac4e459db3c002ddebfbce82d055dbe8885eb4c2f9dcd9da5675eafef9bb7" dependencies = [ - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -5902,9 +5777,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" +checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" dependencies = [ "blake2 0.10.6", "crc32fast", @@ -5918,18 +5793,19 @@ dependencies = [ "rand 0.8.5", "siphasher", "snap", + "winapi 0.3.9", ] [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec 0.7.4", "bitvec", "byte-slice-cast", - "bytes 1.4.0", + "bytes 1.5.0", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -5937,11 +5813,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 2.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -5961,9 +5837,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -5983,7 +5859,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.9", ] [[package]] @@ -6002,13 +5878,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", "windows-targets 0.48.5", ] @@ -6051,25 +5927,26 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.2" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" +checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" dependencies = [ + "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.2" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" +checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" dependencies = [ "pest", "pest_generator", @@ -6077,26 +5954,26 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.2" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" +checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] name = "pest_meta" -version = "2.7.2" +version = "2.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" +checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" dependencies = [ "once_cell", "pest", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] @@ -6106,27 +5983,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.3", + "indexmap 2.2.5", ] [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -6137,9 +6014,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -6159,15 +6036,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platforms" -version = "3.0.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "polkavm-common" @@ -6193,7 +6070,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -6203,7 +6080,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ "polkavm-derive-impl", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -6212,7 +6089,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdec1451cb18261d5d01de82acc15305e417fb59588cdcb3127d3dcc9672b925" dependencies = [ - "gimli 0.28.0", + "gimli 0.28.1", "hashbrown 0.14.3", "log", "object 0.32.2", @@ -6223,54 +6100,52 @@ dependencies = [ [[package]] name = "polling" -version = "2.8.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" dependencies = [ - "autocfg", - "bitflags 1.3.2", "cfg-if 1.0.0", "concurrent-queue", - "libc", - "log", - "pin-project-lite 0.2.12", - "windows-sys 0.48.0", + "pin-project-lite 0.2.13", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", ] [[package]] name = "poly1305" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.4.0", + "opaque-debug 0.3.1", + "universal-hash", ] [[package]] name = "polyval" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.4.0", + "opaque-debug 0.3.1", + "universal-hash", ] [[package]] -name = "polyval" -version = "0.6.1" +name = "portable-atomic" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "opaque-debug 0.3.0", - "universal-hash 0.5.1", -] +checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" @@ -6320,19 +6195,19 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -6343,21 +6218,30 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "thiserror", + "toml 0.5.11", ] [[package]] name = "proc-macro-crate" -version = "3.0.0" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.0", + "toml_edit 0.21.1", ] [[package]] @@ -6384,28 +6268,22 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro-warning" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" +checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] name = "proc-macro2" -version = "1.0.75" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -6444,7 +6322,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -6453,7 +6331,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "prost-derive 0.11.9", ] @@ -6463,7 +6341,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "prost-derive 0.12.3", ] @@ -6473,7 +6351,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "heck", "itertools 0.10.5", "lazy_static", @@ -6512,7 +6390,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -6535,13 +6413,12 @@ dependencies = [ [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" dependencies = [ "crossbeam-utils", "libc", - "mach2", "once_cell", "raw-cpuid", "wasi 0.11.0+wasi-snapshot-preview1", @@ -6571,7 +6448,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" dependencies = [ "asynchronous-codec", - "bytes 1.4.0", + "bytes 1.5.0", "quick-protobuf", "thiserror", "unsigned-varint", @@ -6590,15 +6467,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" +checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls 0.20.8", + "rustls 0.20.9", "slab", "thiserror", "tinyvec", @@ -6680,7 +6557,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom 0.2.12", ] [[package]] @@ -6713,11 +6590,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", ] [[package]] @@ -6728,9 +6605,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.7.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -6738,14 +6615,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -6769,15 +6644,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -6789,33 +6655,33 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ - "getrandom 0.2.10", - "redox_syscall 0.2.16", + "getrandom 0.2.12", + "libredox", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" +checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" +checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -6845,13 +6711,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -6866,9 +6732,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -6924,16 +6790,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "getrandom 0.2.10", + "cfg-if 1.0.0", + "getrandom 0.2.12", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -6954,13 +6821,13 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rpassword" -version = "7.2.0" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", "rtoolbox", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] @@ -6980,12 +6847,12 @@ dependencies = [ [[package]] name = "rtoolbox" -version = "0.0.1" +version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" +checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" dependencies = [ "libc", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] @@ -7021,7 +6888,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver 1.0.22", ] [[package]] @@ -7035,9 +6902,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.15" +version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ "bitflags 1.3.2", "errno", @@ -7049,36 +6916,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.21" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.10", - "windows-sys 0.48.0", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring 0.16.20", @@ -7088,13 +6941,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.16.20", - "rustls-webpki 0.101.4", + "ring 0.17.8", + "rustls-webpki 0.101.7", "sct", ] @@ -7105,7 +6958,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", - "ring 0.17.7", + "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.2", "subtle 2.5.0", @@ -7119,7 +6972,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] @@ -7131,7 +6984,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.0.0", + "rustls-pemfile 2.1.1", "rustls-pki-types", "schannel", "security-framework", @@ -7139,37 +6992,37 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.2", + "base64 0.21.7", ] [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" dependencies = [ - "base64 0.21.2", + "base64 0.21.7", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -7178,7 +7031,7 @@ version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "rustls-pki-types", "untrusted 0.9.0", ] @@ -7202,9 +7055,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "safe-mix" @@ -7293,7 +7146,7 @@ dependencies = [ "array-bytes 6.2.2", "docify", "log", - "memmap2 0.9.3", + "memmap2 0.9.4", "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", @@ -7317,10 +7170,10 @@ version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" dependencies = [ - "proc-macro-crate 3.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -7482,7 +7335,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86ea4771511dfcabe0e0dd3a43368ba3f430b0aaf736463b14286cc10a6494e6" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.10", "array-bytes 6.2.2", "async-trait", "dyn-clone", @@ -7591,7 +7444,7 @@ dependencies = [ "libc", "log", "parking_lot 0.12.1", - "rustix 0.36.15", + "rustix 0.36.17", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -7641,7 +7494,7 @@ dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.4", "blake2 0.10.6", - "bytes 1.4.0", + "bytes 1.5.0", "futures", "futures-timer", "libp2p-identity", @@ -7672,7 +7525,7 @@ dependencies = [ "async-channel", "async-trait", "asynchronous-codec", - "bytes 1.4.0", + "bytes 1.5.0", "either", "fnv", "futures", @@ -7751,7 +7604,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6c4ffd60fe240d9b0963ec60752810660a201755a77b922aa5e8ef7256f6b5" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.10", "futures", "futures-timer", "libp2p", @@ -7851,7 +7704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d099f8d2f399be5b7d163e4236faaa47e7ce131f4021b9fe8e3e607e0ca51364" dependencies = [ "array-bytes 6.2.2", - "bytes 1.4.0", + "bytes 1.5.0", "fnv", "futures", "futures-timer", @@ -7896,7 +7749,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61faa018966cb794e36be31af4ed4d19deaa93c751ff32512637c7bca104e9e8" dependencies = [ "futures", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -7928,7 +7781,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f716a273af4f4782430ebe4fe6d0f8b1490ff7c103dc78193706bfff370c250f" dependencies = [ - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -7953,7 +7806,7 @@ dependencies = [ "governor", "http", "hyper", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "pin-project", "serde_json", @@ -7973,7 +7826,7 @@ dependencies = [ "futures", "futures-util", "hex", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -8006,7 +7859,7 @@ dependencies = [ "exit-future", "futures", "futures-timer", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -8150,10 +8003,10 @@ version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" dependencies = [ - "proc-macro-crate 3.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -8250,7 +8103,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" dependencies = [ "darling", - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -8278,7 +8131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ "darling", - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -8304,7 +8157,7 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro2", "quote", "syn 1.0.109", @@ -8328,11 +8181,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -8341,7 +8194,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.10", "cfg-if 1.0.0", "hashbrown 0.13.2", ] @@ -8368,7 +8221,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ - "aead 0.5.2", + "aead", "arrayref", "arrayvec 0.7.4", "curve25519-dalek 4.1.2", @@ -8376,7 +8229,7 @@ dependencies = [ "merlin 3.0.0", "rand_core 0.6.4", "serde_bytes", - "sha2 0.10.7", + "sha2 0.10.8", "subtle 2.5.0", "zeroize", ] @@ -8395,12 +8248,12 @@ checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -8419,18 +8272,18 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.0" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" dependencies = [ "cc", ] @@ -8487,9 +8340,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] @@ -8511,9 +8364,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] @@ -8526,7 +8379,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -8542,9 +8395,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -8571,7 +8424,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] @@ -8596,14 +8449,14 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug 0.3.1", ] [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -8622,9 +8475,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -8646,9 +8499,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core 0.6.4", @@ -8696,38 +8549,38 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "snap" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" +checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "snow" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" +checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" dependencies = [ - "aes-gcm 0.9.2", + "aes-gcm", "blake2 0.10.6", "chacha20poly1305", "curve25519-dalek 4.1.2", "rand_core 0.6.4", - "ring 0.16.20", + "ring 0.17.8", "rustc_version 0.4.0", - "sha2 0.10.7", + "sha2 0.10.8", "subtle 2.5.0", ] [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi 0.3.9", @@ -8735,12 +8588,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -8750,7 +8603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", - "bytes 1.4.0", + "bytes 1.5.0", "flate2", "futures", "http", @@ -8792,10 +8645,10 @@ dependencies = [ "Inflector", "blake2 0.10.6", "expander", - "proc-macro-crate 3.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -8979,7 +8832,7 @@ dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "twox-hash", ] @@ -8992,7 +8845,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -9013,7 +8866,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -9061,7 +8914,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "ed25519-dalek", "libsecp256k1", "log", @@ -9203,7 +9056,7 @@ version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive", @@ -9225,10 +9078,10 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -9290,14 +9143,14 @@ version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b95ede4523fc978585383465a406289235a71dd6febe7f79e1114794afae5cd0" dependencies = [ - "aes-gcm 0.10.3", + "aes-gcm", "curve25519-dalek 4.1.2", "ed25519-dalek", "hkdf", "parity-scale-codec", "rand 0.8.5", "scale-info", - "sha2 0.10.7", + "sha2 0.10.8", "sp-api", "sp-application-crypto", "sp-core", @@ -9307,7 +9160,7 @@ dependencies = [ "sp-runtime-interface", "sp-std", "thiserror", - "x25519-dalek 2.0.0", + "x25519-dalek 2.0.1", ] [[package]] @@ -9389,7 +9242,7 @@ version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.10", "hash-db", "lazy_static", "memory-db", @@ -9435,7 +9288,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -9480,11 +9333,20 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "spinning_top" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" +dependencies = [ + "lock_api", +] + [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -9492,9 +9354,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.43.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" +checksum = "b1114ee5900b8569bbc8b1a014a942f937b752af4b44f4607430b5f86cedaac0" dependencies = [ "Inflector", "num-format", @@ -9601,7 +9463,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -9617,7 +9479,7 @@ dependencies = [ "frame-support", "futures-util", "hex", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "maybe-async", "parity-scale-codec", @@ -9688,7 +9550,7 @@ checksum = "74fba95234990a0eecb3199ee2589112a1a3763db1fa7739a316f3e26f7693c9" dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee 0.22.0", + "jsonrpsee 0.22.1", "log", "parity-scale-codec", "sc-rpc-api", @@ -9749,7 +9611,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum 0.24.1", "tempfile", - "toml 0.8.8", + "toml 0.8.10", "walkdir", "wasm-opt", ] @@ -9779,9 +9641,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -9829,28 +9691,27 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if 1.0.0", - "fastrand 2.0.0", - "redox_syscall 0.4.1", - "rustix 0.38.21", - "windows-sys 0.48.0", + "fastrand", + "rustix 0.38.31", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -9861,7 +9722,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.21", + "rustix 0.38.31", "windows-sys 0.48.0", ] @@ -9882,22 +9743,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -9908,9 +9769,9 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -9937,12 +9798,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.27" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -9950,16 +9813,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.13" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -9989,32 +9853,32 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", - "bytes 1.4.0", + "bytes 1.5.0", "libc", - "mio 0.8.8", + "mio 0.8.10", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.6", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -10023,7 +9887,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.6", + "rustls 0.21.10", "tokio", ] @@ -10045,22 +9909,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ - "bytes 1.4.0", + "bytes 1.5.0", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tokio", "tracing", ] @@ -10076,14 +9940,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.22.6", ] [[package]] @@ -10097,26 +9961,37 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.5", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.5", ] [[package]] @@ -10128,7 +10003,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", "tracing", @@ -10136,18 +10011,18 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" +checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.4.0", - "bytes 1.4.0", + "bitflags 2.4.2", + "bytes 1.5.0", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tower-layer", "tower-service", ] @@ -10166,26 +10041,25 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.12", + "pin-project-lite 0.2.13", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -10210,12 +10084,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -10292,7 +10166,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", - "socket2 0.4.9", + "socket2 0.4.10", "thiserror", "tinyvec", "tokio", @@ -10322,9 +10196,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tt-call" @@ -10338,7 +10212,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.7", "rand 0.8.5", "static_assertions", @@ -10346,9 +10220,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -10370,15 +10244,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -10391,9 +10265,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -10401,16 +10275,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "universal-hash" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" -dependencies = [ - "generic-array 0.14.7", - "subtle 2.5.0", -] - [[package]] name = "universal-hash" version = "0.5.1" @@ -10423,12 +10287,12 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" +checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" dependencies = [ "asynchronous-codec", - "bytes 1.4.0", + "bytes 1.5.0", "futures-io", "futures-util", ] @@ -10447,12 +10311,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", ] @@ -10510,18 +10374,12 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", - "sha2 0.10.7", + "sha2 0.10.8", "sha3", "thiserror", "zeroize", ] -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "walkdir" version = "2.4.0" @@ -10555,9 +10413,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -10565,24 +10423,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -10592,9 +10450,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10602,22 +10460,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-instrument" @@ -10737,14 +10595,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.2", + "base64 0.21.7", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.15", + "rustix 0.36.17", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "toml 0.5.11", "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", @@ -10838,7 +10696,7 @@ checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ "object 0.30.4", "once_cell", - "rustix 0.36.15", + "rustix 0.36.17", ] [[package]] @@ -10866,10 +10724,10 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand 0.8.5", - "rustix 0.36.15", + "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -10890,9 +10748,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -10904,7 +10762,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -10919,20 +10777,21 @@ dependencies = [ [[package]] name = "which" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "libc", + "home", "once_cell", + "rustix 0.38.31", ] [[package]] name = "wide" -version = "0.7.11" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" +checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" dependencies = [ "bytemuck", "safe_arch", @@ -10974,9 +10833,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi 0.3.9", ] @@ -10989,26 +10848,32 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.34.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows_aarch64_msvc 0.34.0", - "windows_i686_gnu 0.34.0", - "windows_i686_msvc 0.34.0", - "windows_x86_64_gnu 0.34.0", - "windows_x86_64_msvc 0.34.0", + "windows-core 0.51.1", + "windows-targets 0.48.5", ] [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.4", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -11033,7 +10898,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -11068,17 +10933,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -11095,15 +10960,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.34.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -11119,15 +10978,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.34.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -11143,15 +10996,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" - -[[package]] -name = "windows_i686_msvc" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -11167,15 +11014,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.34.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -11191,9 +11032,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -11209,15 +11050,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.34.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -11233,15 +11068,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] [[package]] name = "winnow" -version = "0.5.15" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -11307,9 +11151,9 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ "curve25519-dalek 4.1.2", "rand_core 0.6.4", @@ -11375,14 +11219,14 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -11395,7 +11239,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -11438,11 +11282,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ea20b5c1..92636b7c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-03-01" +channel = "nightly-2024-01-22" profile = "default" # include rustfmt, clippy targets = ["wasm32-unknown-unknown"] From 7a8b7dea3f12a4a95eb0715b1e7c0edb31e03df1 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 18:27:27 +0100 Subject: [PATCH 06/41] taplo fmt --- Cargo.toml | 4 ++-- node/Cargo.toml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9e31aa55..bff0e648 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,6 +121,8 @@ substrate-client-keystore = "0.10.0" #only while debugging [patch.crates-io] +ac-node-api = { path = "../../substrate-api-client/node-api" } +ac-primitives = { path = "../../substrate-api-client/primitives" } 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" } @@ -142,8 +144,6 @@ pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commit pallet-encointer-scheduler = { path = "../pallets/scheduler" } substrate-api-client = { path = "../../substrate-api-client" } substrate-client-keystore = { path = "../../substrate-api-client/client-keystore" } -ac-node-api = { path = "../../substrate-api-client/node-api" } -ac-primitives = { path = "../../substrate-api-client/primitives" } # [patch."https://github.com/encointer/substrate-fixed"] # substrate-fixed = { path = "../substrate-fixed" } diff --git a/node/Cargo.toml b/node/Cargo.toml index 720e10a7..dd8cdf53 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -95,4 +95,3 @@ runtime-benchmarks = [ try-runtime = [ "encointer-node-notee-runtime/try-runtime", ] - From 4c554b6111486befbe30a6c2fcadd6d06e9d0c46 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 19:01:39 +0100 Subject: [PATCH 07/41] disable toolchain-pin and re-applysdk lockfile --- Cargo.lock | 1819 +++++++++-------- ...lchain.toml => rust-toolchain.toml.disable | 2 +- 2 files changed, 989 insertions(+), 832 deletions(-) rename rust-toolchain.toml => rust-toolchain.toml.disable (75%) diff --git a/Cargo.lock b/Cargo.lock index 18e7dc12..ff6d4955 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,7 +88,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.1", + "gimli 0.28.0", ] [[package]] @@ -97,6 +97,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "aead" version = "0.5.2" @@ -109,26 +118,52 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug 0.3.0", +] + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if 1.0.0", "cipher 0.4.4", "cpufeatures", ] +[[package]] +name = "aes-gcm" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" +dependencies = [ + "aead 0.4.3", + "aes 0.7.5", + "cipher 0.3.0", + "ctr 0.7.0", + "ghash 0.4.4", + "subtle 2.5.0", +] + [[package]] name = "aes-gcm" version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" dependencies = [ - "aead", - "aes", + "aead 0.5.2", + "aes 0.8.3", "cipher 0.4.4", - "ctr", - "ghash", + "ctr 0.9.2", + "ghash 0.5.0", "subtle 2.5.0", ] @@ -138,19 +173,19 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.10", "once_cell", "version_check", ] [[package]] name = "ahash" -version = "0.8.10" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if 1.0.0", - "getrandom 0.2.12", + "getrandom 0.2.10", "once_cell", "version_check", "zerocopy", @@ -197,9 +232,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -211,43 +246,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "approx" @@ -269,7 +304,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -483,21 +518,31 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", + "autocfg", "cfg-if 1.0.0", "concurrent-queue", - "futures-io", "futures-lite", + "log", "parking", "polling", - "rustix 0.38.31", + "rustix 0.37.23", "slab", - "tracing", - "windows-sys 0.52.0", + "socket2 0.4.9", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", ] [[package]] @@ -508,18 +553,18 @@ checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", "event-listener-strategy", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -528,11 +573,11 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -587,9 +632,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.7" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -627,13 +672,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.16", + "prettyplease 0.2.12", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -663,9 +708,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bitvec" @@ -702,24 +747,24 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] name = "blake2s_simd" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +checksum = "6637f448b9e61dfadbdcbae9a885fadee1f3eaffb1f8d3c1965d3ade8bdfd44f" dependencies = [ "arrayref", "arrayvec 0.7.4", - "constant_time_eq", + "constant_time_eq 0.2.6", ] [[package]] @@ -732,7 +777,7 @@ dependencies = [ "arrayvec 0.7.4", "cc", "cfg-if 1.0.0", - "constant_time_eq", + "constant_time_eq 0.3.0", ] [[package]] @@ -803,9 +848,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "serde", @@ -822,9 +867,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -840,15 +885,15 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.14.3" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" [[package]] name = "byteorder" -version = "1.5.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" @@ -862,9 +907,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bzip2-sys" @@ -898,9 +943,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" dependencies = [ "serde", ] @@ -913,7 +958,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.18", "serde", "serde_json", "thiserror", @@ -921,10 +966,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.88" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] @@ -939,9 +985,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.7" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" dependencies = [ "smallvec", ] @@ -976,40 +1022,41 @@ dependencies = [ [[package]] name = "chacha20" -version = "0.9.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ "cfg-if 1.0.0", - "cipher 0.4.4", + "cipher 0.3.0", "cpufeatures", + "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.10.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" dependencies = [ - "aead", + "aead 0.4.3", "chacha20", - "cipher 0.4.4", + "cipher 0.3.0", "poly1305", "zeroize", ] [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.48.5", ] [[package]] @@ -1034,6 +1081,15 @@ dependencies = [ "generic-array 0.14.7", ] +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "cipher" version = "0.4.4" @@ -1042,14 +1098,13 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", - "zeroize", ] [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" dependencies = [ "glob", "libc", @@ -1112,7 +1167,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -1156,9 +1211,9 @@ checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" dependencies = [ "crossbeam-utils", ] @@ -1178,30 +1233,38 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.6" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "const-random" -version = "0.1.17" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaf16c9c2c612020bcfd042e170f6e32de9b9d75adb5277cdbbd2e2c8c8299a" +checksum = "368a7a772ead6ce7e1de82bfb04c485f3db8ec744f72925af5735e29a22cc18e" dependencies = [ "const-random-macro", + "proc-macro-hack", ] [[package]] name = "const-random-macro" -version = "0.1.16" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +checksum = "9d7d6ab3c3a2282db210df5f02c4dab6e0a7057af0fb7ebd4070f30fe05c0ddb" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.10", "once_cell", + "proc-macro-hack", "tiny-keccak", ] +[[package]] +name = "constant_time_eq" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" + [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1210,9 +1273,9 @@ checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "constcat" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" +checksum = "f272d0c4cf831b4fa80ee529c7707f76585986e910e1fbce1d7921970bc1a241" [[package]] name = "convert_case" @@ -1222,9 +1285,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -1232,9 +1295,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "core2" @@ -1256,9 +1319,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -1378,37 +1441,55 @@ checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403" [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ "cfg-if 1.0.0", + "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ + "cfg-if 1.0.0", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ + "autocfg", + "cfg-if 1.0.0", "crossbeam-utils", + "memoffset 0.9.0", + "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] [[package]] name = "crunchy" @@ -1418,9 +1499,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.5" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", @@ -1469,6 +1550,15 @@ dependencies = [ "subtle 2.5.0", ] +[[package]] +name = "ctr" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" +dependencies = [ + "cipher 0.3.0", +] + [[package]] name = "ctr" version = "0.9.2" @@ -1523,20 +1613,20 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "cxx" -version = "1.0.118" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2673ca5ae28334544ec2a6b18ebe666c42a2650abfb48abbd532ed409a44be2b" +checksum = "28403c86fc49e3401fdf45499ba37fad6493d9329449d6449d7f0e10f4654d28" dependencies = [ "cc", "cxxbridge-flags", @@ -1546,9 +1636,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.118" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df46fe0eb43066a332586114174c449a62c25689f85a08f28fdcc8e12c380b9" +checksum = "78da94fef01786dc3e0c76eafcd187abcaa9972c78e05ff4041e24fdf059c285" dependencies = [ "cc", "codespan-reporting", @@ -1556,24 +1646,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "cxxbridge-flags" -version = "1.0.118" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886acf875df67811c11cd015506b3392b9e1820b1627af1a6f4e93ccdfc74d11" +checksum = "e2a6f5e1dfb4b34292ad4ea1facbfdaa1824705b231610087b00b17008641809" [[package]] name = "cxxbridge-macro" -version = "1.0.118" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d151cc139c3080e07f448f93a1284577ab2283d2a44acd902c6fba9ec20b6de" +checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -1613,28 +1703,28 @@ dependencies = [ [[package]] name = "dashmap" -version = "5.5.3" +version = "5.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" dependencies = [ "cfg-if 1.0.0", "hashbrown 0.14.3", "lock_api", "once_cell", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.8", ] [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "data-encoding-macro" -version = "0.1.14" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c01c06f5f429efdf2bae21eb67c28b3df3cf85b7dd2d8ef09c0838dac5d33e" +checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" dependencies = [ "data-encoding", "data-encoding-macro-internal", @@ -1642,9 +1732,9 @@ dependencies = [ [[package]] name = "data-encoding-macro-internal" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0047d07f2c89b17dd631c80450d69841a6b5d7fb17278cbc43d7e4cfcf2576f3" +checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" dependencies = [ "data-encoding", "syn 1.0.109", @@ -1676,12 +1766,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derivative" @@ -1804,7 +1891,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -1828,9 +1915,9 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.52", + "syn 2.0.50", "termcolor", - "toml 0.8.10", + "toml 0.8.8", "walkdir", ] @@ -1869,15 +1956,15 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" [[package]] name = "ecdsa" -version = "0.16.9" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ "der", "digest 0.10.7", @@ -1889,9 +1976,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ "pkcs8", "signature", @@ -1899,15 +1986,15 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ "curve25519-dalek 4.1.2", "ed25519", "rand_core 0.6.4", "serde", - "sha2 0.10.8", + "sha2 0.10.7", "subtle 2.5.0", "zeroize", ] @@ -1928,15 +2015,15 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.8" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ "base16ct", "crypto-bigint", @@ -1996,7 +2083,7 @@ dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -2215,9 +2302,9 @@ dependencies = [ name = "encointer-rpc" version = "7.0.0" dependencies = [ - "jsonrpsee 0.22.1", - "jsonrpsee-core 0.22.1", - "jsonrpsee-types 0.22.1", + "jsonrpsee 0.22.0", + "jsonrpsee-core 0.22.0", + "jsonrpsee-types 0.22.0", "thiserror", ] @@ -2248,9 +2335,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" dependencies = [ "humantime", "is-terminal", @@ -2289,12 +2376,23 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", "libc", - "windows-sys 0.52.0", ] [[package]] @@ -2311,7 +2409,7 @@ checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -2321,7 +2419,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ "event-listener 4.0.3", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -2343,7 +2441,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2366,9 +2464,18 @@ checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" -version = "2.0.1" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fastrand" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "fdlimit" @@ -2392,9 +2499,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.6" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "file-per-thread-logger" @@ -2402,20 +2509,20 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84f2e425d9790201ba4af4630191feac6dcc98765b118d4d18e91d23c2353866" dependencies = [ - "env_logger 0.10.2", + "env_logger 0.10.1", "log", ] [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "redox_syscall 0.3.5", + "windows-sys 0.48.0", ] [[package]] @@ -2454,9 +2561,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "libz-sys", @@ -2504,9 +2611,9 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -2693,7 +2800,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2703,10 +2810,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2717,7 +2824,7 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2782,12 +2889,9 @@ dependencies = [ [[package]] name = "fs-err" -version = "2.11.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" -dependencies = [ - "autocfg", -] +checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" [[package]] name = "fs2" @@ -2872,12 +2976,17 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "2.2.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ + "fastrand 1.9.0", "futures-core", - "pin-project-lite 0.2.13", + "futures-io", + "memchr", + "parking", + "pin-project-lite 0.2.12", + "waker-fn", ] [[package]] @@ -2888,7 +2997,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -2898,7 +3007,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2411eed028cdf8c8034eaf21f9915f956b6c3abec4d4c7949ee67f0721127bd" dependencies = [ "futures-io", - "rustls 0.20.9", + "rustls 0.20.8", "webpki", ] @@ -2916,9 +3025,9 @@ checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" -version = "3.0.3" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" @@ -2933,7 +3042,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "pin-utils", "slab", ] @@ -3002,9 +3111,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if 1.0.0", "libc", @@ -3021,14 +3130,24 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug 0.3.0", + "polyval 0.5.3", +] + [[package]] name = "ghash" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" dependencies = [ - "opaque-debug 0.3.1", - "polyval", + "opaque-debug 0.3.0", + "polyval 0.6.1", ] [[package]] @@ -3044,9 +3163,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" dependencies = [ "fallible-iterator 0.3.0", "stable_deref_trait", @@ -3067,15 +3186,15 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.5", + "regex-automata 0.4.3", "regex-syntax 0.8.2", ] [[package]] name = "governor" -version = "0.6.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" dependencies = [ "cfg-if 1.0.0", "dashmap", @@ -3084,11 +3203,9 @@ dependencies = [ "no-std-compat", "nonzero_ext", "parking_lot 0.12.1", - "portable-atomic", "quanta", "rand 0.8.5", "smallvec", - "spinning_top", ] [[package]] @@ -3108,13 +3225,13 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "futures-core", "futures-sink", "futures-util", "http", - "indexmap 2.2.5", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", @@ -3123,9 +3240,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.5.0" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "83c3372087601b532857d332f5957cbae686da52bb7810bf038c3e3c3cc2fa0d" dependencies = [ "log", "pest", @@ -3165,7 +3282,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", ] [[package]] @@ -3174,7 +3291,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "allocator-api2", ] @@ -3204,9 +3321,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -3222,9 +3339,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "hkdf" -version = "0.12.4" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ "hmac 0.12.1", ] @@ -3269,15 +3386,6 @@ dependencies = [ "hmac 0.8.1", ] -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "hostname" version = "0.3.1" @@ -3291,24 +3399,24 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "http", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", ] [[package]] @@ -3337,11 +3445,11 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-channel", "futures-core", "futures-util", @@ -3351,8 +3459,8 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project-lite 0.2.13", - "socket2 0.5.6", + "pin-project-lite 0.2.12", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -3361,15 +3469,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ "futures-util", "http", "hyper", "log", - "rustls 0.21.10", + "rustls 0.21.6", "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", @@ -3377,16 +3485,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows 0.48.0", ] [[package]] @@ -3417,9 +3525,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -3427,19 +3535,19 @@ dependencies = [ [[package]] name = "if-addrs" -version = "0.10.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cabb0019d51a643781ff15c9c8a3e5dedc365c47211270f4e8f82812fedd8f0a" +checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] name = "if-watch" -version = "3.2.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +checksum = "a9465340214b296cd17a0009acdb890d6160010b8adf8f78a00d0d7ab270f79f" dependencies = [ "async-io", "core-foundation", @@ -3451,7 +3559,7 @@ dependencies = [ "rtnetlink", "system-configuration", "tokio", - "windows", + "windows 0.34.0", ] [[package]] @@ -3515,9 +3623,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -3556,7 +3664,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -3582,7 +3690,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.6", + "socket2 0.5.3", "widestring", "windows-sys 0.48.0", "winreg", @@ -3590,19 +3698,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.12" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.52.0", + "hermit-abi 0.3.2", + "rustix 0.38.21", + "windows-sys 0.48.0", ] [[package]] @@ -3625,15 +3733,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "jobserver" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +dependencies = [ + "libc", +] [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -3651,28 +3768,28 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16fcc9dd231e72d22993f1643d5f7f0db785737dbe3c3d7ca222916ab4280795" +checksum = "4a95f7cc23d5fab0cdeeaf6bad8c8f5e7a3aa7f0d211957ea78232b327ab27b0" dependencies = [ "jsonrpsee-client-transport", - "jsonrpsee-core 0.22.1", + "jsonrpsee-core 0.22.0", "jsonrpsee-proc-macros", - "jsonrpsee-server 0.22.1", - "jsonrpsee-types 0.22.1", + "jsonrpsee-server 0.22.0", + "jsonrpsee-types 0.22.0", "tokio", "tracing", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0476c96eb741b40d39dcb39d0124e3b9be9840ec77653c42a0996563ae2a53f7" +checksum = "6b1736cfa3845fd9f8f43751f2b8e0e83f7b6081e754502f7d63b6587692cc83" dependencies = [ "futures-util", "http", - "jsonrpsee-core 0.22.1", + "jsonrpsee-core 0.22.0", "pin-project", "rustls-native-certs 0.7.0", "rustls-pki-types", @@ -3713,18 +3830,18 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b974d8f6139efbe8425f32cb33302aba6d5e049556b5bfc067874e7a0da54a2e" +checksum = "82030d038658974732103e623ba2e0abec03bbbe175b39c0a2fafbada60c5868" dependencies = [ "anyhow", - "async-lock", + "async-lock 3.3.0", "async-trait", "beef", "futures-timer", "futures-util", "hyper", - "jsonrpsee-types 0.22.1", + "jsonrpsee-types 0.22.0", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", @@ -3739,12 +3856,12 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e79a7109506831bf0cbeaad08729cdf0e592300c00f626bccd6d479974221e" +checksum = "69fc56131589f82e57805f7338b87023db4aafef813555708b159787e34ad6bc" dependencies = [ "heck", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3774,15 +3891,15 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "344440ccd8492c1ca65f1391c5aa03f91189db38d602d189b9266a1a5c6a4d22" +checksum = "d85be77fe5b2a94589e3164fb780017f7aff7d646b49278c0d0346af16975c8e" dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core 0.22.1", - "jsonrpsee-types 0.22.1", + "jsonrpsee-core 0.22.0", + "jsonrpsee-types 0.22.0", "pin-project", "route-recognizer", "serde", @@ -3812,9 +3929,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13dac43c1a9fc2648b37f306b0a5b0e29b2a6e1c36a33b95c1948da2494e9c5" +checksum = "9a48fdc1202eafc51c63e00406575e59493284ace8b8b61aa16f3a6db5d64f1a" dependencies = [ "anyhow", "beef", @@ -3825,22 +3942,22 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.8", + "sha2 0.10.7", ] [[package]] name = "keccak" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] @@ -3908,25 +4025,25 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" -version = "0.8.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if 1.0.0", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] name = "libm" -version = "0.2.8" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libp2p" @@ -3934,10 +4051,10 @@ version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", - "getrandom 0.2.12", + "getrandom 0.2.10", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -4062,7 +4179,7 @@ dependencies = [ "multihash", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.8", + "sha2 0.10.7", "thiserror", "zeroize", ] @@ -4075,7 +4192,7 @@ checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "either", "fnv", "futures", @@ -4087,7 +4204,7 @@ dependencies = [ "log", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.8", + "sha2 0.10.7", "smallvec", "thiserror", "uint", @@ -4110,7 +4227,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2 0.4.10", + "socket2 0.4.9", "tokio", "trust-dns-proto", "void", @@ -4136,7 +4253,7 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "curve25519-dalek 3.2.0", "futures", "libp2p-core", @@ -4145,7 +4262,7 @@ dependencies = [ "once_cell", "quick-protobuf", "rand 0.8.5", - "sha2 0.10.8", + "sha2 0.10.7", "snow", "static_assertions", "thiserror", @@ -4176,7 +4293,7 @@ version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", "if-watch", @@ -4187,7 +4304,7 @@ dependencies = [ "parking_lot 0.12.1", "quinn-proto", "rand 0.8.5", - "rustls 0.20.9", + "rustls 0.20.8", "thiserror", "tokio", ] @@ -4252,7 +4369,7 @@ dependencies = [ "libc", "libp2p-core", "log", - "socket2 0.4.10", + "socket2 0.4.9", "tokio", ] @@ -4268,7 +4385,7 @@ dependencies = [ "libp2p-identity", "rcgen", "ring 0.16.20", - "rustls 0.20.9", + "rustls 0.20.8", "thiserror", "webpki", "x509-parser", @@ -4321,17 +4438,6 @@ dependencies = [ "yamux", ] -[[package]] -name = "libredox" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" -dependencies = [ - "bitflags 2.4.2", - "libc", - "redox_syscall 0.4.1", -] - [[package]] name = "librocksdb-sys" version = "0.11.0+8.1.1" @@ -4397,9 +4503,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.15" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037731f5d3aaa87a5675e895b63ddff1a87624bc29f77004ea829809654e48f6" +checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" dependencies = [ "cc", "pkg-config", @@ -4432,9 +4538,9 @@ dependencies = [ [[package]] name = "linregress" -version = "0.5.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" +checksum = "4de0b5f52a9f84544d268f5fabb71b38962d6aa3c6600b8bcd27d44ccf9c9c45" dependencies = [ "nalgebra", ] @@ -4447,9 +4553,15 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lioness" @@ -4465,9 +4577,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -4475,9 +4587,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru" @@ -4526,6 +4638,15 @@ dependencies = [ "libc", ] +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "macro_magic" version = "0.5.0" @@ -4535,7 +4656,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4549,7 +4670,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4560,7 +4681,7 @@ checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4571,7 +4692,7 @@ checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -4597,9 +4718,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "matrixmultiply" -version = "0.3.8" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +checksum = "090126dc04f95dc0d1c1c91f61bdd474b3930ca064c1edc8a849da2c6cbe1e77" dependencies = [ "autocfg", "rawpointer", @@ -4613,22 +4734,22 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "memchr" -version = "2.7.1" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memfd" -version = "0.6.4" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" dependencies = [ - "rustix 0.38.31", + "rustix 0.37.23", ] [[package]] @@ -4642,9 +4763,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" dependencies = [ "libc", ] @@ -4658,6 +4779,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-db" version = "0.32.0" @@ -4699,9 +4829,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] @@ -4727,9 +4857,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -4854,18 +4984,18 @@ dependencies = [ "core2", "digest 0.10.7", "multihash-derive", - "sha2 0.10.8", + "sha2 0.10.7", "sha3", "unsigned-varint", ] [[package]] name = "multihash-derive" -version = "0.8.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" +checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro-error", "proc-macro2", "quote", @@ -4885,7 +5015,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "log", "pin-project", @@ -4895,9 +5025,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.4" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4541eb06dce09c0241ebbaab7102f0a01a0c8994afed2e5d0d66775016e25ac2" +checksum = "307ed9b18cc2423f29e83f84fd23a8e73628727990181f18641a8b5dc2ab1caa" dependencies = [ "approx", "matrixmultiply", @@ -4984,7 +5114,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "log", "netlink-packet-core", @@ -4999,7 +5129,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures", "libc", "log", @@ -5064,19 +5194,13 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" dependencies = [ "num-traits", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-format" version = "0.4.4" @@ -5089,10 +5213,11 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.46" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ + "autocfg", "num-traits", ] @@ -5109,9 +5234,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", "libm", @@ -5123,7 +5248,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.3.2", "libc", ] @@ -5171,9 +5296,9 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" [[package]] name = "opaque-debug" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" @@ -5181,7 +5306,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.4.0", "cfg-if 1.0.0", "foreign-types", "libc", @@ -5198,7 +5323,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -5351,7 +5476,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-encointer-bazaar-rpc-runtime-api", "parity-scale-codec", @@ -5405,7 +5530,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-encointer-ceremonies-rpc-runtime-api", "parity-scale-codec", @@ -5453,7 +5578,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pallet-encointer-communities-rpc-runtime-api", "parity-scale-codec", @@ -5715,7 +5840,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4fac4e459db3c002ddebfbce82d055dbe8885eb4c2f9dcd9da5675eafef9bb7" dependencies = [ - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -5777,9 +5902,9 @@ dependencies = [ [[package]] name = "parity-db" -version = "0.4.13" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" +checksum = "59e9ab494af9e6e813c72170f0d3c1de1500990d62c97cc05cc7576f91aa402f" dependencies = [ "blake2 0.10.6", "crc32fast", @@ -5793,19 +5918,18 @@ dependencies = [ "rand 0.8.5", "siphasher", "snap", - "winapi 0.3.9", ] [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec 0.7.4", "bitvec", "byte-slice-cast", - "bytes 1.5.0", + "bytes 1.4.0", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -5813,11 +5937,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -5837,9 +5961,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -5859,7 +5983,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.9", + "parking_lot_core 0.9.8", ] [[package]] @@ -5878,13 +6002,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.3.5", "smallvec", "windows-targets 0.48.5", ] @@ -5927,26 +6051,25 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pest" -version = "2.7.7" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c0dcc30b6a27553f9cc242972b67f75b60eb0db71f0b5462f38b058c41546" +checksum = "1acb4a4365a13f749a93f1a094a7805e5cfa0955373a9de860d962eaa3a5fe5a" dependencies = [ - "memchr", "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.7" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1288dbd7786462961e69bfd4df7848c1e37e8b74303dbdab82c3a9cdd2809" +checksum = "666d00490d4ac815001da55838c500eafb0320019bbaa44444137c48b443a853" dependencies = [ "pest", "pest_generator", @@ -5954,26 +6077,26 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.7" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1381c29a877c6d34b8c176e734f35d7f7f5b3adaefe940cb4d1bb7af94678e2e" +checksum = "68ca01446f50dbda87c1786af8770d535423fa8a53aec03b8f4e3d7eb10e0929" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "pest_meta" -version = "2.7.7" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0934d6907f148c22a3acbda520c7eed243ad7487a30f51f6ce52b58b7077a8a" +checksum = "56af0a30af74d0445c0bf6d9d051c979b516a1a5af790d251daee76005420a48" dependencies = [ "once_cell", "pest", - "sha2 0.10.8", + "sha2 0.10.7", ] [[package]] @@ -5983,27 +6106,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.5", + "indexmap 2.2.3", ] [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6014,9 +6137,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -6036,15 +6159,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "platforms" -version = "3.3.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] name = "polkavm-common" @@ -6070,7 +6193,7 @@ dependencies = [ "polkavm-common", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6080,7 +6203,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" dependencies = [ "polkavm-derive-impl", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6089,7 +6212,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdec1451cb18261d5d01de82acc15305e417fb59588cdcb3127d3dcc9672b925" dependencies = [ - "gimli 0.28.1", + "gimli 0.28.0", "hashbrown 0.14.3", "log", "object 0.32.2", @@ -6100,52 +6223,54 @@ dependencies = [ [[package]] name = "polling" -version = "3.5.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24f040dee2588b4963afb4e420540439d126f73fdacf4a9c486a96d840bac3c9" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ + "autocfg", + "bitflags 1.3.2", "cfg-if 1.0.0", "concurrent-queue", - "pin-project-lite 0.2.13", - "rustix 0.38.31", - "tracing", - "windows-sys 0.52.0", + "libc", + "log", + "pin-project-lite 0.2.12", + "windows-sys 0.48.0", ] [[package]] name = "poly1305" -version = "0.8.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", - "opaque-debug 0.3.1", - "universal-hash", + "opaque-debug 0.3.0", + "universal-hash 0.4.0", ] [[package]] name = "polyval" -version = "0.6.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ "cfg-if 1.0.0", "cpufeatures", - "opaque-debug 0.3.1", - "universal-hash", + "opaque-debug 0.3.0", + "universal-hash 0.4.0", ] [[package]] -name = "portable-atomic" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" - -[[package]] -name = "powerfmt" -version = "0.2.0" +name = "polyval" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "opaque-debug 0.3.0", + "universal-hash 0.5.1", +] [[package]] name = "ppv-lite86" @@ -6195,19 +6320,19 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.16" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62" dependencies = [ "proc-macro2", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "primitive-types" -version = "0.12.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ "fixed-hash", "impl-codec", @@ -6218,30 +6343,21 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" -dependencies = [ - "thiserror", - "toml 0.5.11", -] - -[[package]] -name = "proc-macro-crate" -version = "2.0.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "toml_edit 0.20.7", + "once_cell", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.21.0", ] [[package]] @@ -6268,22 +6384,28 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro-warning" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" +checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" dependencies = [ "unicode-ident", ] @@ -6322,7 +6444,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6331,7 +6453,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "prost-derive 0.11.9", ] @@ -6341,7 +6463,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "prost-derive 0.12.3", ] @@ -6351,7 +6473,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "heck", "itertools 0.10.5", "lazy_static", @@ -6390,7 +6512,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6413,12 +6535,13 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" dependencies = [ "crossbeam-utils", "libc", + "mach2", "once_cell", "raw-cpuid", "wasi 0.11.0+wasi-snapshot-preview1", @@ -6448,7 +6571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "quick-protobuf", "thiserror", "unsigned-varint", @@ -6467,15 +6590,15 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.9.6" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" +checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "rand 0.8.5", "ring 0.16.20", "rustc-hash", - "rustls 0.20.9", + "rustls 0.20.8", "slab", "thiserror", "tinyvec", @@ -6557,7 +6680,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.10", ] [[package]] @@ -6590,11 +6713,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "10.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" dependencies = [ - "bitflags 2.4.2", + "bitflags 1.3.2", ] [[package]] @@ -6605,9 +6728,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.9.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" dependencies = [ "either", "rayon-core", @@ -6615,12 +6738,14 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" dependencies = [ + "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", + "num_cpus", ] [[package]] @@ -6644,6 +6769,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.4.1" @@ -6655,33 +6789,33 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.12", - "libredox", + "getrandom 0.2.10", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "acde58d073e9c79da00f2b5b84eed919c8326832648a5b109b3fce1bb1175280" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -6711,13 +6845,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.3", "regex-syntax 0.8.2", ] @@ -6732,9 +6866,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -6790,17 +6924,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "cfg-if 1.0.0", - "getrandom 0.2.12", + "getrandom 0.2.10", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -6821,13 +6954,13 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rpassword" -version = "7.3.1" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" +checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" dependencies = [ "libc", "rtoolbox", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] @@ -6847,12 +6980,12 @@ dependencies = [ [[package]] name = "rtoolbox" -version = "0.0.2" +version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c247d24e63230cdb56463ae328478bd5eac8b8faa8c69461a77e8e323afac90e" +checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" dependencies = [ "libc", - "windows-sys 0.48.0", + "winapi 0.3.9", ] [[package]] @@ -6888,7 +7021,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.18", ] [[package]] @@ -6902,9 +7035,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.17" +version = "0.36.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +checksum = "c37f1bd5ef1b5422177b7646cba67430579cfe2ace80f284fee876bca52ad941" dependencies = [ "bitflags 1.3.2", "errno", @@ -6916,22 +7049,36 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags 2.4.2", + "bitflags 1.3.2", "errno", + "io-lifetimes", "libc", - "linux-raw-sys 0.4.13", - "windows-sys 0.52.0", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.10", + "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.20.9" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring 0.16.20", @@ -6941,13 +7088,13 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", - "ring 0.17.8", - "rustls-webpki 0.101.7", + "ring 0.16.20", + "rustls-webpki 0.101.4", "sct", ] @@ -6958,7 +7105,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", - "ring 0.17.8", + "ring 0.17.7", "rustls-pki-types", "rustls-webpki 0.102.2", "subtle 2.5.0", @@ -6972,7 +7119,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", + "rustls-pemfile 1.0.3", "schannel", "security-framework", ] @@ -6984,7 +7131,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.1", + "rustls-pemfile 2.0.0", "rustls-pki-types", "schannel", "security-framework", @@ -6992,37 +7139,37 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.7", + "base64 0.21.2", ] [[package]] name = "rustls-pemfile" -version = "2.1.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" dependencies = [ - "base64 0.21.7", + "base64 0.21.2", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.3.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" +checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -7031,7 +7178,7 @@ version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "rustls-pki-types", "untrusted 0.9.0", ] @@ -7055,9 +7202,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "safe-mix" @@ -7146,7 +7293,7 @@ dependencies = [ "array-bytes 6.2.2", "docify", "log", - "memmap2 0.9.4", + "memmap2 0.9.3", "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", @@ -7170,10 +7317,10 @@ version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -7335,7 +7482,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86ea4771511dfcabe0e0dd3a43368ba3f430b0aaf736463b14286cc10a6494e6" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "array-bytes 6.2.2", "async-trait", "dyn-clone", @@ -7444,7 +7591,7 @@ dependencies = [ "libc", "log", "parking_lot 0.12.1", - "rustix 0.36.17", + "rustix 0.36.15", "sc-allocator", "sc-executor-common", "sp-runtime-interface", @@ -7494,7 +7641,7 @@ dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.4", "blake2 0.10.6", - "bytes 1.5.0", + "bytes 1.4.0", "futures", "futures-timer", "libp2p-identity", @@ -7525,7 +7672,7 @@ dependencies = [ "async-channel", "async-trait", "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "either", "fnv", "futures", @@ -7604,7 +7751,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6c4ffd60fe240d9b0963ec60752810660a201755a77b922aa5e8ef7256f6b5" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "futures", "futures-timer", "libp2p", @@ -7704,7 +7851,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d099f8d2f399be5b7d163e4236faaa47e7ce131f4021b9fe8e3e607e0ca51364" dependencies = [ "array-bytes 6.2.2", - "bytes 1.5.0", + "bytes 1.4.0", "fnv", "futures", "futures-timer", @@ -7749,7 +7896,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61faa018966cb794e36be31af4ed4d19deaa93c751ff32512637c7bca104e9e8" dependencies = [ "futures", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -7781,7 +7928,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f716a273af4f4782430ebe4fe6d0f8b1490ff7c103dc78193706bfff370c250f" dependencies = [ - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -7806,7 +7953,7 @@ dependencies = [ "governor", "http", "hyper", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "pin-project", "serde_json", @@ -7826,7 +7973,7 @@ dependencies = [ "futures", "futures-util", "hex", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -7859,7 +8006,7 @@ dependencies = [ "exit-future", "futures", "futures-timer", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -8003,10 +8150,10 @@ version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8103,7 +8250,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3475108a1b62c7efd1b5c65974f30109a598b2f45f23c9ae030acb9686966db" dependencies = [ "darling", - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -8131,7 +8278,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "995491f110efdc6bea96d6a746140e32bfceb4ea47510750a5467295a4707a25" dependencies = [ "darling", - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -8157,7 +8304,7 @@ version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -8181,11 +8328,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -8194,7 +8341,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "cfg-if 1.0.0", "hashbrown 0.13.2", ] @@ -8221,7 +8368,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de18f6d8ba0aad7045f5feae07ec29899c1112584a38509a84ad7b04451eaa0" dependencies = [ - "aead", + "aead 0.5.2", "arrayref", "arrayvec 0.7.4", "curve25519-dalek 4.1.2", @@ -8229,7 +8376,7 @@ dependencies = [ "merlin 3.0.0", "rand_core 0.6.4", "serde_bytes", - "sha2 0.10.8", + "sha2 0.10.7", "subtle 2.5.0", "zeroize", ] @@ -8248,12 +8395,12 @@ checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "sct" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -8272,18 +8419,18 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" dependencies = [ "secp256k1-sys", ] [[package]] name = "secp256k1-sys" -version = "0.9.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" dependencies = [ "cc", ] @@ -8340,9 +8487,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] @@ -8364,9 +8511,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] @@ -8379,7 +8526,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8395,9 +8542,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -8424,7 +8571,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] @@ -8449,14 +8596,14 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.1", + "opaque-debug 0.3.0", ] [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -8475,9 +8622,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.7" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] @@ -8499,9 +8646,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ "digest 0.10.7", "rand_core 0.6.4", @@ -8549,38 +8696,38 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.13.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "snap" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" +checksum = "5e9f0ab6ef7eb7353d9119c170a436d1bf248eea575ac42d19d12f4e34130831" [[package]] name = "snow" -version = "0.9.6" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "850948bee068e713b8ab860fe1adc4d109676ab4c3b621fd8147f06b261f2f85" +checksum = "0c9d1425eb528a21de2755c75af4c9b5d57f50a0d4c3b7f1828a4cd03f8ba155" dependencies = [ - "aes-gcm", + "aes-gcm 0.9.2", "blake2 0.10.6", "chacha20poly1305", "curve25519-dalek 4.1.2", "rand_core 0.6.4", - "ring 0.17.8", + "ring 0.16.20", "rustc_version 0.4.0", - "sha2 0.10.8", + "sha2 0.10.7", "subtle 2.5.0", ] [[package]] name = "socket2" -version = "0.4.10" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi 0.3.9", @@ -8588,12 +8735,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -8603,7 +8750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", - "bytes 1.5.0", + "bytes 1.4.0", "flate2", "futures", "http", @@ -8645,10 +8792,10 @@ dependencies = [ "Inflector", "blake2 0.10.6", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8832,7 +8979,7 @@ dependencies = [ "blake2b_simd", "byteorder", "digest 0.10.7", - "sha2 0.10.8", + "sha2 0.10.7", "sha3", "twox-hash", ] @@ -8845,7 +8992,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8866,7 +9013,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -8914,7 +9061,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "ed25519-dalek", "libsecp256k1", "log", @@ -9056,7 +9203,7 @@ version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive", @@ -9078,10 +9225,10 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9143,14 +9290,14 @@ version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b95ede4523fc978585383465a406289235a71dd6febe7f79e1114794afae5cd0" dependencies = [ - "aes-gcm", + "aes-gcm 0.10.3", "curve25519-dalek 4.1.2", "ed25519-dalek", "hkdf", "parity-scale-codec", "rand 0.8.5", "scale-info", - "sha2 0.10.8", + "sha2 0.10.7", "sp-api", "sp-application-crypto", "sp-core", @@ -9160,7 +9307,7 @@ dependencies = [ "sp-runtime-interface", "sp-std", "thiserror", - "x25519-dalek 2.0.1", + "x25519-dalek 2.0.0", ] [[package]] @@ -9242,7 +9389,7 @@ version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" dependencies = [ - "ahash 0.8.10", + "ahash 0.8.8", "hash-db", "lazy_static", "memory-db", @@ -9288,7 +9435,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9333,20 +9480,11 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spinning_top" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" -dependencies = [ - "lock_api", -] - [[package]] name = "spki" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", "der", @@ -9354,9 +9492,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.46.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1114ee5900b8569bbc8b1a014a942f937b752af4b44f4607430b5f86cedaac0" +checksum = "5e6915280e2d0db8911e5032a5c275571af6bdded2916abd691a659be25d3439" dependencies = [ "Inflector", "num-format", @@ -9463,7 +9601,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9479,7 +9617,7 @@ dependencies = [ "frame-support", "futures-util", "hex", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "maybe-async", "parity-scale-codec", @@ -9550,7 +9688,7 @@ checksum = "74fba95234990a0eecb3199ee2589112a1a3763db1fa7739a316f3e26f7693c9" dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee 0.22.1", + "jsonrpsee 0.22.0", "log", "parity-scale-codec", "sc-rpc-api", @@ -9611,7 +9749,7 @@ dependencies = [ "sp-maybe-compressed-blob", "strum 0.24.1", "tempfile", - "toml 0.8.10", + "toml 0.8.8", "walkdir", "wasm-opt", ] @@ -9641,9 +9779,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -9691,27 +9829,28 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if 1.0.0", - "fastrand", - "rustix 0.38.31", - "windows-sys 0.52.0", + "fastrand 2.0.0", + "redox_syscall 0.4.1", + "rustix 0.38.21", + "windows-sys 0.48.0", ] [[package]] name = "termcolor" -version = "1.4.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -9722,7 +9861,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "rustix 0.38.31", + "rustix 0.38.21", "windows-sys 0.48.0", ] @@ -9743,22 +9882,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9769,9 +9908,9 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -9798,14 +9937,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ "deranged", "itoa", - "num-conv", - "powerfmt", "serde", "time-core", "time-macros", @@ -9813,17 +9950,16 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" dependencies = [ - "num-conv", "time-core", ] @@ -9853,32 +9989,32 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", - "bytes 1.5.0", + "bytes 1.4.0", "libc", - "mio 0.8.10", + "mio 0.8.8", "num_cpus", "parking_lot 0.12.1", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.3", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -9887,7 +10023,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.6", "tokio", ] @@ -9909,22 +10045,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tokio", "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ - "bytes 1.5.0", + "bytes 1.4.0", "futures-core", "futures-io", "futures-sink", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tokio", "tracing", ] @@ -9940,14 +10076,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.6", + "toml_edit 0.21.0", ] [[package]] @@ -9961,37 +10097,26 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.5", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.3", "toml_datetime", - "winnow 0.5.40", + "winnow", ] [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -10003,7 +10128,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", "tracing", @@ -10011,18 +10136,18 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" +checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" dependencies = [ - "bitflags 2.4.2", - "bytes 1.5.0", + "bitflags 2.4.0", + "bytes 1.4.0", "futures-core", "futures-util", "http", "http-body", "http-range-header", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tower-layer", "tower-service", ] @@ -10041,25 +10166,26 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.13", + "pin-project-lite 0.2.12", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -10084,12 +10210,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ + "lazy_static", "log", - "once_cell", "tracing-core", ] @@ -10166,7 +10292,7 @@ dependencies = [ "lazy_static", "rand 0.8.5", "smallvec", - "socket2 0.4.10", + "socket2 0.4.9", "thiserror", "tinyvec", "tokio", @@ -10196,9 +10322,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "tt-call" @@ -10220,9 +10346,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -10244,15 +10370,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -10265,9 +10391,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" @@ -10275,6 +10401,16 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "universal-hash" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" +dependencies = [ + "generic-array 0.14.7", + "subtle 2.5.0", +] + [[package]] name = "universal-hash" version = "0.5.1" @@ -10287,12 +10423,12 @@ dependencies = [ [[package]] name = "unsigned-varint" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" +checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec", - "bytes 1.5.0", + "bytes 1.4.0", "futures-io", "futures-util", ] @@ -10311,12 +10447,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 0.4.0", "percent-encoding", ] @@ -10374,12 +10510,18 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", - "sha2 0.10.8", + "sha2 0.10.7", "sha3", "thiserror", "zeroize", ] +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "walkdir" version = "2.4.0" @@ -10413,9 +10555,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -10423,24 +10565,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -10450,9 +10592,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10460,22 +10602,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-instrument" @@ -10595,14 +10737,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c86437fa68626fe896e5afc69234bb2b5894949083586535f200385adfd71213" dependencies = [ "anyhow", - "base64 0.21.7", + "base64 0.21.2", "bincode", "directories-next", "file-per-thread-logger", "log", - "rustix 0.36.17", + "rustix 0.36.15", "serde", - "sha2 0.10.8", + "sha2 0.10.7", "toml 0.5.11", "windows-sys 0.45.0", "zstd 0.11.2+zstd.1.5.2", @@ -10696,7 +10838,7 @@ checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" dependencies = [ "object 0.30.4", "once_cell", - "rustix 0.36.17", + "rustix 0.36.15", ] [[package]] @@ -10724,10 +10866,10 @@ dependencies = [ "log", "mach", "memfd", - "memoffset", + "memoffset 0.8.0", "paste", "rand 0.8.5", - "rustix 0.36.17", + "rustix 0.36.15", "wasmtime-asm-macros", "wasmtime-environ", "wasmtime-jit-debug", @@ -10748,9 +10890,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -10762,7 +10904,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.8", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -10777,21 +10919,20 @@ dependencies = [ [[package]] name = "which" -version = "4.4.2" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" dependencies = [ "either", - "home", + "libc", "once_cell", - "rustix 0.38.31", ] [[package]] name = "wide" -version = "0.7.15" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" +checksum = "aa469ffa65ef7e0ba0f164183697b89b854253fd31aeb92358b7b6155177d62f" dependencies = [ "bytemuck", "safe_arch", @@ -10833,9 +10974,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ "winapi 0.3.9", ] @@ -10848,32 +10989,26 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.51.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", ] [[package]] -name = "windows-core" -version = "0.51.1" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.4", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -10898,7 +11033,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.0", ] [[package]] @@ -10933,17 +11068,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -10960,9 +11095,15 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" [[package]] name = "windows_aarch64_msvc" @@ -10978,9 +11119,15 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" [[package]] name = "windows_i686_gnu" @@ -10996,9 +11143,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" [[package]] name = "windows_i686_msvc" @@ -11014,9 +11167,15 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" [[package]] name = "windows_x86_64_gnu" @@ -11032,9 +11191,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -11050,9 +11209,15 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" [[package]] name = "windows_x86_64_msvc" @@ -11068,24 +11233,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" - -[[package]] -name = "winnow" -version = "0.5.40" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.6.5" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] @@ -11151,9 +11307,9 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "2.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ "curve25519-dalek 4.1.2", "rand_core 0.6.4", @@ -11219,14 +11375,14 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] @@ -11239,7 +11395,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.50", ] [[package]] @@ -11282,10 +11438,11 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", + "libc", "pkg-config", ] diff --git a/rust-toolchain.toml b/rust-toolchain.toml.disable similarity index 75% rename from rust-toolchain.toml rename to rust-toolchain.toml.disable index 92636b7c..8dca45a8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml.disable @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2024-01-22" +channel = "stable" profile = "default" # include rustfmt, clippy targets = ["wasm32-unknown-unknown"] From 6d09425c4eb35842b091919d59c254da70777686 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Fri, 1 Mar 2024 20:46:30 +0100 Subject: [PATCH 08/41] still no luck with nightly --- Cargo.lock | 8 ++++---- rust-toolchain.toml | 14 ++++++++++++++ rust-toolchain.toml.disable | 4 ---- 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 rust-toolchain.toml delete mode 100644 rust-toolchain.toml.disable diff --git a/Cargo.lock b/Cargo.lock index ff6d4955..89a8ce87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -688,8 +688,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", - "rand 0.8.5", - "rand_core 0.6.4", + "rand 0.7.3", + "rand_core 0.5.1", "serde", "unicode-normalization", ] @@ -10338,9 +10338,9 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.7", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..38a95c9f --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,14 @@ +[toolchain] +channel = "nightly-2024-02-08" +profile = "default" # include rustfmt, clippy +components = [ + "cargo", + "clippy", + "rust-analyzer", + "rust-src", + "rust-std", + "rustc", + "rustc-dev", + "rustfmt", +] +targets = ["wasm32-unknown-unknown"] diff --git a/rust-toolchain.toml.disable b/rust-toolchain.toml.disable deleted file mode 100644 index 8dca45a8..00000000 --- a/rust-toolchain.toml.disable +++ /dev/null @@ -1,4 +0,0 @@ -[toolchain] -channel = "stable" -profile = "default" # include rustfmt, clippy -targets = ["wasm32-unknown-unknown"] From 8413e951c906241fa2e1de5580629a3a9407d030 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sat, 2 Mar 2024 12:37:55 +0100 Subject: [PATCH 09/41] WIP before migrating to async api client --- Cargo.lock | 299 +++--------------- Cargo.toml | 6 +- .../encointer-api-client-extension/Cargo.toml | 1 + .../src/ceremonies.rs | 3 +- .../encointer-api-client-extension/src/lib.rs | 8 +- runtime/src/lib.rs | 71 ++--- runtime/src/weights/pallet_treasury.rs | 190 +++++++---- rust-toolchain.toml | 3 +- 8 files changed, 217 insertions(+), 364 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89a8ce87..cdf97971 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -227,7 +227,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -573,7 +573,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" dependencies = [ - "bytes 1.4.0", + "bytes", "futures-sink", "futures-util", "memchr", @@ -588,7 +588,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi 0.1.19", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -895,16 +895,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - [[package]] name = "bytes" version = "1.4.0" @@ -1880,7 +1870,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2059,6 +2049,7 @@ dependencies = [ "sp-runtime", "substrate-api-client", "substrate-client-keystore", + "tokio", ] [[package]] @@ -2585,21 +2576,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "fork-tree" version = "12.0.0" @@ -2900,25 +2876,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags 1.3.2", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "funty" version = "2.0.0" @@ -3095,7 +3055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3225,7 +3185,7 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ - "bytes 1.4.0", + "bytes", "fnv", "futures-core", "futures-sink", @@ -3394,7 +3354,7 @@ checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" dependencies = [ "libc", "match_cfg", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3403,7 +3363,7 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ - "bytes 1.4.0", + "bytes", "fnv", "itoa", ] @@ -3414,7 +3374,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.4.0", + "bytes", "http", "pin-project-lite 0.2.12", ] @@ -3449,7 +3409,7 @@ version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ - "bytes 1.4.0", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -3540,7 +3500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbc0fa01ffc752e9dbc72818cdb072cd028b86be5e09dd04c5a643704fe101a9" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3669,15 +3629,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "ip_network" version = "0.4.1" @@ -3962,16 +3913,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "keystream" version = "1.0.0" @@ -4036,7 +3977,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ "cfg-if 1.0.0", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4051,7 +3992,7 @@ version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f35eae38201a993ece6bdc823292d6abd1bffed1c4d0f4a3517d2bd8e1d917fe" dependencies = [ - "bytes 1.4.0", + "bytes", "futures", "futures-timer", "getrandom 0.2.10", @@ -4192,7 +4133,7 @@ checksum = "39d5ef876a2b2323d63c258e63c2f8e36f205fe5a11f0b3095d59635650790ff" dependencies = [ "arrayvec 0.7.4", "asynchronous-codec", - "bytes 1.4.0", + "bytes", "either", "fnv", "futures", @@ -4253,7 +4194,7 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3673da89d29936bc6435bafc638e2f184180d554ce844db65915113f86ec5e" dependencies = [ - "bytes 1.4.0", + "bytes", "curve25519-dalek 3.2.0", "futures", "libp2p-core", @@ -4293,7 +4234,7 @@ version = "0.7.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6b26abd81cd2398382a1edfe739b539775be8a90fa6914f39b2ab49571ec735" dependencies = [ - "bytes 1.4.0", + "bytes", "futures", "futures-timer", "if-watch", @@ -4836,25 +4777,6 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - [[package]] name = "mio" version = "0.8.8" @@ -4866,30 +4788,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio 0.6.23", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - [[package]] name = "mixnet" version = "0.7.0" @@ -5015,7 +4913,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8552ab875c1313b97b8d20cb857b9fd63e2d1d6a0a1b53ce9821e575405f27a" dependencies = [ - "bytes 1.4.0", + "bytes", "futures", "log", "pin-project", @@ -5059,17 +4957,6 @@ dependencies = [ "rand 0.8.5", ] -[[package]] -name = "net2" -version = "0.2.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13b648036a2339d06de780866fbdfda0dde886de7b3af2ddeba8b14f4ee34ac" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "netlink-packet-core" version = "0.4.2" @@ -5114,7 +5001,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" dependencies = [ - "bytes 1.4.0", + "bytes", "futures", "log", "netlink-packet-core", @@ -5129,7 +5016,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" dependencies = [ - "bytes 1.4.0", + "bytes", "futures", "libc", "log", @@ -5300,50 +5187,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags 2.4.0", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.50", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.101" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "option-ext" version = "0.2.0" @@ -5929,7 +5778,7 @@ dependencies = [ "arrayvec 0.7.4", "bitvec", "byte-slice-cast", - "bytes 1.4.0", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -5997,7 +5846,7 @@ dependencies = [ "libc", "redox_syscall 0.2.16", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -6453,7 +6302,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ - "bytes 1.4.0", + "bytes", "prost-derive 0.11.9", ] @@ -6463,7 +6312,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ - "bytes 1.4.0", + "bytes", "prost-derive 0.12.3", ] @@ -6473,7 +6322,7 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ - "bytes 1.4.0", + "bytes", "heck", "itertools 0.10.5", "lazy_static", @@ -6546,7 +6395,7 @@ dependencies = [ "raw-cpuid", "wasi 0.11.0+wasi-snapshot-preview1", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -6571,7 +6420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1693116345026436eb2f10b677806169c1a1260c1c60eaaffe3fb5a29ae23d8b" dependencies = [ "asynchronous-codec", - "bytes 1.4.0", + "bytes", "quick-protobuf", "thiserror", "unsigned-varint", @@ -6594,7 +6443,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" dependencies = [ - "bytes 1.4.0", + "bytes", "rand 0.8.5", "ring 0.16.20", "rustc-hash", @@ -6919,7 +6768,7 @@ dependencies = [ "spin 0.5.2", "untrusted 0.7.1", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -6960,7 +6809,7 @@ checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" dependencies = [ "libc", "rtoolbox", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -6985,7 +6834,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -7641,7 +7490,7 @@ dependencies = [ "array-bytes 4.2.0", "arrayvec 0.7.4", "blake2 0.10.6", - "bytes 1.4.0", + "bytes", "futures", "futures-timer", "libp2p-identity", @@ -7672,7 +7521,7 @@ dependencies = [ "async-channel", "async-trait", "asynchronous-codec", - "bytes 1.4.0", + "bytes", "either", "fnv", "futures", @@ -7851,7 +7700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d099f8d2f399be5b7d163e4236faaa47e7ce131f4021b9fe8e3e607e0ca51364" dependencies = [ "array-bytes 6.2.2", - "bytes 1.4.0", + "bytes", "fnv", "futures", "futures-timer", @@ -8549,18 +8398,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha-1" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha-1" version = "0.9.8" @@ -8730,7 +8567,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -8750,14 +8587,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.1", - "bytes 1.4.0", + "bytes", "flate2", "futures", "http", "httparse", "log", "rand 0.8.5", - "sha-1 0.9.8", + "sha-1", ] [[package]] @@ -9061,7 +8898,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" dependencies = [ - "bytes 1.4.0", + "bytes", "ed25519-dalek", "libsecp256k1", "log", @@ -9203,7 +9040,7 @@ version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" dependencies = [ - "bytes 1.4.0", + "bytes", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive", @@ -9529,7 +9366,7 @@ dependencies = [ "parking_lot 0.11.2", "parking_lot_core 0.8.6", "static_init_macro", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -9631,7 +9468,6 @@ dependencies = [ "sp-storage", "sp-version", "url", - "ws", ] [[package]] @@ -9994,9 +9830,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", - "bytes 1.4.0", + "bytes", "libc", - "mio 0.8.8", + "mio", "num_cpus", "parking_lot 0.12.1", "pin-project-lite 0.2.12", @@ -10056,7 +9892,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ - "bytes 1.4.0", + "bytes", "futures-core", "futures-io", "futures-sink", @@ -10141,7 +9977,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" dependencies = [ "bitflags 2.4.0", - "bytes 1.4.0", + "bytes", "futures-core", "futures-util", "http", @@ -10428,7 +10264,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec", - "bytes 1.4.0", + "bytes", "futures-io", "futures-util", ] @@ -10944,12 +10780,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -10960,12 +10790,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -10978,7 +10802,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -11256,35 +11080,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "ws" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log", - "mio 0.6.23", - "mio-extras", - "openssl", - "rand 0.7.3", - "sha-1 0.8.2", - "slab", - "url", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index bff0e648..373e6fda 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ pallet-encointer-scheduler = { default-features = false, version = "7.0.0" } # substrate deps frame-benchmarking = { default-features = false, version = "30.0.0" } frame-benchmarking-cli = { version = "34.0.0" } -frame-executive = { version = "30.0.0" } +frame-executive = { version = "30.0.0", default-features = false } frame-support = { default-features = false, version = "30.0.0" } frame-system = { default-features = false, version = "30.0.0" } frame-system-benchmarking = { version = "30.0.0", default-features = false } @@ -95,7 +95,7 @@ sp-consensus = { version = "0.34.0" } sp-consensus-aura = { version = "0.34.0", default-features = false } sp-consensus-grandpa = { version = "15.0.0" } sp-core = { default-features = false, version = "30.0.0" } -sp-inherents = "28.0.0" +sp-inherents = { default-features = false, version = "28.0.0" } sp-io = { default-features = false, version = "32.0.0" } sp-keyring = "33.0.0" sp-keystore = "0.36.0" @@ -114,7 +114,7 @@ substrate-frame-rpc-system = { version = "30.0.0" } substrate-wasm-builder = "19.0.0" substrate-build-script-utils = "11.0.0" -substrate-api-client = { version = "0.17.0", features = ["ws-client"] } +substrate-api-client = { version = "0.17.0", features = ["jsonrpsee-client"] } substrate-client-keystore = "0.10.0" diff --git a/client/encointer-api-client-extension/Cargo.toml b/client/encointer-api-client-extension/Cargo.toml index 5f6c6a23..48cca935 100644 --- a/client/encointer-api-client-extension/Cargo.toml +++ b/client/encointer-api-client-extension/Cargo.toml @@ -8,6 +8,7 @@ log = { workspace = true } parity-scale-codec = { workspace = true } serde = { workspace = true, features = ["std"] } serde_json = { workspace = true } +tokio = { workspace = true } # encointer deps encointer-ceremonies-assignment = { workspace = true, features = ["std"] } diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index 023222d0..614b8ee3 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -102,8 +102,9 @@ pub trait CeremoniesApi { impl CeremoniesApi for Api { fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result { + tokio::try!( self.get_storage_map(ENCOINTER_CEREMONIES, "Assignments", community_ceremony, None)? - .ok_or_else(|| ApiClientError::Other("Assignments don't exist".into())) + .ok_or_else(|| ApiClientError::Other("Assignments don't exist".into()))) } fn get_assignment_counts( diff --git a/client/encointer-api-client-extension/src/lib.rs b/client/encointer-api-client-extension/src/lib.rs index cc0af1c0..3fa004fe 100644 --- a/client/encointer-api-client-extension/src/lib.rs +++ b/client/encointer-api-client-extension/src/lib.rs @@ -1,6 +1,6 @@ use extrinsic_params::CommunityCurrencyTipExtrinsicParams; use substrate_api_client::{ - ac_primitives::{Config, ExtrinsicSigner, SubstrateKitchensinkConfig, WithExtrinsicParams}, + ac_primitives::{Config, DefaultRuntimeConfig, ExtrinsicSigner, WithExtrinsicParams}, rpc::JsonrpseeClient, }; @@ -8,13 +8,13 @@ pub use encointer_node_notee_runtime::Runtime; pub use substrate_api_client::{api::error::Error as ApiClientError, Result}; pub type EncointerConfig = WithExtrinsicParams< - SubstrateKitchensinkConfig, - CommunityCurrencyTipExtrinsicParams, + DefaultRuntimeConfig, + CommunityCurrencyTipExtrinsicParams, >; pub type Api = substrate_api_client::Api; -pub type ParentchainExtrinsicSigner = ExtrinsicSigner; +pub type ParentchainExtrinsicSigner = ExtrinsicSigner; pub type ExtrinsicAddress = ::Address; pub use ceremonies::*; diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 5bbc02b8..35afd50a 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -6,9 +6,9 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use frame_support::{ - traits::{tokens::ConversionToAssetBalance, ConstU128, EqualPrivilegeOnly, InstanceFilter}, - RuntimeDebug, +use frame_support::derive_impl; +use frame_support::traits::{ + tokens::ConversionToAssetBalance, ConstU128, EqualPrivilegeOnly, InstanceFilter, }; use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, @@ -22,7 +22,7 @@ use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, MultiSignature, + ApplyExtrinsicResult, MultiSignature, RuntimeDebug, }; use sp_std::prelude::*; #[cfg(feature = "std")] @@ -67,8 +67,10 @@ pub use encointer_primitives::{ communities::{CommunityIdentifier, Location}, scheduler::CeremonyPhaseType, }; +use frame_support::traits::tokens::{ConversionFromAssetBalance, PayFromAccount}; use frame_support::traits::ConstBool; use frame_system::{EnsureRoot, EnsureSigned}; +use sp_runtime::traits::IdentityLookup; mod weights; @@ -206,9 +208,9 @@ impl InstanceFilter for ProxyType { ProxyType::NonTransfer => matches!(c, RuntimeCall::EncointerBazaar(..)), ProxyType::BazaarEdit => matches!( c, - RuntimeCall::EncointerBazaar(EncointerBazaarCall::create_offering { .. }) | - RuntimeCall::EncointerBazaar(EncointerBazaarCall::update_offering { .. }) | - RuntimeCall::EncointerBazaar(EncointerBazaarCall::delete_offering { .. }) + RuntimeCall::EncointerBazaar(EncointerBazaarCall::create_offering { .. }) + | RuntimeCall::EncointerBazaar(EncointerBazaarCall::update_offering { .. }) + | RuntimeCall::EncointerBazaar(EncointerBazaarCall::delete_offering { .. }) ), } } @@ -254,7 +256,7 @@ parameter_types! { } // Configure FRAME pallets to include in runtime. - +#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { /// The basic call filter to use in dispatchable. type BaseCallFilter = frame_support::traits::Everything; @@ -266,42 +268,20 @@ impl frame_system::Config for Runtime { type BlockLength = BlockLength; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - /// The aggregated dispatch type that is available for extrinsics. - type RuntimeCall = RuntimeCall; - /// The lookup mechanism to get account ID from whatever is passed in dispatchers. - type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. type Nonce = Index; /// The type for hashing blocks and tries. type Hash = Hash; - /// The hashing algorithm used. - type Hashing = BlakeTwo256; - /// The ubiquitous event type. - type RuntimeEvent = RuntimeEvent; - /// The ubiquitous origin type. - type RuntimeOrigin = RuntimeOrigin; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; /// The weight of database operations that the runtime can invoke. type DbWeight = RocksDbWeight; /// Version of the runtime. type Version = Version; - /// Converts a module to the index of the module in `construct_runtime!`. - /// - /// This type is being generated by `construct_runtime!`. - type PalletInfo = PalletInfo; - /// What to do if a new account is created. - type OnNewAccount = (); - /// What to do if an account is fully reaped from the system. - type OnKilledAccount = (); /// The data to be stored in an account. type AccountData = pallet_balances::AccountData; - /// Weight information for the extrinsics of this pallet. - type SystemWeightInfo = frame_system::weights::SubstrateWeight; /// This is used as an identifier of the chain. 42 is the generic substrate prefix. type SS58Prefix = SS58Prefix; - /// The set code logic, just the default since we're not a parachain. - type OnSetCode = (); type MaxConsumers = frame_support::traits::ConstU32<16>; } @@ -323,13 +303,11 @@ impl pallet_aura::Config for Runtime { impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type KeyOwnerProof = <() as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof; - type EquivocationReportSystem = (); - type WeightInfo = (); // grandpa has default non-zero implementations for `()` type MaxAuthorities = MaxAuthorities; + type MaxNominators = ConstU32<0>; type MaxSetIdSessionEntries = MaxSetIdSessionEntries; } @@ -365,8 +343,8 @@ impl pallet_balances::Config for Runtime { type WeightInfo = pallet_balances::weights::SubstrateWeight; type RuntimeHoldReason = (); type FreezeIdentifier = (); - type MaxHolds = ConstU32<0>; type MaxFreezes = ConstU32<0>; + type RuntimeFreezeReason = (); } parameter_types! { @@ -487,9 +465,21 @@ parameter_types! { pub const ProposalBondMinimum: Balance = 100 * MILLICENTS; pub const ProposalBondMaximum: Balance = 500 * CENTS; pub const SpendPeriod: BlockNumber = 6 * DAYS; + pub const PayoutSpendPeriod: BlockNumber = 6 * DAYS; pub const Burn: Permill = Permill::from_percent(1); pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry"); pub const MaxApprovals: u32 = 10; + pub TreasuryAccount: AccountId = Treasury::account_id(); +} + +pub struct NoConversion; +impl ConversionFromAssetBalance for NoConversion { + type Error = (); + fn from_asset_balance(balance: Balance, _asset_id: ()) -> Result { + return Ok(balance); + } + #[cfg(feature = "runtime-benchmarks")] + fn ensure_successful(_: ()) {} } impl pallet_treasury::Config for Runtime { @@ -509,6 +499,14 @@ impl pallet_treasury::Config for Runtime { type MaxApprovals = MaxApprovals; type WeightInfo = weights::pallet_treasury::WeightInfo; type SpendOrigin = frame_support::traits::NeverEnsureOrigin; //No spend, no bounty + type AssetKind = (); + type Beneficiary = AccountId; + type BeneficiaryLookup = IdentityLookup; + type Paymaster = PayFromAccount; + type BalanceConverter = NoConversion; + type PayoutPeriod = PayoutSpendPeriod; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkHelper = (); } impl pallet_encointer_reputation_commitments::Config for Runtime { @@ -526,15 +524,14 @@ impl pallet_encointer_faucet::Config for Runtime { parameter_types! { pub const ConfirmationPeriod:BlockNumber = 20; - pub const ProposalLifetime: BlockNumber = 40; + pub const ProposalLifetime: Moment = 20 * 60 * 1000; // [ms] } impl pallet_encointer_democracy::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type MaxReputationVecLength = ConstU32<1024>; + type MaxReputationVecLength = ConstU32<64>; type ConfirmationPeriod = ConfirmationPeriod; type ProposalLifetime = ProposalLifetime; - type ProposalLifetimeCycles = ConstU32<1>; type MinTurnout = ConstU128<1>; type WeightInfo = weights::pallet_encointer_democracy::WeightInfo; } diff --git a/runtime/src/weights/pallet_treasury.rs b/runtime/src/weights/pallet_treasury.rs index 1d1872cc..52b59a25 100644 --- a/runtime/src/weights/pallet_treasury.rs +++ b/runtime/src/weights/pallet_treasury.rs @@ -17,24 +17,22 @@ //! Autogenerated weights for `pallet_treasury` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-04-28, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2023-09-22, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 +//! HOSTNAME: `a3dce7bd4066`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("spec-kusama.json")`, DB CACHE: 1024 // Executed Command: -// ./target/production/polkadot +// /builds/polkadot-sdk/target/production/polkadot // benchmark // pallet -// --chain=kusama-dev -// --steps=50 -// --repeat=20 +// --chain=spec-kusama.json // --pallet=pallet_treasury -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --extrinsic= +// --output=/builds/runtimes/relay/kusama/src/weights +// --header=/builds/bench/header.txt +// --no-median-slopes +// --no-min-squares #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -47,105 +45,167 @@ use core::marker::PhantomData; /// Weight functions for `pallet_treasury`. pub struct WeightInfo(PhantomData); impl pallet_treasury::WeightInfo for WeightInfo { - /// Storage: Treasury ProposalCount (r:1 w:1) - /// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:0 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - fn spend() -> Weight { + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + fn spend_local() -> Weight { // Proof Size summary in bytes: // Measured: `6` // Estimated: `1887` - // Minimum execution time: 14_692_000 picoseconds. - Weight::from_parts(15_059_000, 0) + // Minimum execution time: 7_563_000 picoseconds. + Weight::from_parts(7_868_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(3)) } - /// Storage: Treasury ProposalCount (r:1 w:1) - /// Proof: Treasury ProposalCount (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:0 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) + /// Storage: `Treasury::ProposalCount` (r:1 w:1) + /// Proof: `Treasury::ProposalCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:0 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) fn propose_spend() -> Weight { // Proof Size summary in bytes: // Measured: `107` // Estimated: `1489` - // Minimum execution time: 26_358_000 picoseconds. - Weight::from_parts(26_761_000, 0) + // Minimum execution time: 16_827_000 picoseconds. + Weight::from_parts(17_262_000, 0) .saturating_add(Weight::from_parts(0, 1489)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Treasury Proposals (r:1 w:1) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + /// Storage: `Treasury::Proposals` (r:1 w:1) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn reject_proposal() -> Weight { // Proof Size summary in bytes: // Measured: `265` // Estimated: `3593` - // Minimum execution time: 39_586_000 picoseconds. - Weight::from_parts(40_113_000, 0) + // Minimum execution time: 25_789_000 picoseconds. + Weight::from_parts(26_398_000, 0) .saturating_add(Weight::from_parts(0, 3593)) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } - /// Storage: Treasury Proposals (r:1 w:0) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `Treasury::Proposals` (r:1 w:0) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) /// The range of component `p` is `[0, 99]`. fn approve_proposal(p: u32, ) -> Weight { // Proof Size summary in bytes: // Measured: `433 + p * (8 ±0)` // Estimated: `3573` - // Minimum execution time: 9_225_000 picoseconds. - Weight::from_parts(11_898_418, 0) + // Minimum execution time: 5_353_000 picoseconds. + Weight::from_parts(8_423_989, 0) .saturating_add(Weight::from_parts(0, 3573)) - // Standard Error: 888 - .saturating_add(Weight::from_parts(30_177, 0).saturating_mul(p.into())) + // Standard Error: 1_120 + .saturating_add(Weight::from_parts(45_883, 0).saturating_mul(p.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) fn remove_approval() -> Weight { // Proof Size summary in bytes: // Measured: `90` // Estimated: `1887` - // Minimum execution time: 6_896_000 picoseconds. - Weight::from_parts(7_093_000, 0) + // Minimum execution time: 4_075_000 picoseconds. + Weight::from_parts(4_286_000, 0) .saturating_add(Weight::from_parts(0, 1887)) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } - /// Storage: Treasury Deactivated (r:1 w:1) - /// Proof: Treasury Deactivated (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Balances InactiveIssuance (r:1 w:1) - /// Proof: Balances InactiveIssuance (max_values: Some(1), max_size: Some(16), added: 511, mode: MaxEncodedLen) - /// Storage: Treasury Approvals (r:1 w:1) - /// Proof: Treasury Approvals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// Storage: Treasury Proposals (r:100 w:100) - /// Proof: Treasury Proposals (max_values: None, max_size: Some(108), added: 2583, mode: MaxEncodedLen) - /// Storage: System Account (r:201 w:201) - /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: Bounties BountyApprovals (r:1 w:1) - /// Proof: Bounties BountyApprovals (max_values: Some(1), max_size: Some(402), added: 897, mode: MaxEncodedLen) - /// The range of component `p` is `[0, 100]`. + /// Storage: `Treasury::Deactivated` (r:1 w:1) + /// Proof: `Treasury::Deactivated` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Approvals` (r:1 w:1) + /// Proof: `Treasury::Approvals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Proposals` (r:99 w:99) + /// Proof: `Treasury::Proposals` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:199 w:199) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Bounties::BountyApprovals` (r:1 w:1) + /// Proof: `Bounties::BountyApprovals` (`max_values`: Some(1), `max_size`: Some(402), added: 897, mode: `MaxEncodedLen`) + /// The range of component `p` is `[0, 99]`. fn on_initialize_proposals(p: u32, ) -> Weight { // Proof Size summary in bytes: - // Measured: `264 + p * (251 ±0)` + // Measured: `294 + p * (251 ±0)` // Estimated: `3593 + p * (5206 ±0)` - // Minimum execution time: 62_552_000 picoseconds. - Weight::from_parts(65_526_861, 0) + // Minimum execution time: 34_895_000 picoseconds. + Weight::from_parts(40_046_318, 0) .saturating_add(Weight::from_parts(0, 3593)) - // Standard Error: 20_034 - .saturating_add(Weight::from_parts(37_730_613, 0).saturating_mul(p.into())) - .saturating_add(T::DbWeight::get().reads(5)) + // Standard Error: 6_188 + .saturating_add(Weight::from_parts(25_772_314, 0).saturating_mul(p.into())) + .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(p.into()))) - .saturating_add(T::DbWeight::get().writes(5)) + .saturating_add(T::DbWeight::get().writes(4)) .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(p.into()))) .saturating_add(Weight::from_parts(0, 5206).saturating_mul(p.into())) } + /// Storage: `Treasury::SpendCount` (r:1 w:1) + /// Proof: `Treasury::SpendCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Treasury::Spends` (r:0 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `6` + // Estimated: `1489` + // Minimum execution time: 8_598_000 picoseconds. + Weight::from_parts(8_937_000, 0) + .saturating_add(Weight::from_parts(0, 1489)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `XcmPallet::QueryCounter` (r:1 w:1) + /// Proof: `XcmPallet::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DeliveryFeeFactor` (r:1 w:0) + /// Proof: `Dmp::DeliveryFeeFactor` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmPallet::SupportedVersion` (r:1 w:0) + /// Proof: `XcmPallet::SupportedVersion` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DownwardMessageQueues` (r:1 w:1) + /// Proof: `Dmp::DownwardMessageQueues` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `Dmp::DownwardMessageQueueHeads` (r:1 w:1) + /// Proof: `Dmp::DownwardMessageQueueHeads` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `XcmPallet::Queries` (r:0 w:1) + /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn payout() -> Weight { + // Proof Size summary in bytes: + // Measured: `251` + // Estimated: `5318` + // Minimum execution time: 29_981_000 picoseconds. + Weight::from_parts(30_787_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(6)) + .saturating_add(T::DbWeight::get().writes(5)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + /// Storage: `XcmPallet::Queries` (r:1 w:1) + /// Proof: `XcmPallet::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + fn check_status() -> Weight { + // Proof Size summary in bytes: + // Measured: `170` + // Estimated: `5318` + // Minimum execution time: 15_985_000 picoseconds. + Weight::from_parts(16_431_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } + /// Storage: `Treasury::Spends` (r:1 w:1) + /// Proof: `Treasury::Spends` (`max_values`: None, `max_size`: Some(1853), added: 4328, mode: `MaxEncodedLen`) + fn void_spend() -> Weight { + // Proof Size summary in bytes: + // Measured: `142` + // Estimated: `5318` + // Minimum execution time: 8_515_000 picoseconds. + Weight::from_parts(8_795_000, 0) + .saturating_add(Weight::from_parts(0, 5318)) + .saturating_add(T::DbWeight::get().reads(1)) + .saturating_add(T::DbWeight::get().writes(1)) + } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 38a95c9f..b01d6494 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-02-08" +channel = "stable" profile = "default" # include rustfmt, clippy components = [ "cargo", @@ -8,7 +8,6 @@ components = [ "rust-src", "rust-std", "rustc", - "rustc-dev", "rustfmt", ] targets = ["wasm32-unknown-unknown"] From 9f92dd5f9c6e3ef55fb71dc4bef7ad934888da8e Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sat, 2 Mar 2024 20:44:42 +0100 Subject: [PATCH 10/41] node upgrades --- Cargo.lock | 1 + Cargo.toml | 1 + .../src/ceremonies.rs | 34 +-- node/Cargo.toml | 1 + node/src/benchmarking.rs | 26 +- node/src/chain_spec.rs | 252 +++++++----------- node/src/cli.rs | 16 +- node/src/command.rs | 37 +-- node/src/main.rs | 5 +- node/src/service.rs | 114 +++----- runtime/src/lib.rs | 2 +- 11 files changed, 184 insertions(+), 305 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cdf97971..63e59e96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2181,6 +2181,7 @@ dependencies = [ "pallet-encointer-communities-rpc-runtime-api", "pallet-transaction-payment-rpc", "sc-basic-authorship", + "sc-chain-spec", "sc-cli", "sc-client-api", "sc-consensus", diff --git a/Cargo.toml b/Cargo.toml index 373e6fda..491faf67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,6 +71,7 @@ pallet-transaction-payment-rpc-runtime-api = { version = "30.0.0", default-featu pallet-treasury = { default-features = false, version = "29.0.0" } pallet-utility = { version = "30.0.0", default-features = false } sc-basic-authorship = { version = "0.36.0" } +sc-chain-spec = "29.0.0" sc-cli = { version = "0.38.0" } sc-client-api = { version = "30.0.0" } sc-consensus = { version = "0.35.0" } diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index 614b8ee3..e2654a18 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -102,9 +102,8 @@ pub trait CeremoniesApi { impl CeremoniesApi for Api { fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result { - tokio::try!( self.get_storage_map(ENCOINTER_CEREMONIES, "Assignments", community_ceremony, None)? - .ok_or_else(|| ApiClientError::Other("Assignments don't exist".into()))) + .ok_or_else(|| ApiClientError::Other("Assignments don't exist".into())) } fn get_assignment_counts( @@ -187,13 +186,13 @@ impl CeremoniesApi for Api { }; if let Some(p_index) = index_query("BootstrapperIndex")? { - return Ok(Registration::new(p_index, RegistrationType::Bootstrapper)) + return Ok(Registration::new(p_index, RegistrationType::Bootstrapper)); } else if let Some(p_index) = index_query("ReputableIndex")? { - return Ok(Registration::new(p_index, RegistrationType::Reputable)) + return Ok(Registration::new(p_index, RegistrationType::Reputable)); } else if let Some(p_index) = index_query("EndorseeIndex")? { - return Ok(Registration::new(p_index, RegistrationType::Endorsee)) + return Ok(Registration::new(p_index, RegistrationType::Endorsee)); } else if let Some(p_index) = index_query("NewbieIndex")? { - return Ok(Registration::new(p_index, RegistrationType::Newbie)) + return Ok(Registration::new(p_index, RegistrationType::Newbie)); } Err(ApiClientError::Other( @@ -216,7 +215,7 @@ impl CeremoniesApi for Api { if meetup_count == 0 { warn!("Meetup Count is 0."); - return Ok(None) + return Ok(None); } let assignments = self.get_assignments(community_ceremony)?; @@ -234,16 +233,19 @@ impl CeremoniesApi for Api { // Finally get the meetup index match registration.registration_type { - RegistrationType::Bootstrapper => - Ok(meetup_index_fn(registration.index - 1, assignments.bootstrappers_reputables)), + RegistrationType::Bootstrapper => { + Ok(meetup_index_fn(registration.index - 1, assignments.bootstrappers_reputables)) + }, RegistrationType::Reputable => Ok(meetup_index_fn( registration.index - 1 + bootstrapper_count()?, assignments.bootstrappers_reputables, )), - RegistrationType::Endorsee => - Ok(meetup_index_fn(registration.index - 1, assignments.endorsees)), - RegistrationType::Newbie => - Ok(meetup_index_fn(registration.index - 1, assignments.newbies)), + RegistrationType::Endorsee => { + Ok(meetup_index_fn(registration.index - 1, assignments.endorsees)) + }, + RegistrationType::Newbie => { + Ok(meetup_index_fn(registration.index - 1, assignments.newbies)) + }, } } @@ -272,7 +274,7 @@ impl CeremoniesApi for Api { "Invalid meetup index > meetup count: {meetup_index_zero_based}, {meetup_count}" ) .into(), - )) + )); } let params = self.get_assignments(community_ceremony)?; @@ -401,9 +403,9 @@ fn get_bootstrapper_or_reputable( assigned: &AssignmentCount, ) -> Result> { if p_index < assigned.bootstrappers { - return api.get_bootstrapper(community_ceremony, &(p_index + 1)) + return api.get_bootstrapper(community_ceremony, &(p_index + 1)); } else if p_index < assigned.bootstrappers + assigned.reputables { - return api.get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1)) + return api.get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1)); } Ok(None) diff --git a/node/Cargo.toml b/node/Cargo.toml index dd8cdf53..c2ab85b6 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -57,6 +57,7 @@ sp-timestamp = { workspace = true, features = ["std"] } jsonrpsee = { version = "0.16.2", features = ["server"] } pallet-transaction-payment-rpc = { workspace = true } sc-basic-authorship = { workspace = true } +sc-chain-spec = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sp-api = { workspace = true, features = ["std"] } diff --git a/node/src/benchmarking.rs b/node/src/benchmarking.rs index 9bbe72e1..b0a75303 100644 --- a/node/src/benchmarking.rs +++ b/node/src/benchmarking.rs @@ -1,23 +1,6 @@ -// This file is part of Substrate. - -// Copyright (C) 2022 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -//! Contains code to setup the command invocations in [`super::command`] which would -//! otherwise bloat that module. +//! Setup code for [`super::command`] which would otherwise bloat that module. +//! +//! Should only be used for benchmarking as it may break in other contexts. use crate::service::FullClient; @@ -108,6 +91,7 @@ impl frame_benchmarking_cli::ExtrinsicBuilder for TransferKeepAliveBuilder { Ok(extrinsic) } } + /// Create a transaction using the given `call`. /// /// Note: Should only be used for benchmarking. @@ -171,6 +155,6 @@ pub fn inherent_benchmark_data() -> Result { let timestamp = sp_timestamp::InherentDataProvider::new(d.into()); futures::executor::block_on(timestamp.provide_inherent_data(&mut inherent_data)) - .map_err(|e| format!("creating inherent data: {e:?}"))?; + .map_err(|e| format!("creating inherent data: {:?}", e))?; Ok(inherent_data) } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 22b6caba..8e11db46 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,15 +1,11 @@ -use encointer_node_notee_runtime::{ - AccountId, AuraConfig, BalanceType, BalancesConfig, CeremonyPhaseType, EncointerBalancesConfig, - EncointerCeremoniesConfig, EncointerCommunitiesConfig, EncointerDemocracyConfig, - EncointerFaucetConfig, EncointerSchedulerConfig, GrandpaConfig, RuntimeGenesisConfig, - Signature, SudoConfig, SystemConfig, WASM_BINARY, -}; +use encointer_node_notee_runtime::BalanceType; +use encointer_node_notee_runtime::CeremonyPhaseType; +use encointer_node_notee_runtime::{AccountId, RuntimeGenesisConfig, Signature, WASM_BINARY}; use sc_service::{ChainType, Properties}; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_core::{sr25519, Pair, Public}; use sp_runtime::traits::{IdentifyAccount, Verify}; - // The URL for the telemetry server. // const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/"; @@ -38,180 +34,130 @@ pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) { (get_from_seed::(s), get_from_seed::(s)) } -fn properties() -> Option { - serde_json::from_str( - r#"{ - "ss58Format": 42, - "tokenDecimals": 12, - "tokenSymbol": "ERT" - }"#, - ) - .ok() +fn gesell_properties() -> Properties { + let mut properties = sc_chain_spec::Properties::new(); + properties.insert("tokenSymbol".into(), "ERT".into()); + properties.insert("tokenDecimals".into(), 12.into()); + properties.insert("ss58Format".into(), 2.into()); + properties } pub fn development_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - // Name - "Development", - // ID - "dev", - ChainType::Development, - move || { - testnet_genesis( - wasm_binary, - // Initial PoA authorities - vec![authority_keys_from_seed("Alice")], - // Sudo account - get_account_id_from_seed::("Alice"), - // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - ], - true, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Arbitrary string. Nodes will only synchronize with other nodes that have the same value - // in their `fork_id`. This can be used in order to segregate nodes in cases when multiple - // chains have the same genesis hash. - None, - // Properties - properties(), - // Extensions + Ok(ChainSpec::builder( + WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?, None, + ) + .with_name("Development") + .with_id("dev") + .with_chain_type(ChainType::Development) + .with_properties(gesell_properties()) + .with_genesis_config_patch(testnet_genesis( + // Initial PoA authorities + vec![authority_keys_from_seed("Alice")], + // Sudo account + get_account_id_from_seed::("Alice"), + // Pre-funded accounts + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + ], + true, )) + .build()) } pub fn local_testnet_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - // Name - "Local Testnet", - // ID - "local_testnet", - ChainType::Local, - move || { - testnet_genesis( - wasm_binary, - // Initial PoA authorities - vec![authority_keys_from_seed("Alice"), authority_keys_from_seed("Bob")], - // Sudo account - get_account_id_from_seed::("Alice"), - // Pre-funded accounts - vec![ - get_account_id_from_seed::("Alice"), - get_account_id_from_seed::("Bob"), - get_account_id_from_seed::("Charlie"), - get_account_id_from_seed::("Dave"), - get_account_id_from_seed::("Eve"), - get_account_id_from_seed::("Ferdie"), - get_account_id_from_seed::("Alice//stash"), - get_account_id_from_seed::("Bob//stash"), - get_account_id_from_seed::("Charlie//stash"), - get_account_id_from_seed::("Dave//stash"), - get_account_id_from_seed::("Eve//stash"), - get_account_id_from_seed::("Ferdie//stash"), - ], - true, - ) - }, - // Bootnodes - vec![], - // Telemetry - None, - // Protocol ID - None, - // Arbitrary string. Nodes will only synchronize with other nodes that have the same value - // in their `fork_id`. This can be used in order to segregate nodes in cases when multiple - // chains have the same genesis hash. - None, - // Properties - properties(), - // Extensions + Ok(ChainSpec::builder( + WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?, None, + ) + .with_name("Local Testnet") + .with_id("local_testnet") + .with_chain_type(ChainType::Local) + .with_properties(gesell_properties()) + .with_genesis_config_patch(testnet_genesis( + // Initial PoA authorities + vec![authority_keys_from_seed("Alice"), authority_keys_from_seed("Bob")], + // Sudo account + get_account_id_from_seed::("Alice"), + // Pre-funded accounts + vec![ + get_account_id_from_seed::("Alice"), + get_account_id_from_seed::("Bob"), + get_account_id_from_seed::("Charlie"), + get_account_id_from_seed::("Dave"), + get_account_id_from_seed::("Eve"), + get_account_id_from_seed::("Ferdie"), + get_account_id_from_seed::("Alice//stash"), + get_account_id_from_seed::("Bob//stash"), + get_account_id_from_seed::("Charlie//stash"), + get_account_id_from_seed::("Dave//stash"), + get_account_id_from_seed::("Eve//stash"), + get_account_id_from_seed::("Ferdie//stash"), + ], + true, )) + .build()) } /// Configure initial storage state for FRAME modules. fn testnet_genesis( - wasm_binary: &[u8], initial_authorities: Vec<(AuraId, GrandpaId)>, root_key: AccountId, endowed_accounts: Vec, _enable_println: bool, -) -> RuntimeGenesisConfig { - RuntimeGenesisConfig { - system: SystemConfig { - // Add Wasm runtime to storage. - code: wasm_binary.to_vec(), - _config: Default::default(), - }, - balances: BalancesConfig { +) -> serde_json::Value { + serde_json::json!({ + "balances": { // Configure endowed accounts with initial balance of 1 << 60. - balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + "balances": endowed_accounts.iter().cloned().map(|k| (k, 1u64 << 60)).collect::>(), }, - aura: AuraConfig { - authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(), + "aura": { + "authorities": initial_authorities.iter().map(|x| (x.0.clone())).collect::>(), }, - grandpa: GrandpaConfig { - authorities: initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect(), - _config: Default::default(), + "grandpa": { + "authorities": initial_authorities.iter().map(|x| (x.1.clone(), 1)).collect::>(), }, - sudo: SudoConfig { + "sudo": { // Assign network admin rights. - key: Some(root_key), + "key": Some(root_key), }, - transaction_payment: Default::default(), - encointer_scheduler: EncointerSchedulerConfig { - current_phase: CeremonyPhaseType::Registering, - current_ceremony_index: 1, - phase_durations: vec![ - (CeremonyPhaseType::Registering, 57600000), - (CeremonyPhaseType::Assigning, 28800000), - (CeremonyPhaseType::Attesting, 172800000), + "encointerScheduler": { + "currentPhase": CeremonyPhaseType::Registering, + "currentCeremonyIndex": 1, + "phaseDurations": vec![ + (CeremonyPhaseType::Registering, 604800000u64), // 7d + (CeremonyPhaseType::Assigning, 86400000u64), // 1d + (CeremonyPhaseType::Attesting, 172800000u64), // 2d ], - _config: Default::default(), - }, - encointer_ceremonies: EncointerCeremoniesConfig { - ceremony_reward: BalanceType::from_num(1), - time_tolerance: 600_000, // +-10min - location_tolerance: 1_000, // [m] - endorsement_tickets_per_bootstrapper: 5, - reputation_lifetime: 337, // 7.02 days at 30min ceremony cycle - inactivity_timeout: 168500, // 10 years at 30min ceremony cycle - meetup_time_offset: 0, - endorsement_tickets_per_reputable: 5, - _config: Default::default(), }, - encointer_communities: EncointerCommunitiesConfig { - min_solar_trip_time_s: 1, // [s] - max_speed_mps: 1, // [m/s] suggested would be 83m/s, - _config: Default::default(), + "encointerCeremonies": { + "ceremonyReward": BalanceType::from_num(1), + "timeTolerance": 600_000u64, // +-10min + "locationTolerance": 1_000, // [m] + "endorsementTicketsPerBootstrapper": 5, + "endorsementTicketsPerReputable": 5, + "reputationLifetime": 337, + "inactivityTimeout": 168500, // idle ceremonies before purging community + "meetupTimeOffset": 0, }, - encointer_balances: EncointerBalancesConfig { - // Lower values lead to lower fees in CC proportionally. - // Translates to 0.01 CC-fee per 5muKSM fee at 20 CC nominal income - fee_conversion_factor: 100_000, - _config: Default::default(), + "encointerCommunities": { + "minSolarTripTimeS": 1, // [s] + "maxSpeedMps": 1, // [m/s] suggested would be 83m/s for security, }, - encointer_faucet: EncointerFaucetConfig { - reserve_amount: 100_000_000_000_000, - _config: Default::default(), + "encointerBalances": { + // for relative adjustment. + // 100_000 translates 5uKSM to 0.01 CC if ceremony reward is 20 CC + // lower values lead to lower fees in CC proportionally + "feeConversionFactor": 100_000u32, }, - encointer_democracy: EncointerDemocracyConfig { - proposal_count: 0, - _config: Default::default(), + "encointerFaucet": { + "reserveAmount": 10_000_000_000_000u128, }, - } + "encointerDemocracy": { + "proposalCount": 0 + } + }) } diff --git a/node/src/cli.rs b/node/src/cli.rs index 4ab4d342..98037eb8 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -2,7 +2,7 @@ use sc_cli::RunCmd; #[derive(Debug, clap::Parser)] pub struct Cli { - #[clap(subcommand)] + #[command(subcommand)] pub subcommand: Option, #[clap(flatten)] @@ -10,9 +10,10 @@ pub struct Cli { } #[derive(Debug, clap::Subcommand)] +#[allow(clippy::large_enum_variant)] pub enum Subcommand { /// Key management cli utilities - #[clap(subcommand)] + #[command(subcommand)] Key(sc_cli::KeySubcommand), /// Build a chain specification. @@ -37,15 +38,12 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Sub-commands concerned with benchmarking. - #[clap(subcommand)] + #[command(subcommand)] Benchmark(frame_benchmarking_cli::BenchmarkCmd), - /// Try some command against runtime state. - #[cfg(feature = "try-runtime")] - TryRuntime(try_runtime_cli::TryRuntimeCmd), - - /// Try some command against runtime state. Note: `try-runtime` feature must be enabled. - #[cfg(not(feature = "try-runtime"))] + /// Try-runtime has migrated to a standalone CLI + /// (). The subcommand exists as a stub and + /// deprecation notice. It will be removed entirely some time after Janurary 2024. TryRuntime, /// Db meta columns information. diff --git a/node/src/command.rs b/node/src/command.rs index 5d5d68af..7287c2f9 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -59,8 +59,9 @@ impl SubstrateCli for Cli { Ok(match id { "dev" => Box::new(chain_spec::development_config()?), "" | "local" => Box::new(chain_spec::local_testnet_config()?), - path => - Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), + path => { + Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?) + }, }) } } @@ -134,10 +135,10 @@ pub fn run() -> sc_cli::Result<()> { "Runtime benchmarking wasn't enabled when building the node. \ You can enable it with `--features runtime-benchmarks`." .into(), - ) + ); } - cmd.run::(config) + cmd.run::, ()>(config) }, BenchmarkCmd::Block(cmd) => { let PartialComponents { client, .. } = service::new_partial(&config)?; @@ -183,34 +184,14 @@ pub fn run() -> sc_cli::Result<()> { cmd.run(client, inherent_benchmark_data()?, Vec::new(), &ext_factory) }, - BenchmarkCmd::Machine(cmd) => - cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()), + BenchmarkCmd::Machine(cmd) => { + cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()) + }, } }) }, #[cfg(feature = "try-runtime")] - Some(Subcommand::TryRuntime(cmd)) => { - use crate::service::ExecutorDispatch; - use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch}; - let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { - // we don't need any of the components of new_partial, just a runtime, or a task - // manager to do `async_run`. - let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry); - let task_manager = - sc_service::TaskManager::new(config.tokio_handle.clone(), registry) - .map_err(|e| sc_cli::Error::Service(sc_service::Error::Prometheus(e)))?; - let info_provider = timestamp_with_aura_info(6000); - - Ok(( - cmd.run::::ExtendHostFunctions, - >, _>(Some(info_provider)), - task_manager, - )) - }) - }, + Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()), #[cfg(not(feature = "try-runtime"))] Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \ You can enable it with `--features try-runtime`." diff --git a/node/src/main.rs b/node/src/main.rs index 426cbabb..8918dd43 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -1,13 +1,12 @@ //! Substrate Node Template CLI library. #![warn(missing_docs)] -mod chain_spec; -#[macro_use] -mod service; mod benchmarking; +mod chain_spec; mod cli; mod command; mod rpc; +mod service; fn main() -> sc_cli::Result<()> { command::run() diff --git a/node/src/service.rs b/node/src/service.rs index 256c933b..9d0ab8aa 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -5,62 +5,38 @@ use futures::FutureExt; use sc_client_api::{Backend, BlockBackend}; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; use sc_consensus_grandpa::SharedVoterState; -pub use sc_executor::NativeElseWasmExecutor; -use sc_executor::{HeapAllocStrategy, DEFAULT_HEAP_ALLOC_STRATEGY}; -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use sc_service::{error::Error as ServiceError, Configuration, TaskManager, WarpSyncParams}; use sc_telemetry::{Telemetry, TelemetryWorker}; use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use std::{sync::Arc, time::Duration}; -// Our native executor instance. -pub struct ExecutorDispatch; - -impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { - /// Only enable the benchmarking host functions when we actually want to benchmark. - #[cfg(feature = "runtime-benchmarks")] - type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; - /// Otherwise we only use the default Substrate host functions. - #[cfg(not(feature = "runtime-benchmarks"))] - type ExtendHostFunctions = (); - - fn dispatch(method: &str, data: &[u8]) -> Option> { - encointer_node_notee_runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - encointer_node_notee_runtime::native_version() - } -} - -pub(crate) type FullClient = - sc_service::TFullClient>; +pub(crate) type FullClient = sc_service::TFullClient< + Block, + RuntimeApi, + sc_executor::WasmExecutor, +>; type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; -#[allow(clippy::type_complexity)] -pub fn new_partial( - config: &Configuration, -) -> Result< - sc_service::PartialComponents< - FullClient, - FullBackend, - FullSelectChain, - sc_consensus::DefaultImportQueue, - sc_transaction_pool::FullPool, - ( - sc_consensus_grandpa::GrandpaBlockImport< - FullBackend, - Block, - FullClient, - FullSelectChain, - >, - sc_consensus_grandpa::LinkHalf, - Option, - ), - >, - ServiceError, -> { +/// The minimum period of blocks on which justifications will be +/// imported and generated. +const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; + +pub type Service = sc_service::PartialComponents< + FullClient, + FullBackend, + FullSelectChain, + sc_consensus::DefaultImportQueue, + sc_transaction_pool::FullPool, + ( + sc_consensus_grandpa::GrandpaBlockImport, + sc_consensus_grandpa::LinkHalf, + Option, + ), +>; + +pub fn new_partial(config: &Configuration) -> Result { let telemetry = config .telemetry_endpoints .clone() @@ -72,19 +48,7 @@ pub fn new_partial( }) .transpose()?; - let heap_pages = config - .default_heap_pages - .map_or(DEFAULT_HEAP_ALLOC_STRATEGY, |h| HeapAllocStrategy::Static { extra_pages: h as _ }); - - let executor = sc_executor::WasmExecutor::builder() - .with_execution_method(config.wasm_method) - .with_max_runtime_instances(config.max_runtime_instances) - .with_runtime_cache_size(config.runtime_cache_size) - .with_onchain_heap_alloc_strategy(heap_pages) - .with_offchain_heap_alloc_strategy(heap_pages) - .build(); - let executor = NativeElseWasmExecutor::::new_with_wasm_executor(executor); - + let executor = sc_service::new_wasm_executor::(config); let (client, backend, keystore_container, task_manager) = sc_service::new_full_parts::( config, @@ -110,7 +74,8 @@ pub fn new_partial( let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( client.clone(), - &(client.clone() as Arc<_>), + GRANDPA_JUSTIFICATION_PERIOD, + &client, select_chain.clone(), telemetry.as_ref().map(|x| x.handle()), )?; @@ -171,10 +136,9 @@ pub fn new_full(config: Configuration) -> Result { &client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"), &config.chain_spec, ); - - net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config( - grandpa_protocol_name.clone(), - )); + let (grandpa_protocol_config, grandpa_notification_service) = + sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()); + net_config.add_notification_protocol(grandpa_protocol_config); let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new( backend.clone(), @@ -191,7 +155,8 @@ pub fn new_full(config: Configuration) -> Result { spawn_handle: task_manager.spawn_handle(), import_queue, block_announce_validator_builder: None, - warp_sync_params: Some(sc_service::WarpSyncParams::WithProvider(warp_sync)), + warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)), + block_relay: None, })?; if config.offchain_worker.enabled { @@ -243,17 +208,17 @@ pub fn new_full(config: Configuration) -> Result { }; let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { - rpc_builder: rpc_extensions_builder, + network: network.clone(), client: client.clone(), - transaction_pool: transaction_pool.clone(), - task_manager: &mut task_manager, - config, keystore: keystore_container.keystore(), + task_manager: &mut task_manager, + transaction_pool: transaction_pool.clone(), + rpc_builder: rpc_extensions_builder, backend, - network: network.clone(), - sync_service: sync_service.clone(), system_rpc_tx, tx_handler_controller, + sync_service: sync_service.clone(), + config, telemetry: telemetry.as_mut(), })?; @@ -313,7 +278,7 @@ pub fn new_full(config: Configuration) -> Result { let grandpa_config = sc_consensus_grandpa::Config { // FIXME #1578 make this available through chainspec gossip_duration: Duration::from_millis(333), - justification_period: 512, + justification_generation_period: GRANDPA_JUSTIFICATION_PERIOD, name: Some(name), observer_enabled: false, keystore, @@ -333,6 +298,7 @@ pub fn new_full(config: Configuration) -> Result { link: grandpa_link, network, sync: Arc::new(sync_service), + notification_service: grandpa_notification_service, voting_rule: sc_consensus_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, shared_voter_state: SharedVoterState::empty(), diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 35afd50a..60b6fdce 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -20,7 +20,7 @@ use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_core::{crypto::KeyTypeId, ConstU32, OpaqueMetadata}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, - traits::{AccountIdLookup, BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, Verify}, + traits::{BlakeTwo256, Block as BlockT, IdentifyAccount, NumberFor, Verify}, transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, MultiSignature, RuntimeDebug, }; From 72d97d3a1f66b355bf15415843826ef994420e7f Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sat, 2 Mar 2024 21:02:38 +0100 Subject: [PATCH 11/41] fix node build --- Cargo.lock | 142 ++++++++---------------------------------------- node/Cargo.toml | 2 +- 2 files changed, 24 insertions(+), 120 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63e59e96..69b15c14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -846,16 +846,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "bstr" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" -dependencies = [ - "memchr", - "serde", -] - [[package]] name = "build-helper" version = "0.1.1" @@ -2074,7 +2064,7 @@ dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "pallet-transaction-payment", "pallet-transaction-payment-rpc", @@ -2170,7 +2160,7 @@ dependencies = [ "frame-system", "frame-try-runtime", "futures", - "jsonrpsee 0.16.3", + "jsonrpsee", "log", "pallet-asset-tx-payment", "pallet-encointer-bazaar-rpc", @@ -2294,9 +2284,9 @@ dependencies = [ name = "encointer-rpc" version = "7.0.0" dependencies = [ - "jsonrpsee 0.22.0", - "jsonrpsee-core 0.22.0", - "jsonrpsee-types 0.22.0", + "jsonrpsee", + "jsonrpsee-core", + "jsonrpsee-types", "thiserror", ] @@ -3138,19 +3128,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "globset" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" -dependencies = [ - "aho-corasick", - "bstr", - "log", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", -] - [[package]] name = "governor" version = "0.6.0" @@ -3707,17 +3684,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonrpsee" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" -dependencies = [ - "jsonrpsee-core 0.16.3", - "jsonrpsee-server 0.16.3", - "jsonrpsee-types 0.16.3", -] - [[package]] name = "jsonrpsee" version = "0.22.0" @@ -3725,10 +3691,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a95f7cc23d5fab0cdeeaf6bad8c8f5e7a3aa7f0d211957ea78232b327ab27b0" dependencies = [ "jsonrpsee-client-transport", - "jsonrpsee-core 0.22.0", + "jsonrpsee-core", "jsonrpsee-proc-macros", - "jsonrpsee-server 0.22.0", - "jsonrpsee-types 0.22.0", + "jsonrpsee-server", + "jsonrpsee-types", "tokio", "tracing", ] @@ -3741,7 +3707,7 @@ checksum = "6b1736cfa3845fd9f8f43751f2b8e0e83f7b6081e754502f7d63b6587692cc83" dependencies = [ "futures-util", "http", - "jsonrpsee-core 0.22.0", + "jsonrpsee-core", "pin-project", "rustls-native-certs 0.7.0", "rustls-pki-types", @@ -3754,32 +3720,6 @@ dependencies = [ "url", ] -[[package]] -name = "jsonrpsee-core" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" -dependencies = [ - "anyhow", - "arrayvec 0.7.4", - "async-trait", - "beef", - "futures-channel", - "futures-util", - "globset", - "hyper", - "jsonrpsee-types 0.16.3", - "parking_lot 0.12.1", - "rand 0.8.5", - "rustc-hash", - "serde", - "serde_json", - "soketto", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "jsonrpsee-core" version = "0.22.0" @@ -3793,7 +3733,7 @@ dependencies = [ "futures-timer", "futures-util", "hyper", - "jsonrpsee-types 0.22.0", + "jsonrpsee-types", "parking_lot 0.12.1", "pin-project", "rand 0.8.5", @@ -3819,28 +3759,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "jsonrpsee-server" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" -dependencies = [ - "futures-channel", - "futures-util", - "http", - "hyper", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", - "serde", - "serde_json", - "soketto", - "tokio", - "tokio-stream", - "tokio-util", - "tower", - "tracing", -] - [[package]] name = "jsonrpsee-server" version = "0.22.0" @@ -3850,8 +3768,8 @@ dependencies = [ "futures-util", "http", "hyper", - "jsonrpsee-core 0.22.0", - "jsonrpsee-types 0.22.0", + "jsonrpsee-core", + "jsonrpsee-types", "pin-project", "route-recognizer", "serde", @@ -3865,20 +3783,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "jsonrpsee-types" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" -dependencies = [ - "anyhow", - "beef", - "serde", - "serde_json", - "thiserror", - "tracing", -] - [[package]] name = "jsonrpsee-types" version = "0.22.0" @@ -5326,7 +5230,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "pallet-encointer-bazaar-rpc-runtime-api", "parity-scale-codec", @@ -5380,7 +5284,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "pallet-encointer-ceremonies-rpc-runtime-api", "parity-scale-codec", @@ -5428,7 +5332,7 @@ version = "7.0.0" dependencies = [ "encointer-primitives", "encointer-rpc", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "pallet-encointer-communities-rpc-runtime-api", "parity-scale-codec", @@ -5690,7 +5594,7 @@ version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4fac4e459db3c002ddebfbce82d055dbe8885eb4c2f9dcd9da5675eafef9bb7" dependencies = [ - "jsonrpsee 0.22.0", + "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", @@ -7746,7 +7650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61faa018966cb794e36be31af4ed4d19deaa93c751ff32512637c7bca104e9e8" dependencies = [ "futures", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -7778,7 +7682,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f716a273af4f4782430ebe4fe6d0f8b1490ff7c103dc78193706bfff370c250f" dependencies = [ - "jsonrpsee 0.22.0", + "jsonrpsee", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -7803,7 +7707,7 @@ dependencies = [ "governor", "http", "hyper", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "pin-project", "serde_json", @@ -7823,7 +7727,7 @@ dependencies = [ "futures", "futures-util", "hex", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -7856,7 +7760,7 @@ dependencies = [ "exit-future", "futures", "futures-timer", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9455,7 +9359,7 @@ dependencies = [ "frame-support", "futures-util", "hex", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "maybe-async", "parity-scale-codec", @@ -9525,7 +9429,7 @@ checksum = "74fba95234990a0eecb3199ee2589112a1a3763db1fa7739a316f3e26f7693c9" dependencies = [ "frame-system-rpc-runtime-api", "futures", - "jsonrpsee 0.22.0", + "jsonrpsee", "log", "parity-scale-codec", "sc-rpc-api", diff --git a/node/Cargo.toml b/node/Cargo.toml index c2ab85b6..e8d86117 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -54,7 +54,7 @@ sp-runtime = { workspace = true, features = ["std"] } sp-timestamp = { workspace = true, features = ["std"] } # These dependencies are used for the node's RPCs -jsonrpsee = { version = "0.16.2", features = ["server"] } +jsonrpsee = { workspace = true } pallet-transaction-payment-rpc = { workspace = true } sc-basic-authorship = { workspace = true } sc-chain-spec = { workspace = true } From 60468a0047a03a1ff5fdefa375acfb9825db2582 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sat, 2 Mar 2024 22:43:42 +0100 Subject: [PATCH 12/41] try async jsonrpsee --- .../src/ceremonies.rs | 148 ++++++++++-------- .../src/communities.rs | 4 +- .../src/scheduler.rs | 16 +- 3 files changed, 94 insertions(+), 74 deletions(-) diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index e2654a18..1fdf90d9 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -22,78 +22,81 @@ pub const ENCOINTER_CEREMONIES: &str = "EncointerCeremonies"; pub const ONE_DAY: Moment = 86_400_000; pub trait CeremoniesApi { - fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result; - fn get_assignment_counts( + async fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result; + async fn get_assignment_counts( &self, community_ceremony: &CommunityCeremony, ) -> Result; - fn get_bootstrapper( + async fn get_bootstrapper( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_reputable( + async fn get_reputable( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_endorsee( + async fn get_endorsee( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_newbie( + async fn get_newbie( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, ) -> Result>; - fn get_registration( + async fn get_registration( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result; - fn get_meetup_count(&self, community_ceremony: &CommunityCeremony) -> Result; + async fn get_meetup_count( + &self, + community_ceremony: &CommunityCeremony, + ) -> Result; - fn get_meetup_index( + async fn get_meetup_index( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result>; - fn get_meetup_location( + async fn get_meetup_location( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result>; - fn get_meetup_participants( + async fn get_meetup_participants( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result>; - fn get_meetup_time_offset(&self) -> Result>; + async fn get_meetup_time_offset(&self) -> Result>; - fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result; + async fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result; - fn get_community_ceremony_stats( + async fn get_community_ceremony_stats( &self, community_ceremony: CommunityCeremony, ) -> Result; - fn get_attestees( + async fn get_attestees( &self, community_ceremony: CommunityCeremony, participant_index: ParticipantIndexType, ) -> Result>; - fn get_meetup_participant_count_vote( + async fn get_meetup_participant_count_vote( &self, community_ceremony: CommunityCeremony, account_id: AccountId, @@ -101,20 +104,22 @@ pub trait CeremoniesApi { } impl CeremoniesApi for Api { - fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result { - self.get_storage_map(ENCOINTER_CEREMONIES, "Assignments", community_ceremony, None)? + async fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result { + self.get_storage_map(ENCOINTER_CEREMONIES, "Assignments", community_ceremony, None) + .await? .ok_or_else(|| ApiClientError::Other("Assignments don't exist".into())) } - fn get_assignment_counts( + async fn get_assignment_counts( &self, community_ceremony: &CommunityCeremony, ) -> Result { - self.get_storage_map(ENCOINTER_CEREMONIES, "AssignmentCounts", community_ceremony, None)? + self.get_storage_map(ENCOINTER_CEREMONIES, "AssignmentCounts", community_ceremony, None) + .await? .ok_or_else(|| ApiClientError::Other("AssignmentCounts not found".into())) } - fn get_bootstrapper( + async fn get_bootstrapper( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -126,9 +131,10 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_reputable( + async fn get_reputable( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -140,9 +146,10 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_endorsee( + async fn get_endorsee( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -154,9 +161,10 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_newbie( + async fn get_newbie( &self, community_ceremony: &CommunityCeremony, p: &ParticipantIndexType, @@ -168,14 +176,15 @@ impl CeremoniesApi for Api { p, None, ) + .await } - fn get_registration( + async fn get_registration( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result { - let index_query = |storage_key| -> Result> { + let index_query = |storage_key| async move { self.get_storage_double_map( ENCOINTER_CEREMONIES, storage_key, @@ -183,15 +192,16 @@ impl CeremoniesApi for Api { account_id, None, ) + .await }; - if let Some(p_index) = index_query("BootstrapperIndex")? { + if let Some(p_index) = index_query("BootstrapperIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Bootstrapper)); - } else if let Some(p_index) = index_query("ReputableIndex")? { + } else if let Some(p_index) = index_query("ReputableIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Reputable)); - } else if let Some(p_index) = index_query("EndorseeIndex")? { + } else if let Some(p_index) = index_query("EndorseeIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Endorsee)); - } else if let Some(p_index) = index_query("NewbieIndex")? { + } else if let Some(p_index) = index_query("NewbieIndex").await? { return Ok(Registration::new(p_index, RegistrationType::Newbie)); } @@ -200,32 +210,38 @@ impl CeremoniesApi for Api { )) } - fn get_meetup_count(&self, community_ceremony: &CommunityCeremony) -> Result { + async fn get_meetup_count( + &self, + community_ceremony: &CommunityCeremony, + ) -> Result { Ok(self - .get_storage_map(ENCOINTER_CEREMONIES, "MeetupCount", community_ceremony, None)? + .get_storage_map(ENCOINTER_CEREMONIES, "MeetupCount", community_ceremony, None) + .await? .unwrap_or(0)) } - fn get_meetup_index( + async fn get_meetup_index( &self, community_ceremony: &CommunityCeremony, account_id: &AccountId, ) -> Result> { - let meetup_count = self.get_meetup_count(community_ceremony)?; + let meetup_count = self.get_meetup_count(community_ceremony).await?; if meetup_count == 0 { warn!("Meetup Count is 0."); return Ok(None); } - let assignments = self.get_assignments(community_ceremony)?; + let assignments = self.get_assignments(community_ceremony).await?; // Some helper queries to make below code more readable. - let bootstrapper_count = || -> Result { - Ok(self.get_assignment_counts(community_ceremony)?.bootstrappers) + let bootstrapper_count = || async { + Ok::( + self.get_assignment_counts(community_ceremony).await?.bootstrappers, + ) }; - let registration = self.get_registration(community_ceremony, account_id)?; + let registration = self.get_registration(community_ceremony, account_id).await?; let meetup_index_fn = |p_index, assignment_params| meetup_index(p_index, assignment_params, meetup_count); @@ -237,7 +253,7 @@ impl CeremoniesApi for Api { Ok(meetup_index_fn(registration.index - 1, assignments.bootstrappers_reputables)) }, RegistrationType::Reputable => Ok(meetup_index_fn( - registration.index - 1 + bootstrapper_count()?, + registration.index - 1 + bootstrapper_count().await?, assignments.bootstrappers_reputables, )), RegistrationType::Endorsee => { @@ -249,24 +265,24 @@ impl CeremoniesApi for Api { } } - fn get_meetup_location( + async fn get_meetup_location( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result> { - let locations = self.get_locations(community_ceremony.0)?; - let location_assignment_params = self.get_assignments(community_ceremony)?.locations; + let locations = self.get_locations(community_ceremony.0).await?; + let location_assignment_params = self.get_assignments(community_ceremony).await?.locations; Ok(meetup_location(meetup_index, locations, location_assignment_params)) } - fn get_meetup_participants( + async fn get_meetup_participants( &self, community_ceremony: &CommunityCeremony, meetup_index: MeetupIndexType, ) -> Result> { let meetup_index_zero_based = meetup_index - 1; - let meetup_count = self.get_meetup_count(community_ceremony)?; + let meetup_count = self.get_meetup_count(community_ceremony).await?; if meetup_index_zero_based > meetup_count { return Err(ApiClientError::Other( @@ -277,8 +293,8 @@ impl CeremoniesApi for Api { )); } - let params = self.get_assignments(community_ceremony)?; - let assigned = self.get_assignment_counts(community_ceremony)?; + let params = self.get_assignments(community_ceremony).await?; + let assigned = self.get_assignment_counts(community_ceremony).await?; let bootstrappers_reputables = assignment_fn_inverse( meetup_index_zero_based, @@ -319,37 +335,37 @@ impl CeremoniesApi for Api { Ok(bootstrappers_reputables.chain(endorsees).chain(newbies).collect()) } - fn get_meetup_time_offset(&self) -> Result> { + async fn get_meetup_time_offset(&self) -> Result> { self.get_storage(ENCOINTER_CEREMONIES, "MeetupTimeOffset", None) } - fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result { - let attesting_start = self.get_start_of_attesting_phase()?; - let offset = self.get_meetup_time_offset()?.unwrap_or(0); + async fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result { + let attesting_start = self.get_start_of_attesting_phase().await?; + let offset = self.get_meetup_time_offset().await?.unwrap_or(0); Ok(meetup_time(location, attesting_start, one_day, offset)) } - fn get_community_ceremony_stats( + async fn get_community_ceremony_stats( &self, community_ceremony: CommunityCeremony, ) -> Result { - let assignment = self.get_assignments(&community_ceremony)?; - let assignment_count = self.get_assignment_counts(&community_ceremony)?; - let mcount = self.get_meetup_count(&community_ceremony)?; + let assignment = self.get_assignments(&community_ceremony).await?; + let assignment_count = self.get_assignment_counts(&community_ceremony).await?; + let mcount = self.get_meetup_count(&community_ceremony).await?; let mut meetups = vec![]; // get stats of every meetup for m in 1..=mcount { - let m_location = self.get_meetup_location(&community_ceremony, m)?.unwrap(); + let m_location = self.get_meetup_location(&community_ceremony, m).await?.unwrap(); let time = self.get_meetup_time(m_location, ONE_DAY).unwrap_or(0); - let participants = self.get_meetup_participants(&community_ceremony, m)?; + let participants = self.get_meetup_participants(&community_ceremony, m).await?; let mut registrations = vec![]; for p in participants.into_iter() { - let r = self.get_registration(&community_ceremony, &p)?; + let r = self.get_registration(&community_ceremony, &p).await?; registrations.push((p, r)) } @@ -365,7 +381,7 @@ impl CeremoniesApi for Api { )) } - fn get_attestees( + async fn get_attestees( &self, community_ceremony: CommunityCeremony, p_index: ParticipantIndexType, @@ -376,11 +392,12 @@ impl CeremoniesApi for Api { community_ceremony, p_index, None, - )? + ) + .await? .ok_or_else(|| ApiClientError::Other("Attestees don't exist".into())) } - fn get_meetup_participant_count_vote( + async fn get_meetup_participant_count_vote( &self, community_ceremony: CommunityCeremony, account_id: AccountId, @@ -391,21 +408,24 @@ impl CeremoniesApi for Api { community_ceremony, account_id, None, - )? + ) + .await? .ok_or_else(|| ApiClientError::Other("MeetupParticipantCountVote don't exist".into())) } } -fn get_bootstrapper_or_reputable( +async fn get_bootstrapper_or_reputable( api: &Api, community_ceremony: &CommunityCeremony, p_index: ParticipantIndexType, assigned: &AssignmentCount, ) -> Result> { if p_index < assigned.bootstrappers { - return api.get_bootstrapper(community_ceremony, &(p_index + 1)); + return api.get_bootstrapper(community_ceremony, &(p_index + 1)).await; } else if p_index < assigned.bootstrappers + assigned.reputables { - return api.get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1)); + return api + .get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1)) + .await; } Ok(None) diff --git a/client/encointer-api-client-extension/src/communities.rs b/client/encointer-api-client-extension/src/communities.rs index f5cf3ea1..62076f7b 100644 --- a/client/encointer-api-client-extension/src/communities.rs +++ b/client/encointer-api-client-extension/src/communities.rs @@ -3,11 +3,11 @@ use encointer_primitives::communities::{CommunityIdentifier, Location}; use substrate_api_client::{ac_compose_macros::rpc_params, rpc::Request}; pub trait CommunitiesApi { - fn get_locations(&self, cid: CommunityIdentifier) -> Result>; + async fn get_locations(&self, cid: CommunityIdentifier) -> Result>; } impl CommunitiesApi for Api { - fn get_locations(&self, cid: CommunityIdentifier) -> Result> { + async fn get_locations(&self, cid: CommunityIdentifier) -> Result> { let locations = self .client() .request::>("encointer_getLocations", rpc_params![cid])?; diff --git a/client/encointer-api-client-extension/src/scheduler.rs b/client/encointer-api-client-extension/src/scheduler.rs index 310337ae..74e97f20 100644 --- a/client/encointer-api-client-extension/src/scheduler.rs +++ b/client/encointer-api-client-extension/src/scheduler.rs @@ -3,29 +3,29 @@ use encointer_primitives::scheduler::CeremonyPhaseType; use substrate_api_client::{api::error::Error as ApiClientError, GetStorage}; pub trait SchedulerApi { - fn get_current_phase(&self) -> Result; - fn get_next_phase_timestamp(&self) -> Result; - fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result; - fn get_start_of_attesting_phase(&self) -> Result; + async fn get_current_phase(&self) -> Result; + async fn get_next_phase_timestamp(&self) -> Result; + async fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result; + async fn get_start_of_attesting_phase(&self) -> Result; } impl SchedulerApi for Api { - fn get_current_phase(&self) -> Result { + async fn get_current_phase(&self) -> Result { self.get_storage("EncointerScheduler", "CurrentPhase", None)? .ok_or_else(|| ApiClientError::Other("Couldn't get CurrentPhase".into())) } - fn get_next_phase_timestamp(&self) -> Result { + async fn get_next_phase_timestamp(&self) -> Result { self.get_storage("EncointerScheduler", "NextPhaseTimestamp", None)? .ok_or_else(|| ApiClientError::Other("Couldn't get NextPhaseTimestamp".into())) } - fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result { + async fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result { self.get_storage_map("EncointerScheduler", "PhaseDurations", phase, None)? .ok_or_else(|| ApiClientError::Other("Couldn't get PhaseDuration".into())) } - fn get_start_of_attesting_phase(&self) -> Result { + async fn get_start_of_attesting_phase(&self) -> Result { let next_phase_timestamp = self.get_next_phase_timestamp()?; match self.get_current_phase()? { From e4d6a5c4dfd9f03c1f6a13bb9843dd957e050866 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sat, 2 Mar 2024 23:02:06 +0100 Subject: [PATCH 13/41] more awaits --- .../src/ceremonies.rs | 4 ++-- .../src/communities.rs | 3 ++- .../src/scheduler.rs | 14 +++++++++----- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index 1fdf90d9..c9ee0083 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -336,7 +336,7 @@ impl CeremoniesApi for Api { } async fn get_meetup_time_offset(&self) -> Result> { - self.get_storage(ENCOINTER_CEREMONIES, "MeetupTimeOffset", None) + self.get_storage(ENCOINTER_CEREMONIES, "MeetupTimeOffset", None).await } async fn get_meetup_time(&self, location: Location, one_day: Moment) -> Result { @@ -359,7 +359,7 @@ impl CeremoniesApi for Api { // get stats of every meetup for m in 1..=mcount { let m_location = self.get_meetup_location(&community_ceremony, m).await?.unwrap(); - let time = self.get_meetup_time(m_location, ONE_DAY).unwrap_or(0); + let time = self.get_meetup_time(m_location, ONE_DAY).await.unwrap_or(0); let participants = self.get_meetup_participants(&community_ceremony, m).await?; let mut registrations = vec![]; diff --git a/client/encointer-api-client-extension/src/communities.rs b/client/encointer-api-client-extension/src/communities.rs index 62076f7b..50977ec6 100644 --- a/client/encointer-api-client-extension/src/communities.rs +++ b/client/encointer-api-client-extension/src/communities.rs @@ -10,7 +10,8 @@ impl CommunitiesApi for Api { async fn get_locations(&self, cid: CommunityIdentifier) -> Result> { let locations = self .client() - .request::>("encointer_getLocations", rpc_params![cid])?; + .request::>("encointer_getLocations", rpc_params![cid]) + .await?; Ok(locations) } } diff --git a/client/encointer-api-client-extension/src/scheduler.rs b/client/encointer-api-client-extension/src/scheduler.rs index 74e97f20..8580fed6 100644 --- a/client/encointer-api-client-extension/src/scheduler.rs +++ b/client/encointer-api-client-extension/src/scheduler.rs @@ -11,27 +11,31 @@ pub trait SchedulerApi { impl SchedulerApi for Api { async fn get_current_phase(&self) -> Result { - self.get_storage("EncointerScheduler", "CurrentPhase", None)? + self.get_storage("EncointerScheduler", "CurrentPhase", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get CurrentPhase".into())) } async fn get_next_phase_timestamp(&self) -> Result { - self.get_storage("EncointerScheduler", "NextPhaseTimestamp", None)? + self.get_storage("EncointerScheduler", "NextPhaseTimestamp", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get NextPhaseTimestamp".into())) } async fn get_phase_duration(&self, phase: CeremonyPhaseType) -> Result { - self.get_storage_map("EncointerScheduler", "PhaseDurations", phase, None)? + self.get_storage_map("EncointerScheduler", "PhaseDurations", phase, None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get PhaseDuration".into())) } async fn get_start_of_attesting_phase(&self) -> Result { - let next_phase_timestamp = self.get_next_phase_timestamp()?; + let next_phase_timestamp = self.get_next_phase_timestamp().await?; - match self.get_current_phase()? { + match self.get_current_phase().await? { CeremonyPhaseType::Assigning => Ok(next_phase_timestamp), // - next_phase_timestamp.rem(ONE_DAY), CeremonyPhaseType::Attesting => { self.get_phase_duration(CeremonyPhaseType::Attesting) + .await .map(|dur| next_phase_timestamp - dur) //- next_phase_timestamp.rem(ONE_DAY) }, CeremonyPhaseType::Registering => Err(ApiClientError::Other( From b86703b3d8e2c41627058adaf08049054be900b6 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sat, 2 Mar 2024 23:50:26 +0100 Subject: [PATCH 14/41] use streams for async filter_map --- Cargo.lock | 1 + .../encointer-api-client-extension/Cargo.toml | 1 + .../src/ceremonies.rs | 68 +++++++++++-------- 3 files changed, 41 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69b15c14..8546e255 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2031,6 +2031,7 @@ dependencies = [ "encointer-ceremonies-assignment", "encointer-node-notee-runtime", "encointer-primitives", + "futures", "log", "parity-scale-codec", "serde", diff --git a/client/encointer-api-client-extension/Cargo.toml b/client/encointer-api-client-extension/Cargo.toml index 48cca935..9c2b3cff 100644 --- a/client/encointer-api-client-extension/Cargo.toml +++ b/client/encointer-api-client-extension/Cargo.toml @@ -9,6 +9,7 @@ parity-scale-codec = { workspace = true } serde = { workspace = true, features = ["std"] } serde_json = { workspace = true } tokio = { workspace = true } +futures = { workspace = true } # encointer deps encointer-ceremonies-assignment = { workspace = true, features = ["std"] } diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index c9ee0083..581978f5 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -9,9 +9,9 @@ use encointer_primitives::{ }, communities::Location, }; +use futures::stream::{self, StreamExt, TryStreamExt}; use log::warn; use serde::{Deserialize, Serialize}; - use sp_runtime::AccountId32 as AccountId; use substrate_api_client::{api::error::Error as ApiClientError, GetStorage}; pub type Moment = u64; @@ -296,43 +296,53 @@ impl CeremoniesApi for Api { let params = self.get_assignments(community_ceremony).await?; let assigned = self.get_assignment_counts(community_ceremony).await?; - let bootstrappers_reputables = assignment_fn_inverse( - meetup_index_zero_based, - params.bootstrappers_reputables, - meetup_count, - assigned.bootstrappers + assigned.reputables, + let bootstrappers_reputables = stream::iter( + assignment_fn_inverse( + meetup_index_zero_based, + params.bootstrappers_reputables, + meetup_count, + assigned.bootstrappers + assigned.reputables, + ) + .unwrap_or_default(), ) - .unwrap_or_default() - .into_iter() - .filter_map(|p_index| { + .filter_map(|p_index| async move { get_bootstrapper_or_reputable(self, community_ceremony, p_index, &assigned) + .await .ok() .flatten() }); - let endorsees = assignment_fn_inverse( - meetup_index_zero_based, - params.endorsees, - meetup_count, - assigned.endorsees, + let endorsees = stream::iter( + assignment_fn_inverse( + meetup_index_zero_based, + params.endorsees, + meetup_count, + assigned.endorsees, + ) + .unwrap_or_default() + .into_iter() + .filter(|p| p < &assigned.endorsees), ) - .unwrap_or_default() - .into_iter() - .filter(|p| p < &assigned.endorsees) - .filter_map(|p| self.get_endorsee(community_ceremony, &(p + 1)).ok().flatten()); - - let newbies = assignment_fn_inverse( - meetup_index_zero_based, - params.newbies, - meetup_count, - assigned.newbies, + .filter_map(|p| async move { + self.get_endorsee(community_ceremony, &(p + 1)).await.ok().flatten() + }); + + let newbies = stream::iter( + assignment_fn_inverse( + meetup_index_zero_based, + params.newbies, + meetup_count, + assigned.newbies, + ) + .unwrap_or_default() + .into_iter() + .filter(|p| p < &assigned.newbies), ) - .unwrap_or_default() - .into_iter() - .filter(|p| p < &assigned.newbies) - .filter_map(|p| self.get_newbie(community_ceremony, &(p + 1)).ok().flatten()); + .filter_map(|p| async move { + self.get_newbie(community_ceremony, &(p + 1)).await.ok().flatten() + }); - Ok(bootstrappers_reputables.chain(endorsees).chain(newbies).collect()) + Ok(bootstrappers_reputables.chain(endorsees).chain(newbies).collect().await) } async fn get_meetup_time_offset(&self) -> Result> { From b945e3d045e7c6bf50ff80b373a4d5fe74976e52 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sun, 3 Mar 2024 16:17:05 +0100 Subject: [PATCH 15/41] plenty of async fixes. WIP --- Cargo.lock | 240 +++++----- Cargo.toml | 2 + client/Cargo.toml | 1 + .../encointer-api-client-extension/Cargo.toml | 2 + .../src/ceremonies.rs | 2 + .../src/communities.rs | 2 + .../src/scheduler.rs | 2 + client/src/main.rs | 427 ++++++++++-------- 8 files changed, 343 insertions(+), 335 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8546e255..abb019f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,7 +122,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.3.0", "cpufeatures", "opaque-debug 0.3.0", @@ -134,7 +134,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.4.4", "cpufeatures", ] @@ -184,7 +184,7 @@ version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "getrandom 0.2.10", "once_cell", "version_check", @@ -433,7 +433,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand 0.8.5", + "rand", ] [[package]] @@ -524,7 +524,7 @@ checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock 2.8.0", "autocfg", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "futures-lite", "log", @@ -605,7 +605,7 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line 0.21.0", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object 0.32.2", @@ -688,8 +688,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ "bitcoin_hashes", - "rand 0.7.3", - "rand_core 0.5.1", + "rand", + "rand_core 0.6.4", "serde", "unicode-normalization", ] @@ -776,7 +776,7 @@ dependencies = [ "arrayref", "arrayvec 0.7.4", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq 0.3.0", ] @@ -972,12 +972,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -1006,7 +1000,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher 0.3.0", "cpufeatures", "zeroize", @@ -1294,7 +1288,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1425,7 +1419,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1434,7 +1428,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -1444,7 +1438,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -1456,7 +1450,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset 0.9.0", "scopeguard", @@ -1468,7 +1462,7 @@ version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1580,7 +1574,7 @@ version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", @@ -1687,7 +1681,7 @@ version = "5.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edd72493923899c6f10c641bdbdeddc7183d6396641d99c1a0d1597f37f92e28" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown 0.14.3", "lock_api", "once_cell", @@ -1836,7 +1830,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -2028,11 +2022,13 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" name = "encointer-api-client-extension" version = "0.8.2" dependencies = [ + "async-trait", "encointer-ceremonies-assignment", "encointer-node-notee-runtime", "encointer-primitives", "futures", "log", + "maybe-async", "parity-scale-codec", "serde", "serde_json", @@ -2502,7 +2498,7 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.3.5", "windows-sys 0.48.0", @@ -2531,7 +2527,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand 0.8.5", + "rand", "rustc-hex", "static_assertions", ] @@ -2639,7 +2635,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "rand 0.8.5", + "rand", "rand_pcg", "sc-block-builder", "sc-cli", @@ -2692,7 +2688,7 @@ version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "878babb0b136e731cc77ec2fd883ff02745ff21e6fb662729953d44923df009c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", ] @@ -2703,7 +2699,7 @@ version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87cf1549fba25a6fcac22785b61698317d958e96cac72a59102ea45b9ae64692" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", "serde", @@ -2801,7 +2797,7 @@ version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c302f711acf3196b4bf2b4629a07a2ac6e44cd1782434ec88b85d59adfb1204d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "docify", "frame-support", "log", @@ -3056,7 +3052,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -3067,7 +3063,7 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -3078,7 +3074,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "rand 0.8.5", + "rand", "rand_core 0.6.4", ] @@ -3135,7 +3131,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "821239e5672ff23e2a7060901fa622950bbd80b649cdaadd78d1c1767ed14eb4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dashmap", "futures", "futures-timer", @@ -3143,7 +3139,7 @@ dependencies = [ "nonzero_ext", "parking_lot 0.12.1", "quanta", - "rand 0.8.5", + "rand", "smallvec", ] @@ -3585,7 +3581,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -3737,7 +3733,7 @@ dependencies = [ "jsonrpsee-types", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "rustc-hash", "serde", "serde_json", @@ -3803,7 +3799,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "once_cell", @@ -3882,7 +3878,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -3969,7 +3965,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "quick-protobuf", - "rand 0.8.5", + "rand", "rw-stream-sink", "smallvec", "thiserror", @@ -4025,7 +4021,7 @@ dependencies = [ "multiaddr", "multihash", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.7", "thiserror", "zeroize", @@ -4050,7 +4046,7 @@ dependencies = [ "libp2p-swarm", "log", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.7", "smallvec", "thiserror", @@ -4072,7 +4068,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.9", "tokio", @@ -4108,7 +4104,7 @@ dependencies = [ "log", "once_cell", "quick-protobuf", - "rand 0.8.5", + "rand", "sha2 0.10.7", "snow", "static_assertions", @@ -4130,7 +4126,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand 0.8.5", + "rand", "void", ] @@ -4150,7 +4146,7 @@ dependencies = [ "log", "parking_lot 0.12.1", "quinn-proto", - "rand 0.8.5", + "rand", "rustls 0.20.8", "thiserror", "tokio", @@ -4168,7 +4164,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand 0.8.5", + "rand", "smallvec", ] @@ -4187,7 +4183,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "log", - "rand 0.8.5", + "rand", "smallvec", "tokio", "void", @@ -4313,7 +4309,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.8.5", + "rand", "serde", "sha2 0.9.9", "typenum", @@ -4711,8 +4707,8 @@ dependencies = [ "lioness", "log", "parking_lot 0.12.1", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_distr", "subtle 2.5.0", "thiserror", @@ -4725,7 +4721,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c84490118f2ee2d74570d114f3d0493cbf02790df303d2707606c3e14e07c96" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "downcast", "fragile", "lazy_static", @@ -4740,7 +4736,7 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "proc-macro2", "quote", "syn 1.0.109", @@ -4860,7 +4856,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ - "rand 0.8.5", + "rand", ] [[package]] @@ -4936,7 +4932,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "libc", ] @@ -5670,7 +5666,7 @@ dependencies = [ "lz4", "memmap2 0.5.10", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "siphasher", "snap", ] @@ -5747,7 +5743,7 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall 0.2.16", @@ -5761,7 +5757,7 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall 0.3.5", "smallvec", @@ -5984,7 +5980,7 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "libc", "log", @@ -6009,7 +6005,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug 0.3.0", "universal-hash 0.4.0", @@ -6021,7 +6017,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug 0.3.0", "universal-hash 0.5.1", @@ -6171,7 +6167,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -6350,7 +6346,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c956be1b23f4261676aed05a0046e204e8a6836e50203902683a718af0797989" dependencies = [ "bytes", - "rand 0.8.5", + "rand", "ring 0.16.20", "rustc-hash", "rustls 0.20.8", @@ -6376,19 +6372,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -6396,20 +6379,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", + "rand_chacha", "rand_core 0.6.4", ] -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - [[package]] name = "rand_chacha" version = "0.3.1" @@ -6445,16 +6418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", + "rand", ] [[package]] @@ -7095,7 +7059,7 @@ dependencies = [ "log", "names", "parity-scale-codec", - "rand 0.8.5", + "rand", "regex", "rpassword", "sc-client-api", @@ -7248,7 +7212,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -7342,7 +7306,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcacfc88265486c337ef97a042ba42ccd1903520dbff40116dbe837e3ee6b89" dependencies = [ "anyhow", - "cfg-if 1.0.0", + "cfg-if", "libc", "log", "parking_lot 0.12.1", @@ -7441,7 +7405,7 @@ dependencies = [ "parking_lot 0.12.1", "partial_sort", "pin-project", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network-common", "sc-utils", @@ -7618,7 +7582,7 @@ dependencies = [ "once_cell", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "sc-client-api", "sc-network", "sc-network-common", @@ -7732,7 +7696,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "sc-chain-spec", "sc-client-api", "sc-rpc", @@ -7766,7 +7730,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -7836,7 +7800,7 @@ dependencies = [ "futures", "libc", "log", - "rand 0.8.5", + "rand", "rand_pcg", "regex", "sc-telemetry", @@ -7860,7 +7824,7 @@ dependencies = [ "log", "parking_lot 0.12.1", "pin-project", - "rand 0.8.5", + "rand", "sc-utils", "serde", "serde_json", @@ -8046,7 +8010,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" dependencies = [ "bitvec", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -8097,7 +8061,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ "ahash 0.8.8", - "cfg-if 1.0.0", + "cfg-if", "hashbrown 0.13.2", ] @@ -8311,7 +8275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -8336,7 +8300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -8348,7 +8312,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -8499,7 +8463,7 @@ dependencies = [ "http", "httparse", "log", - "rand 0.8.5", + "rand", "sha-1", ] @@ -8693,7 +8657,7 @@ dependencies = [ "parking_lot 0.12.1", "paste", "primitive-types", - "rand 0.8.5", + "rand", "scale-info", "schnorrkel 0.11.4", "secp256k1", @@ -8928,7 +8892,7 @@ dependencies = [ "log", "parity-scale-codec", "paste", - "rand 0.8.5", + "rand", "scale-info", "serde", "simple-mermaid", @@ -9015,7 +8979,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "smallvec", "sp-core", "sp-externalities", @@ -9038,7 +9002,7 @@ dependencies = [ "ed25519-dalek", "hkdf", "parity-scale-codec", - "rand 0.8.5", + "rand", "scale-info", "sha2 0.10.7", "sp-api", @@ -9139,7 +9103,7 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "scale-info", "schnellru", "sp-core", @@ -9581,7 +9545,7 @@ version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand 2.0.0", "redox_syscall 0.4.1", "rustix 0.38.21", @@ -9654,7 +9618,7 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -9912,7 +9876,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", "pin-project-lite 0.2.12", "tracing-attributes", @@ -10023,7 +9987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", - "cfg-if 1.0.0", + "cfg-if", "data-encoding", "enum-as-inner", "futures-channel", @@ -10032,7 +9996,7 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "rand 0.8.5", + "rand", "smallvec", "socket2 0.4.9", "thiserror", @@ -10048,7 +10012,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "futures-util", "ipconfig", "lazy_static", @@ -10080,9 +10044,9 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "digest 0.10.7", - "rand 0.7.3", + "rand", "static_assertions", ] @@ -10249,8 +10213,8 @@ dependencies = [ "arrayref", "constcat", "digest 0.10.7", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_core 0.6.4", "sha2 0.10.7", "sha3", @@ -10301,7 +10265,7 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -10326,7 +10290,7 @@ version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -10443,7 +10407,7 @@ checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" dependencies = [ "anyhow", "bincode", - "cfg-if 1.0.0", + "cfg-if", "indexmap 1.9.3", "libc", "log", @@ -10469,7 +10433,7 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -10557,7 +10521,7 @@ dependencies = [ "addr2line 0.19.0", "anyhow", "bincode", - "cfg-if 1.0.0", + "cfg-if", "cpp_demangle", "gimli 0.27.3", "log", @@ -10589,7 +10553,7 @@ version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "windows-sys 0.45.0", ] @@ -10602,7 +10566,7 @@ checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" dependencies = [ "anyhow", "cc", - "cfg-if 1.0.0", + "cfg-if", "indexmap 1.9.3", "libc", "log", @@ -10610,7 +10574,7 @@ dependencies = [ "memfd", "memoffset 0.8.0", "paste", - "rand 0.8.5", + "rand", "rustix 0.36.15", "wasmtime-asm-macros", "wasmtime-environ", @@ -10982,7 +10946,7 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -11046,7 +11010,7 @@ dependencies = [ "log", "nohash-hasher", "parking_lot 0.12.1", - "rand 0.8.5", + "rand", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index 491faf67..337ce250 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,8 @@ serde_json = "1.0.114" env_logger = "0.9.0" geojson = "0.22.2" hex = "0.4.3" +maybe-async = { version = "0.2.7" } +async-trait = "0.1.68" tokio = { version = "1.33", features = ["rt-multi-thread", "macros", "time"] } # encointer deps diff --git a/client/Cargo.toml b/client/Cargo.toml index 555f96e3..053c6efc 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" version = "1.5.4" [dependencies] +# todo migrate to clap >=3 https://github.com/encointer/encointer-node/issues/107 clap = "2.33" clap-nested = "0.4.0" env_logger = { workspace = true } diff --git a/client/encointer-api-client-extension/Cargo.toml b/client/encointer-api-client-extension/Cargo.toml index 9c2b3cff..02a3d518 100644 --- a/client/encointer-api-client-extension/Cargo.toml +++ b/client/encointer-api-client-extension/Cargo.toml @@ -4,6 +4,8 @@ version = "0.8.2" edition = "2021" [dependencies] +async-trait = { workspace = true } +maybe-async = { workspace = true } log = { workspace = true } parity-scale-codec = { workspace = true } serde = { workspace = true, features = ["std"] } diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index 581978f5..95475bf7 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -21,6 +21,7 @@ pub const ENCOINTER_CEREMONIES: &str = "EncointerCeremonies"; // same as in runtime, but we did not want to import the runtime here. pub const ONE_DAY: Moment = 86_400_000; +#[maybe_async::maybe_async(?Send)] pub trait CeremoniesApi { async fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result; async fn get_assignment_counts( @@ -103,6 +104,7 @@ pub trait CeremoniesApi { ) -> Result; } +#[maybe_async::maybe_async(?Send)] impl CeremoniesApi for Api { async fn get_assignments(&self, community_ceremony: &CommunityCeremony) -> Result { self.get_storage_map(ENCOINTER_CEREMONIES, "Assignments", community_ceremony, None) diff --git a/client/encointer-api-client-extension/src/communities.rs b/client/encointer-api-client-extension/src/communities.rs index 50977ec6..c47b4aaf 100644 --- a/client/encointer-api-client-extension/src/communities.rs +++ b/client/encointer-api-client-extension/src/communities.rs @@ -2,10 +2,12 @@ use crate::{Api, Result}; use encointer_primitives::communities::{CommunityIdentifier, Location}; use substrate_api_client::{ac_compose_macros::rpc_params, rpc::Request}; +#[maybe_async::maybe_async(?Send)] pub trait CommunitiesApi { async fn get_locations(&self, cid: CommunityIdentifier) -> Result>; } +#[maybe_async::maybe_async(?Send)] impl CommunitiesApi for Api { async fn get_locations(&self, cid: CommunityIdentifier) -> Result> { let locations = self diff --git a/client/encointer-api-client-extension/src/scheduler.rs b/client/encointer-api-client-extension/src/scheduler.rs index 8580fed6..442c443e 100644 --- a/client/encointer-api-client-extension/src/scheduler.rs +++ b/client/encointer-api-client-extension/src/scheduler.rs @@ -2,6 +2,7 @@ use crate::{Api, Moment, Result}; use encointer_primitives::scheduler::CeremonyPhaseType; use substrate_api_client::{api::error::Error as ApiClientError, GetStorage}; +#[maybe_async::maybe_async(?Send)] pub trait SchedulerApi { async fn get_current_phase(&self) -> Result; async fn get_next_phase_timestamp(&self) -> Result; @@ -9,6 +10,7 @@ pub trait SchedulerApi { async fn get_start_of_attesting_phase(&self) -> Result; } +#[maybe_async::maybe_async(?Send)] impl SchedulerApi for Api { async fn get_current_phase(&self) -> Result { self.get_storage("EncointerScheduler", "CurrentPhase", None) diff --git a/client/src/main.rs b/client/src/main.rs index ef96b80f..4d03be11 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -78,7 +78,7 @@ use substrate_api_client::{ extrinsic::BalancesExtrinsics, rpc::{JsonrpseeClient, Request}, GetAccountInformation, GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, - Result as ApiResult, SubmitAndWatch, SubmitAndWatchUntilSuccess, SubscribeEvents, XtStatus, + Result as ApiResult, SubmitAndWatch, SubscribeEvents, XtStatus, }; use substrate_client_keystore::{KeystoreExt, LocalKeystore}; @@ -182,8 +182,8 @@ async fn main() { .add_cmd( Command::new("print-metadata") .description("query node metadata and print it as json to stdout") - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { + let api = get_chain_api(matches).await; println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); Ok(()) }), @@ -195,8 +195,8 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .fundees_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { + let mut api = get_chain_api(matches).await; api .set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); let accounts = matches.fundees_arg().unwrap(); @@ -229,7 +229,7 @@ async fn main() { // send and watch extrinsic until ready println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); let _blockh = api - .submit_and_watch_extrinsic_until(xt, XtStatus::Ready) + .submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await .unwrap(); nonce += 1; } @@ -246,7 +246,7 @@ async fn main() { .at_block_arg() }) .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let account = matches.account_arg().unwrap(); let maybe_at = matches.at_block_arg(); let accountid = get_accountid_from_str(account); @@ -283,7 +283,7 @@ async fn main() { .at_block_arg() }) .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let maybe_at = matches.at_block_arg(); let cid_str = matches.cid_arg().expect("please supply argument --cid"); let issuance = get_community_issuance(&api, cid_str, maybe_at); @@ -320,7 +320,7 @@ async fn main() { ) }) .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; let arg_from = matches.value_of("from").unwrap(); let arg_to = matches.value_of("to").unwrap(); if !matches.dryrun_flag() { @@ -334,7 +334,7 @@ async fn main() { let tx_payment_cid_arg = matches.tx_payment_cid_arg(); let tx_hash = match matches.cid_arg() { Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None); + let cid = verify_cid(&api, cid_str, None).await; let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) .expect("amount can be converted to fixpoint"); @@ -353,7 +353,7 @@ async fn main() { None } else { ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap()) + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) } }, None => { @@ -368,7 +368,7 @@ async fn main() { None } else { ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap()) + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) } } }; @@ -401,7 +401,7 @@ async fn main() { ) }) .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; let arg_from = matches.value_of("from").unwrap(); let arg_to = matches.value_of("to").unwrap(); let from = get_pair_from_str(arg_from); @@ -414,7 +414,7 @@ async fn main() { let tx_payment_cid_arg = matches.tx_payment_cid_arg(); let tx_hash = match matches.cid_arg() { Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None); + let cid = verify_cid(&api, cid_str, None).await; set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); let xt: EncointerXt<_> = compose_extrinsic!( @@ -425,7 +425,7 @@ async fn main() { cid ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap() + api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() }, None => { error!("No cid specified"); @@ -488,7 +488,7 @@ async fn main() { .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); let signer = ParentchainExtrinsicSigner::new(signer); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(signer); @@ -557,7 +557,7 @@ async fn main() { let spec_file = matches.value_of("specfile").unwrap(); let spec = read_community_spec_from_file(spec_file); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; if !matches.dryrun_flag() { let signer = matches.signer_arg() .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); @@ -568,7 +568,7 @@ async fn main() { let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let cid = verify_cid(&api, matches.cid_arg().unwrap(), None); + let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; let add_location_calls: Vec= spec.locations().into_iter().map(|l| { @@ -616,7 +616,7 @@ async fn main() { Command::new("list-communities") .description("list all registered communities") .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let names = get_cid_names(&api).unwrap(); println!("number of communities: {}", names.len()); for n in names.iter() { @@ -634,14 +634,14 @@ async fn main() { .at_block_arg() }) .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let maybe_at = matches.at_block_arg(); let cid = verify_cid(&api, matches .cid_arg() .expect("please supply argument --cid"), maybe_at - ); + ).await; println!("listing locations for cid {cid}"); let loc = api.get_locations(cid).unwrap(); for l in loc.iter() { @@ -657,7 +657,7 @@ async fn main() { Command::new("get-phase") .description("read current ceremony phase from chain") .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; // >>>> add some debug info as well let bn = get_block_number(&api, None); @@ -680,11 +680,11 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .signer_arg("account with necessary privileges (sudo or councillor)") }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let signer = matches.signer_arg() .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; let signer = ParentchainExtrinsicSigner::new(signer); api.set_signer(signer); let next_phase_call = compose_call!( @@ -727,7 +727,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { extract_and_execute( matches, |api, cid| -> ApiResult<()>{ @@ -775,7 +775,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { extract_and_execute( matches, |api, cid| -> ApiResult<()>{ @@ -823,7 +823,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { extract_and_execute( matches, |api, cid| -> ApiResult<()>{ @@ -852,27 +852,29 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { extract_and_execute( matches, |api, cid| -> ApiResult<()>{ - let current_ceremony_index = get_ceremony_index(&api, None); + let current_ceremony_index = get_ceremony_index(&api, None).await; let cindex = matches.ceremony_index_arg() .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); println!("listing attestees for cid {cid} and ceremony nr {cindex}"); - let wcount = get_attestee_count(&api, (cid, cindex)); + let wcount = get_attestee_count(&api, (cid, cindex)).await; println!("number of attestees: {wcount}"); println!("listing participants for cid {cid} and ceremony nr {cindex}"); let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None); + let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None).await; let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - let account_query = |registry_index, p_index| api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None); + let account_query = |registry_index, p_index| async move { + api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None).await + }; let mut participants_windex = HashMap::new(); @@ -885,7 +887,7 @@ async fn main() { for p_index in 1..count +1 { let accountid: AccountId = account_query(i, p_index)?.unwrap(); - match get_participant_attestation_index(&api, (cid, cindex), &accountid) { + match get_participant_attestation_index(&api, (cid, cindex), &accountid).await { Some(windex) => { participants_windex.insert(windex as AttestationIndexType, accountid) } @@ -898,9 +900,9 @@ async fn main() { for w in 1..wcount + 1 { let attestor = participants_windex[&w].clone(); - let meetup_index = api.get_meetup_index(&(cid, cindex), &attestor).unwrap().unwrap(); - let attestees = api.get_attestees((cid, cindex), w).unwrap(); - let vote = api.get_meetup_participant_count_vote((cid, cindex), attestor.clone()).unwrap(); + let meetup_index = api.get_meetup_index(&(cid, cindex), &attestor).await.unwrap().unwrap(); + let attestees = api.get_attestees((cid, cindex), w).await.unwrap(); + let vote = api.get_meetup_participant_count_vote((cid, cindex), attestor.clone()).await.unwrap(); let attestation_state = AttestationState::new( (cid, cindex), meetup_index, @@ -935,8 +937,8 @@ async fn main() { .at_block_arg() .verbose_flag() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { + let api = get_chain_api(matches).await; let is_verbose = matches.verbose_flag(); let at_block = matches.at_block_arg(); @@ -982,7 +984,7 @@ async fn main() { .account_arg() .signer_arg("Account which signs the tx.") }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let arg_who = matches.account_arg().unwrap(); let accountid = get_accountid_from_str(arg_who); let signer = match matches.signer_arg() { @@ -990,14 +992,14 @@ async fn main() { None => get_pair_from_str(arg_who) }; - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let cindex = get_ceremony_index(&api, None); let cid = verify_cid(&api, matches .cid_arg() .expect("please supply argument --cid"), None - ); + ).await; let rep = get_reputation(&api, &accountid, cid, cindex -1); info!("{} has reputation {:?}", accountid, rep); let proof = match rep { @@ -1031,7 +1033,7 @@ async fn main() { ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); Ok(()) }), @@ -1044,7 +1046,7 @@ async fn main() { .account_arg() .signer_arg("Account which signs the tx.") }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let arg_who = matches.account_arg().unwrap(); let accountid = get_accountid_from_str(arg_who); let signer = match matches.signer_arg() { @@ -1052,14 +1054,14 @@ async fn main() { None => get_pair_from_str(arg_who) }; - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let cindex = get_ceremony_index(&api, None); let cid = verify_cid(&api, matches .cid_arg() .expect("please supply argument --cid"), None - ); + ).await; let current_phase = api.get_current_phase().unwrap(); if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { @@ -1096,7 +1098,7 @@ async fn main() { ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); Ok(()) }), @@ -1110,21 +1112,21 @@ async fn main() { .signer_arg("Account which signs the tx.") .ceremony_index_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let arg_who = matches.account_arg().unwrap(); let signer = match matches.signer_arg() { Some(sig) => get_pair_from_str(sig), None => get_pair_from_str(arg_who) }; - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let cid = verify_cid(&api, matches .cid_arg() .expect("please supply argument --cid"), None - ); + ).await; let cc = match matches.ceremony_index_arg() { @@ -1157,7 +1159,7 @@ async fn main() { ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // Send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); Ok(()) }), @@ -1170,7 +1172,7 @@ async fn main() { .bootstrapper_arg() .endorsees_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { extract_and_execute( matches, |mut api, cid| endorse_newcomers(&mut api, cid, matches) @@ -1185,7 +1187,7 @@ async fn main() { .options(|app| { app.setting(AppSettings::ColoredHelp) }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let bs_with_tickets : Vec = extract_and_execute( matches, |api, cid| get_bootstrappers_with_remaining_newbie_tickets(&api, cid) ).unwrap(); @@ -1209,10 +1211,10 @@ async fn main() { .account_arg() .ceremony_index_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let arg_who = matches.account_arg().unwrap(); let accountid = get_accountid_from_str(arg_who); - let api = get_chain_api(matches); + let api = get_chain_api(matches).await; let current_ceremony_index = get_ceremony_index(&api, None); @@ -1223,7 +1225,7 @@ async fn main() { &api, matches.cid_arg().expect("please supply argument --cid"), None - ); + ).await; debug!("Getting proof for ceremony index: {:?}", cindex); let proof = prove_attendance(accountid, cid, cindex, arg_who); @@ -1242,7 +1244,7 @@ async fn main() { .optional_cid_arg() .attestees_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let who = matches.account_arg().map(get_pair_from_str).unwrap(); let attestees: Vec<_> = matches.attestees_arg().unwrap() @@ -1257,7 +1259,7 @@ async fn main() { info!("send attest_attendees by {}", who.public()); let mut api = - get_chain_api(matches); + get_chain_api(matches).await; let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); api.set_signer(signer); @@ -1269,7 +1271,7 @@ async fn main() { .cid_arg() .expect("please supply argument --cid"), None - ); + ).await; let xt: EncointerXt<_> = compose_extrinsic!( api, @@ -1280,7 +1282,7 @@ async fn main() { attestees ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); Ok(()) @@ -1300,7 +1302,7 @@ async fn main() { .help("participant's vote on the number of people present at meetup time"), ) }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { extract_and_execute( matches, |api, cid| -> ApiResult<()>{ let arg_who = matches.account_arg().unwrap(); @@ -1331,10 +1333,10 @@ async fn main() { .meetup_index_arg() .all_flag() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { extract_and_execute( - matches, |api, cid| { + matches, |api, cid| async move { let signer = match matches.signer_arg() { Some(sig) => get_pair_from_str(sig), None => panic!("please specify --signer.") @@ -1382,7 +1384,7 @@ async fn main() { meetup_index ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); match meetup_index_arg { Some(idx)=>{println!("Claiming reward for meetup_index {idx}. xt-status: '{:?}'", report.status);} None=>{println!("Claiming reward for {}. xt-status: 'ready'", signer.public_account_id());} @@ -1400,8 +1402,8 @@ async fn main() { .options(|app| { app.setting(AppSettings::ColoredHelp) .account_arg()}) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { + let api = get_chain_api(matches).await; let account = matches.account_arg().unwrap(); let account_id = get_accountid_from_str(account); if let Some(reputation) = get_reputation_history(&api, &account_id) { @@ -1423,7 +1425,7 @@ async fn main() { .account_arg() .ipfs_cid_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).unwrap(); Ok(()) }), @@ -1436,7 +1438,7 @@ async fn main() { .account_arg() .ipfs_cid_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).unwrap(); Ok(()) }), @@ -1449,7 +1451,7 @@ async fn main() { .account_arg() .ipfs_cid_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { send_bazaar_xt(matches, &BazaarCalls::CreateOffering).unwrap(); Ok(()) }), @@ -1457,7 +1459,7 @@ async fn main() { .add_cmd( Command::new("list-businesses") .description("List businesses for a community") - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let businesses = extract_and_execute( matches, |api, cid| get_businesses(&api, cid).unwrap() @@ -1470,7 +1472,7 @@ async fn main() { .add_cmd( Command::new("list-offerings") .description("List offerings for a community") - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let offerings = extract_and_execute( matches, |api, cid| get_offerings(&api, cid).unwrap() ); @@ -1486,7 +1488,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .account_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let account = matches.account_arg().map(get_accountid_from_str).unwrap(); let offerings = extract_and_execute( @@ -1506,10 +1508,10 @@ async fn main() { .to_cindex_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let sudoer = AccountKeyring::Alice.pair(); let signer = ParentchainExtrinsicSigner::new(sudoer); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(signer); let current_ceremony_index = get_ceremony_index(&api, None); @@ -1528,7 +1530,7 @@ async fn main() { .cid_arg() .expect("please supply argument --cid"), None - ); + ).await; println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); let calls: Vec<_> = (from_cindex..=to_cindex) @@ -1562,7 +1564,7 @@ async fn main() { batch_call ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap(); + let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); Ok(()) }), @@ -1575,8 +1577,8 @@ async fn main() { .setting(AppSettings::AllowLeadingHyphen) .time_offset_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches); + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { + let mut api = get_chain_api(matches).await; let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); api .set_signer(signer); @@ -1620,10 +1622,10 @@ async fn main() { .faucet_drip_amount_arg() .whitelist_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( who.clone(), ))); @@ -1635,9 +1637,9 @@ async fn main() { let whitelist = matches.whitelist_arg().map(|wl| { let whitelist_vec: Vec<_> = wl .into_iter() - .map(|c| verify_cid(&api, + .map(|c| async move { verify_cid(&api, c, - None)) + None).await}) .collect(); WhiteListType::try_from(whitelist_vec).unwrap() }); @@ -1660,7 +1662,7 @@ async fn main() { ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let result = api.submit_and_watch_extrinsic_until_success(xt, false); + let result = api.submit_and_watch_extrinsic_until_success(xt, false).await; match result { Ok(report) => { @@ -1687,15 +1689,15 @@ async fn main() { .faucet_account_arg() .cindex_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( who.clone(), ))); - let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None); + let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; let cindex = matches.cindex_arg().unwrap(); let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); @@ -1715,7 +1717,7 @@ async fn main() { ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let result = api.submit_and_watch_extrinsic_until_success(xt, false); + let result = api.submit_and_watch_extrinsic_until_success(xt, false).await; match result { Ok(_report) => { @@ -1739,7 +1741,7 @@ async fn main() { .faucet_account_arg() .faucet_beneficiary_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let signer = matches.signer_arg() .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); let signer = ParentchainExtrinsicSigner::new(signer); @@ -1747,7 +1749,7 @@ async fn main() { let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(signer); @@ -1793,10 +1795,10 @@ async fn main() { .account_arg() .faucet_account_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( who, ))); @@ -1815,7 +1817,7 @@ async fn main() { ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); Ok(()) @@ -1829,14 +1831,14 @@ async fn main() { .signer_arg("account with necessary privileges (sudo or councillor)") .faucet_reserve_amount_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let signer = matches.signer_arg() .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); let signer = ParentchainExtrinsicSigner::new(signer); let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(signer); @@ -1880,8 +1882,8 @@ async fn main() { .at_block_arg() .verbose_flag() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { + let api = get_chain_api(matches).await; let is_verbose = matches.verbose_flag(); let at_block = matches.at_block_arg(); @@ -1937,9 +1939,9 @@ async fn main() { .account_arg() .inactivity_timeout_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( who.clone(), ))); @@ -1954,7 +1956,7 @@ async fn main() { ProposalAction::SetInactivityTimeout(inactivity_timeout) ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false); + let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; println!("Proposal Submitted: Set inactivity timeout to {inactivity_timeout:?}"); Ok(()) }), @@ -1966,14 +1968,14 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .at_block_arg() }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches); + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { + let api = get_chain_api(matches).await; let at_block = matches.at_block_arg(); let key_prefix = api .get_storage_map_key_prefix( "EncointerDemocracy", "Proposals", - ) + ).await .unwrap(); let max_keys = 1000; let storage_keys = @@ -1984,7 +1986,7 @@ async fn main() { 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 = api.get_storage_by_key(storage_key.clone(), at_block).unwrap().unwrap(); + let proposal: Proposal = api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); println!("id: {}", proposal_id); println!("action: {:?}", proposal.action); println!("start block: {}", proposal.start); @@ -2005,9 +2007,9 @@ async fn main() { .vote_arg() .reputation_vec_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { + .runner(async move |_args: &str, matches: &ArgMatches<'_>| { let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( who.clone(), ))); @@ -2021,9 +2023,9 @@ async fn main() { let reputation_vec: ReputationVec> = matches.reputation_vec_arg().map(|rv| { let reputations: Vec<(CommunityIdentifier, CeremonyIndexType)> = rv .into_iter() - .map(|rep| { + .map(|rep| async move { let cc: Vec<_> = rep.split("_").collect(); - (verify_cid(&api,cc[0],None), cc[1].parse().unwrap()) + (verify_cid(&api,cc[0],None), cc[1].parse().unwrap()).await }).collect(); ReputationVec::try_from(reputations).unwrap() }).unwrap(); @@ -2038,7 +2040,7 @@ async fn main() { reputation_vec ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false); + let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; println!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); Ok(()) }), @@ -2052,24 +2054,26 @@ async fn main() { .proposal_id_arg() }) .runner(move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( - who.clone(), - ))); - let proposal_id = matches.proposal_id_arg().unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = compose_extrinsic!( + async move { + 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 proposal_id = matches.proposal_id_arg().unwrap(); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + let xt: EncointerXt<_> = compose_extrinsic!( api, "EncointerDemocracy", "update_proposal_state", proposal_id ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); + let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; println!("Proposal state updated for proposal {proposal_id:?}"); - Ok(()) + Ok(()) + } }), ) // To handle when no subcommands match @@ -2080,52 +2084,53 @@ async fn main() { .run(); } -fn get_chain_api(matches: &ArgMatches<'_>) -> Api { +async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { let url = format!( "{}:{}", matches.value_of("node-url").unwrap(), matches.value_of("node-port").unwrap() ); debug!("connecting to {}", url); - let client = JsonrpseeClient::new(&url).expect("node URL is incorrect"); - Api::new(client).unwrap() + let client = JsonrpseeClient::new(&url).await.expect("node URL is incorrect"); + Api::new(client).await.unwrap() } -fn reasonable_native_balance(api: &Api) -> u128 { +async fn reasonable_native_balance(api: &Api) -> u128 { let alice: AccountId = AccountKeyring::Alice.into(); let xt = api.balance_transfer_allow_death(alice.into(), 9999); let fee = api .get_fee_details(xt.encode().into(), None) + .await .unwrap() .unwrap() .inclusion_fee .unwrap() .base_fee; - let ed = api.get_existential_deposit().unwrap(); + let ed = api.get_existential_deposit().await.unwrap(); ed + fee * PREFUNDING_NR_OF_TRANSFER_EXTRINSICS } -fn listen(matches: &ArgMatches<'_>) { - let api = get_chain_api(matches); +async fn listen(matches: &ArgMatches<'_>) { + let api = get_chain_api(matches).await; debug!("Subscribing to events"); - let mut subscription = api.subscribe_events().unwrap(); + let mut subscription = api.subscribe_events().await.unwrap(); let mut count = 0u32; let mut blocks = 0u32; loop { - if matches.is_present("events") && - count >= value_t!(matches.value_of("events"), u32).unwrap() + if matches.is_present("events") + && count >= value_t!(matches.value_of("events"), u32).unwrap() { - return + return; }; - if matches.is_present("blocks") && - blocks > value_t!(matches.value_of("blocks"), u32).unwrap() + if matches.is_present("blocks") + && blocks > value_t!(matches.value_of("blocks"), u32).unwrap() { - return + return; }; - let event_results = subscription.next_events::().unwrap(); + let event_results = subscription.next_events::().await.unwrap(); blocks += 1; match event_results { - Ok(evts) => + Ok(evts) => { for evr in evts { debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event); match &evr.event { @@ -2208,24 +2213,26 @@ fn listen(matches: &ArgMatches<'_>) { }, _ => debug!("ignoring unsupported module event: {:?}", evr.event), } - }, + } + }, Err(_) => error!("couldn't decode event record list"), } } } /// Extracts api and cid from `matches` and execute the given `closure` with them. -fn extract_and_execute( +async fn extract_and_execute( matches: &ArgMatches<'_>, closure: impl FnOnce(Api, CommunityIdentifier) -> T, ) -> T { - let api = get_chain_api(matches); - let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None); + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; closure(api, cid) } -fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { - let cids = get_community_identifiers(api, maybe_at).expect("no community registered"); +async fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { + let cids = get_community_identifiers(api, maybe_at).expect("no community registered").await; let cid = CommunityIdentifier::from_str(cid).unwrap(); if !cids.contains(&cid) { panic!("cid {cid} does not exist on chain"); @@ -2233,25 +2240,26 @@ fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifi cid } -fn get_block_number(api: &Api, maybe_at: Option) -> BlockNumber { - let hdr = api.get_header(maybe_at).unwrap().unwrap(); +async fn get_block_number(api: &Api, maybe_at: Option) -> BlockNumber { + let hdr = api.get_header(maybe_at).await.unwrap().unwrap(); debug!("decoded: {:?}", hdr); //let hdr: Header= Decode::decode(&mut .as_bytes()).unwrap(); hdr.number } -pub fn get_community_balance( +pub async fn get_community_balance( api: &Api, cid_str: &str, account_id: &AccountId, maybe_at: Option, ) -> BalanceType { - let cid = verify_cid(api, cid_str, maybe_at); - let bn = get_block_number(api, maybe_at); - let dr = get_demurrage_per_block(api, cid); + let cid = verify_cid(api, cid_str, maybe_at).await; + let bn = get_block_number(api, maybe_at).await; + let dr = get_demurrage_per_block(api, cid).await; if let Some(entry) = api .get_storage_double_map("EncointerBalances", "Balance", cid, account_id, maybe_at) + .await .unwrap() { apply_demurrage(entry, bn, dr) @@ -2260,13 +2268,18 @@ pub fn get_community_balance( } } -pub fn get_community_issuance(api: &Api, cid_str: &str, maybe_at: Option) -> BalanceType { - let cid = verify_cid(api, cid_str, maybe_at); +pub async fn get_community_issuance( + api: &Api, + cid_str: &str, + maybe_at: Option, +) -> BalanceType { + let cid = verify_cid(api, cid_str, maybe_at).await; let bn = get_block_number(api, maybe_at); let dr = get_demurrage_per_block(api, cid); if let Some(entry) = api .get_storage_map("EncointerBalances", "TotalIssuance", cid, maybe_at) + .await .unwrap() { apply_demurrage(entry, bn, dr) @@ -2275,9 +2288,10 @@ pub fn get_community_issuance(api: &Api, cid_str: &str, maybe_at: Option) } } -fn get_demurrage_per_block(api: &Api, cid: CommunityIdentifier) -> Demurrage { +async fn get_demurrage_per_block(api: &Api, cid: CommunityIdentifier) -> Demurrage { let d: Option = api .get_storage_map("EncointerBalances", "DemurragePerBlock", cid, None) + .await .unwrap(); match d { @@ -2286,26 +2300,28 @@ fn get_demurrage_per_block(api: &Api, cid: CommunityIdentifier) -> Demurrage { d }, None => { - let d = api.get_constant("EncointerBalances", "DefaultDemurrage").unwrap(); + let d = api.get_constant("EncointerBalances", "DefaultDemurrage").await.unwrap(); debug!("Fetched default demurrage per block {:?}", d); d }, } } -fn get_ceremony_index(api: &Api, at_block: Option) -> CeremonyIndexType { +async fn get_ceremony_index(api: &Api, at_block: Option) -> CeremonyIndexType { api.get_storage("EncointerScheduler", "CurrentCeremonyIndex", at_block) + .await .unwrap() .unwrap() } -fn get_attestee_count(api: &Api, key: CommunityCeremony) -> ParticipantIndexType { +async fn get_attestee_count(api: &Api, key: CommunityCeremony) -> ParticipantIndexType { api.get_storage_map("EncointerCeremonies", "AttestationCount", key, None) + .await .unwrap() .unwrap_or(0) } -fn get_attendees_for_community_ceremony( +async fn get_attendees_for_community_ceremony( api: &Api, community_ceremony: CommunityCeremony, at_block: Option, @@ -2316,10 +2332,13 @@ fn get_attendees_for_community_ceremony( "ParticipantReputation", community_ceremony, ) + .await .unwrap(); let max_keys = 1000; - let storage_keys = - api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).unwrap(); + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); if storage_keys.len() == max_keys as usize { error!("results can be wrong because max keys reached for query") @@ -2327,7 +2346,7 @@ fn get_attendees_for_community_ceremony( let mut attendees = Vec::new(); let mut noshows = Vec::new(); for storage_key in storage_keys.iter() { - match api.get_storage_by_key(storage_key.clone(), at_block).unwrap().unwrap() { + match api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap() { Reputation::VerifiedUnlinked | Reputation::VerifiedLinked => { let key_postfix = storage_key.as_ref(); attendees.push( @@ -2345,22 +2364,24 @@ fn get_attendees_for_community_ceremony( (attendees, noshows) } -fn get_reputation_lifetime(api: &Api, at_block: Option) -> ReputationLifetimeType { +async fn get_reputation_lifetime(api: &Api, at_block: Option) -> ReputationLifetimeType { api.get_storage("EncointerCeremonies", "ReputationLifetime", at_block) + .await .unwrap() .unwrap_or(5) } -fn get_participant_attestation_index( +async fn get_participant_attestation_index( api: &Api, key: CommunityCeremony, accountid: &AccountId, ) -> Option { api.get_storage_double_map("EncointerCeremonies", "AttestationIndex", key, accountid, None) + .await .unwrap() } -fn new_claim_for( +async fn new_claim_for( api: &Api, claimant: &sr25519::Pair, cid: CommunityIdentifier, @@ -2373,8 +2394,8 @@ fn new_claim_for( .expect("participant must be assigned to meetup to generate a claim"); // implicitly assume that participant meet at the right place at the right time - let mloc = api.get_meetup_location(&(cid, cindex), mindex).unwrap().unwrap(); - let mtime = api.get_meetup_time(mloc, ONE_DAY).unwrap(); + let mloc = api.get_meetup_location(&(cid, cindex), mindex).await.unwrap().unwrap(); + let mtime = api.get_meetup_time(mloc, ONE_DAY).await.unwrap(); info!( "creating claim for {} at loc {} (lat: {} lon: {}) at time {}, cindex {}", @@ -2399,34 +2420,37 @@ fn new_claim_for( claim.encode() } -fn get_community_identifiers( +async fn get_community_identifiers( api: &Api, maybe_at: Option, ) -> Option> { api.get_storage("EncointerCommunities", "CommunityIdentifiers", maybe_at) + .await .unwrap() } /// This rpc needs to have offchain indexing enabled in the node. -fn get_cid_names(api: &Api) -> Option> { - api.client().request("encointer_getAllCommunities", rpc_params![]).expect( +async fn get_cid_names(api: &Api) -> Option> { + api.client().request("encointer_getAllCommunities", rpc_params![]).await.expect( "No communities returned. Are you running the node with `--enable-offchain-indexing true`?", ) } -fn get_businesses(api: &Api, cid: CommunityIdentifier) -> Option>> { +async fn get_businesses(api: &Api, cid: CommunityIdentifier) -> Option>> { api.client() .request("encointer_bazaarGetBusinesses", rpc_params![cid]) + .await .expect("Could not find any businesses...") } -fn get_offerings(api: &Api, cid: CommunityIdentifier) -> Option> { +async fn get_offerings(api: &Api, cid: CommunityIdentifier) -> Option> { api.client() .request("encointer_bazaarGetOfferings", rpc_params![cid]) + .await .expect("Could not find any business offerings...") } -fn get_offerings_for_business( +async fn get_offerings_for_business( api: &Api, cid: CommunityIdentifier, account_id: AccountId, @@ -2434,36 +2458,40 @@ fn get_offerings_for_business( let b_id = BusinessIdentifier::new(cid, account_id); api.client() .request("encointer_bazaarGetOfferingsForBusiness", rpc_params![b_id]) + .await .expect("Could not find any business offerings...") } -fn get_reputation_history( +async fn get_reputation_history( api: &Api, account_id: &AccountId, ) -> Option> { api.client() .request("encointer_getReputations", rpc_params![account_id]) + .await .expect("Could not query reputation history...") } -fn get_all_balances( +async fn get_all_balances( api: &Api, account_id: &AccountId, ) -> Option)>> { api.client() .request("encointer_getAllBalances", rpc_params![account_id]) + .await .expect("Could not query all balances...") } -fn get_asset_fee_details( +async fn get_asset_fee_details( api: &Api, cid_str: &str, encoded_xt: &Bytes, ) -> Option> { - let cid = verify_cid(api, cid_str, None); + let cid = verify_cid(api, cid_str, None).await; api.client() .request("encointer_queryAssetFeeDetails", rpc_params![cid, encoded_xt]) + .await .expect("Could not query asset fee details") } @@ -2489,7 +2517,7 @@ fn prove_attendance( } } -fn get_reputation( +async fn get_reputation( api: &Api, prover: &AccountId, cid: CommunityIdentifier, @@ -2502,6 +2530,7 @@ fn get_reputation( prover.clone(), None, ) + .await .unwrap() .unwrap_or(Reputation::Unverified) } @@ -2523,14 +2552,15 @@ fn apply_demurrage( entry.principal.checked_mul(to_U64F64(exp_result).unwrap()).unwrap() } -fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result<(), ()> { +async fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result<(), ()> { let business_owner = matches.account_arg().map(get_pair_from_str).unwrap(); - let mut api = get_chain_api(matches); + let mut api = get_chain_api(matches).await; api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from( business_owner.clone(), ))); - let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None); + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; let ipfs_cid = matches.ipfs_cid_arg().expect("ipfs cid needed"); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); @@ -2539,7 +2569,7 @@ fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result compose_extrinsic!(api, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).unwrap(); + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); println!( "{} for {}. xt-status: '{:?}'", bazaar_call.to_string(), @@ -2549,7 +2579,7 @@ fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result Ok(()) } -fn endorse_newcomers( +async fn endorse_newcomers( api: &mut Api, cid: CommunityIdentifier, matches: &ArgMatches<'_>, @@ -2574,6 +2604,7 @@ fn endorse_newcomers( ensure_payment(api, &encoded_xt, tx_payment_cid_arg); let _tx_report = api .submit_and_watch_opaque_extrinsic_until(encoded_xt, XtStatus::Ready) + .await .unwrap(); nonce += 1; @@ -2589,32 +2620,36 @@ struct BootstrapperWithTickets { remaining_newbie_tickets: u8, } -fn get_bootstrappers_with_remaining_newbie_tickets( +async fn get_bootstrappers_with_remaining_newbie_tickets( api: &Api, cid: CommunityIdentifier, ) -> Result, ApiClientError> { let total_newbie_tickets: u8 = api .get_storage("EncointerCeremonies", "EndorsementTicketsPerBootstrapper", None) + .await .unwrap() .unwrap(); // prepare closure to make below call more readable. - let ticket_query = |bs| -> Result { - let remaining_tickets = total_newbie_tickets - - api.get_storage_double_map( - "EncointerCeremonies", - "BurnedBootstrapperNewbieTickets", - cid, - bs, - None, - )? - .unwrap_or(0u8); + let ticket_query = |bs| async move { + let remaining_tickets = total_newbie_tickets + - api + .get_storage_double_map( + "EncointerCeremonies", + "BurnedBootstrapperNewbieTickets", + cid, + bs, + None, + ) + .await? + .unwrap_or(0u8); Ok(remaining_tickets) }; let bootstrappers: Vec = api - .get_storage_map("EncointerCommunities", "Bootstrappers", cid, None)? + .get_storage_map("EncointerCommunities", "Bootstrappers", cid, None) + .await? .expect("No bootstrappers found, does the community exist?"); let mut bs_with_tickets: Vec = Vec::with_capacity(bootstrappers.len()); @@ -2622,7 +2657,7 @@ fn get_bootstrappers_with_remaining_newbie_tickets( for bs in bootstrappers.into_iter() { bs_with_tickets.push(BootstrapperWithTickets { bootstrapper: bs.clone(), - remaining_newbie_tickets: ticket_query(bs)?, + remaining_newbie_tickets: ticket_query(bs).await?, }); } @@ -2646,14 +2681,12 @@ impl ToString for BazaarCalls { } } -fn set_api_extrisic_params_builder(api: &mut Api, tx_payment_cid_arg: Option<&str>) { +async fn set_api_extrisic_params_builder(api: &mut Api, tx_payment_cid_arg: Option<&str>) { let mut tx_params = CommunityCurrencyTipExtrinsicParamsBuilder::new().tip(0); if let Some(tx_payment_cid) = tx_payment_cid_arg { - tx_params = tx_params.tip(CommunityCurrencyTip::new(0).of_community(verify_cid( - api, - tx_payment_cid, - None, - ))); + tx_params = tx_params.tip( + CommunityCurrencyTip::new(0).of_community(verify_cid(api, tx_payment_cid, None).await), + ); } let _ = &api.set_additional_params(tx_params); } From b5ef178300cb50e05d1216ea490dd8d251f9543a Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Sun, 3 Mar 2024 16:30:59 +0100 Subject: [PATCH 16/41] found a solution. WIP --- client/src/main.rs | 69 +++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 37 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index 4d03be11..ce21d127 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -347,7 +347,7 @@ async fn main() { to.clone(), cid, amount - ); + ).unwrap(); if matches.dryrun_flag() { println!("0x{}", hex::encode(xt.function.encode())); None @@ -423,7 +423,7 @@ async fn main() { "transfer_all", to.clone(), cid - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() }, @@ -1030,7 +1030,7 @@ async fn main() { "register_participant", cid, proof - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // send and watch extrinsic until ready let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); @@ -1095,7 +1095,7 @@ async fn main() { "upgrade_registration", cid, proof - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // send and watch extrinsic until ready let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); @@ -1156,7 +1156,7 @@ async fn main() { "unregister_participant", cid, cc - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // Send and watch extrinsic until ready let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); @@ -1280,7 +1280,7 @@ async fn main() { cid, vote, attestees - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); @@ -1382,7 +1382,7 @@ async fn main() { "claim_rewards", cid, meetup_index - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); match meetup_index_arg { @@ -1562,7 +1562,7 @@ async fn main() { "Sudo", "sudo", batch_call - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); @@ -1657,7 +1657,7 @@ async fn main() { faucet_balance, whitelist, drip_amount - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); @@ -1712,7 +1712,7 @@ async fn main() { faucet_account, cid, cindex - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); @@ -1813,7 +1813,7 @@ async fn main() { "EncointerFaucet", "close_faucet", faucet_account.clone() - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); @@ -1954,7 +1954,7 @@ async fn main() { "EncointerDemocracy", "submit_proposal", ProposalAction::SetInactivityTimeout(inactivity_timeout) - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; println!("Proposal Submitted: Set inactivity timeout to {inactivity_timeout:?}"); @@ -1979,7 +1979,7 @@ async fn main() { .unwrap(); let max_keys = 1000; let storage_keys = - api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).unwrap(); + api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).await.unwrap(); if storage_keys.len() == max_keys as usize { error!("results can be wrong because max keys reached for query") } @@ -2038,7 +2038,7 @@ async fn main() { proposal_id, vote, reputation_vec - ); + ).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; println!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); @@ -2053,28 +2053,7 @@ async fn main() { .account_arg() .proposal_id_arg() }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| { - async move { - 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 proposal_id = matches.proposal_id_arg().unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerDemocracy", - "update_proposal_state", - proposal_id - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; - println!("Proposal state updated for proposal {proposal_id:?}"); - Ok(()) - } - }), + .runner(move |_args: &str, matches: &ArgMatches<'_>| update_proposal_state(_args, matches).await), ) // To handle when no subcommands match .no_cmd(|_args, _matches| { @@ -2084,6 +2063,21 @@ async fn main() { .run(); } +async fn update_proposal_state(_args: &str, matches: &ArgMatches<'_>) -> ApiResult<()> { + 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 proposal_id = matches.proposal_id_arg().unwrap(); + 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", "update_proposal_state", proposal_id) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); + let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; + println!("Proposal state updated for proposal {proposal_id:?}"); + Ok(()) +} async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { let url = format!( "{}:{}", @@ -2566,7 +2560,8 @@ async fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> let tx_payment_cid_arg = matches.tx_payment_cid_arg(); set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); let xt: EncointerXt<_> = - compose_extrinsic!(api, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid); + compose_extrinsic!(api, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid) + .unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); // send and watch extrinsic until ready let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); From 46fce4a8e6490e600198081de7457af58504ad84 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Mon, 4 Mar 2024 15:08:16 +0100 Subject: [PATCH 17/41] finally one first command compiles --- .../encointer-api-client-extension/src/lib.rs | 8 +- client/src/community_spec.rs | 3 +- client/src/main.rs | 3980 ++++++++--------- client/src/utils.rs | 49 +- 4 files changed, 2023 insertions(+), 2017 deletions(-) diff --git a/client/encointer-api-client-extension/src/lib.rs b/client/encointer-api-client-extension/src/lib.rs index 3fa004fe..2acbf7ce 100644 --- a/client/encointer-api-client-extension/src/lib.rs +++ b/client/encointer-api-client-extension/src/lib.rs @@ -1,6 +1,6 @@ use extrinsic_params::CommunityCurrencyTipExtrinsicParams; use substrate_api_client::{ - ac_primitives::{Config, DefaultRuntimeConfig, ExtrinsicSigner, WithExtrinsicParams}, + ac_primitives::{AssetRuntimeConfig, Config, ExtrinsicSigner, WithExtrinsicParams}, rpc::JsonrpseeClient, }; @@ -8,13 +8,13 @@ pub use encointer_node_notee_runtime::Runtime; pub use substrate_api_client::{api::error::Error as ApiClientError, Result}; pub type EncointerConfig = WithExtrinsicParams< - DefaultRuntimeConfig, - CommunityCurrencyTipExtrinsicParams, + AssetRuntimeConfig, + CommunityCurrencyTipExtrinsicParams, >; pub type Api = substrate_api_client::Api; -pub type ParentchainExtrinsicSigner = ExtrinsicSigner; +pub type ParentchainExtrinsicSigner = ExtrinsicSigner; pub type ExtrinsicAddress = ::Address; pub use ceremonies::*; diff --git a/client/src/community_spec.rs b/client/src/community_spec.rs index 51c6eb2d..823a89a2 100644 --- a/client/src/community_spec.rs +++ b/client/src/community_spec.rs @@ -185,6 +185,7 @@ pub fn new_community_call(spec: &T, metadata: &Metadata) -> Ne maybe_demurrage, maybe_income ) + .unwrap() } pub type AddLocationCall = ([u8; 2], CommunityIdentifier, Location); @@ -195,5 +196,5 @@ pub fn add_location_call( cid: CommunityIdentifier, loc: Location, ) -> AddLocationCall { - compose_call!(metadata, "EncointerCommunities", "add_location", cid, loc) + compose_call!(metadata, "EncointerCommunities", "add_location", cid, loc).unwrap() } diff --git a/client/src/main.rs b/client/src/main.rs index ce21d127..2dc0a2b9 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -98,1985 +98,1983 @@ async fn main() { env_logger::init(); Commander::new() - .options(|app| { - app.arg( - Arg::with_name("node-url") - .short("u") - .long("node-url") - .global(true) - .takes_value(true) - .value_name("STRING") - .default_value("ws://127.0.0.1") - .help("node url"), - ) - .arg( - Arg::with_name("node-port") - .short("p") - .long("node-port") - .global(true) - .takes_value(true) - .value_name("STRING") - .default_value("9944") - .help("node port"), - ) - .optional_cid_arg() - .tx_payment_cid_arg() - .name("encointer-client-notee") - .version(VERSION) - .author("Encointer Association ") - .about("interact with encointer-node-notee") - .after_help("") - .setting(AppSettings::ColoredHelp) - }) - .args(|_args, _matches| "") - .add_cmd( - Command::new("new-account") - .description("Imports account into the key store. Either creates a new account or with the supplied seed.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .seed_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - - let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - - // This does not place the key into the keystore if we have a seed, but it does - // place it into the keystore if the seed is none. - let key = store.sr25519_generate_new( - SR25519, - matches.seed_arg(), - ).unwrap(); - - if let Some(suri) = matches.seed_arg() { - store.insert(SR25519, suri, &key.0).unwrap(); - } - - drop(store); - println!("{}", key.to_ss58check()); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-accounts") - .description("lists all accounts in keystore") - .runner(|_args: &str, _matches: &ArgMatches<'_>| { - let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - info!("sr25519 keys:"); - for pubkey in store.public_keys::() - .unwrap() - .into_iter() - { - println!("{}", pubkey.to_ss58check()); - } - info!("ed25519 keys:"); - for pubkey in store.public_keys::() - .unwrap() - .into_iter() - { - println!("{}", pubkey.to_ss58check()); - } - drop(store); - Ok(()) - }), - ) - .add_cmd( - Command::new("print-metadata") - .description("query node metadata and print it as json to stdout") - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); - Ok(()) - }), - ) - .add_cmd( - Command::new("faucet") - .description("send some bootstrapping funds to supplied account(s)") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .fundees_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches).await; - api - .set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); - let accounts = matches.fundees_arg().unwrap(); - - let existential_deposit = api.get_existential_deposit().unwrap(); - info!("Existential deposit is = {:?}", existential_deposit); - - let mut nonce = api.get_nonce().unwrap(); - - let amount = reasonable_native_balance(&api); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - for account in accounts.into_iter() { - let to = get_accountid_from_str(account); - let call = compose_call!( - api.metadata(), - "Balances", - "transfer_keep_alive", - ExtrinsicAddress::from(to.clone()), - Compact(amount) - ); - let xt: EncointerXt<_> = compose_extrinsic_offline!( - api.clone().signer().unwrap(), - call.clone(), - api.extrinsic_params(nonce) - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // send and watch extrinsic until ready - println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); - let _blockh = api - .submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await - .unwrap(); - nonce += 1; - } - Ok(()) - }), - ) - .add_cmd( - Command::new("balance") - .description("query on-chain balance for AccountId. If --cid is supplied, returns balance in that community. Otherwise balance of native ERT token") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .all_flag() - .at_block_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - let account = matches.account_arg().unwrap(); - let maybe_at = matches.at_block_arg(); - let accountid = get_accountid_from_str(account); - match matches.cid_arg() { - Some(cid_str) => { - let balance = get_community_balance(&api, cid_str, &accountid, maybe_at); - println!{"{balance:?}"}; - } - None => { - if matches.all_flag() { - let community_balances = get_all_balances(&api, &accountid).unwrap(); - let bn = get_block_number(&api, maybe_at); - for b in community_balances.iter() { - let dr = get_demurrage_per_block(&api, b.0); - println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) - } - } - let balance = if let Some(data) = api.get_account_data(&accountid).unwrap() { - data.free - } else { - 0 - }; - println!("{balance}"); - } - }; - Ok(()) - }), - ) - .add_cmd( - Command::new("issuance") - .description("query total issuance for community. must supply --cid") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - let maybe_at = matches.at_block_arg(); - let cid_str = matches.cid_arg().expect("please supply argument --cid"); - let issuance = get_community_issuance(&api, cid_str, maybe_at); - println!{"{issuance:?}"}; - Ok(()) - }), - ) - .add_cmd( - Command::new("transfer") - .description("transfer funds from one account to another. If --cid is supplied, send that community (amount is fixpoint). Otherwise send native ERT tokens (amount is integer)") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .dryrun_flag() - .arg( - Arg::with_name("from") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("sender's AccountId in ss58check format"), - ) - .arg( - Arg::with_name("to") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("recipient's AccountId in ss58check format"), - ) - .arg( - Arg::with_name("amount") - .takes_value(true) - .required(true) - .value_name("U128") - .help("amount to be transferred"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches).await; - let arg_from = matches.value_of("from").unwrap(); - let arg_to = matches.value_of("to").unwrap(); - if !matches.dryrun_flag() { - let from = get_pair_from_str(arg_from); - info!("from ss58 is {}", from.public().to_ss58check()); - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - api.set_signer(signer); - } - let to = get_accountid_from_str(arg_to); - info!("to ss58 is {}", to.to_ss58check()); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let tx_hash = match matches.cid_arg() { - Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None).await; - let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) - .expect("amount can be converted to fixpoint"); - - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerBalances", - "transfer", - to.clone(), - cid, - amount - ).unwrap(); - if matches.dryrun_flag() { - println!("0x{}", hex::encode(xt.function.encode())); - None - } else { - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) - } - }, - None => { - let amount = matches.value_of("amount").unwrap().parse::() - .expect("amount can be converted to u128"); - let xt = api.balance_transfer_allow_death( - to.clone().into(), - amount - ); - if matches.dryrun_flag() { - println!("0x{}", hex::encode(xt.function.encode())); - None - } else { - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) - } - } - }; - if let Some(txh) = tx_hash { - info!("[+] Transaction included. Hash: {:?}\n", txh); - let result = api.get_account_data(&to).unwrap().unwrap(); - println!("balance for {} is now {}", to, result.free); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("transfer_all") - .description("transfer all available funds from one account to another for a community specified with --cid.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .arg( - Arg::with_name("from") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("sender's AccountId in ss58check format"), - ) - .arg( - Arg::with_name("to") - .takes_value(true) - .required(true) - .value_name("SS58") - .help("recipient's AccountId in ss58check format"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches).await; - let arg_from = matches.value_of("from").unwrap(); - let arg_to = matches.value_of("to").unwrap(); - let from = get_pair_from_str(arg_from); - let to = get_accountid_from_str(arg_to); - info!("from ss58 is {}", from.public().to_ss58check()); - info!("to ss58 is {}", to.to_ss58check()); - - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - api.set_signer(signer); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let tx_hash = match matches.cid_arg() { - Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None).await; - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerBalances", - "transfer_all", - to.clone(), - cid - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() - }, - None => { - error!("No cid specified"); - std::process::exit(exit_code::NO_CID_SPECIFIED); - } - }; - info!("[+] Transaction included. Hash: {:?}\n", tx_hash); - let result = api.get_account_data(&to).unwrap().unwrap(); - println!("balance for {} is now {}", to, result.free); - Ok(()) - - }), - ) - .add_cmd( - Command::new("listen") - .description("listen to on-chain events") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .arg( - Arg::with_name("events") - .short("e") - .long("await-events") - .takes_value(true) - .help("exit after given number of encointer events"), - ) - .arg( - Arg::with_name("blocks") - .short("b") - .long("await-blocks") - .takes_value(true) - .help("exit after given number of blocks"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - listen(matches); - Ok(()) - }), - ) - // start encointer stuff - .add_cmd( - Command::new("new-community") - .description("Register new community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .arg( - Arg::with_name("specfile") - .takes_value(true) - .required(true) - .help("enhanced geojson file that specifies a community"), - ) - .signer_arg("account with necessary privileges") - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - // -----setup - let spec_file = matches.value_of("specfile").unwrap(); - let spec = read_community_spec_from_file(spec_file); - let cid = spec.community_identifier(); - - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let signer = ParentchainExtrinsicSigner::new(signer); - - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - - // ------- create calls for xt's - let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); - // only the first meetup location has been registered now. register all others one-by-one - let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); - let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); - - - if matches.signer_arg().is_none() { - // return calls as `OpaqueCall`s to get the same return type in both branches - (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { - let sudo_new_community = sudo_call(api.metadata(), new_community_call); - let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); - info!("Printing raw sudo calls for js/apps for cid: {}", cid); - print_raw_call("sudo(new_community)", &sudo_new_community); - print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - - (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); - let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); - print_raw_call("collective_propose(new_community)", &propose_new_community); - print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - - (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) - }; - } - - // ---- send xt's to chain - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, new_community_call), matches.tx_payment_cid_arg()); - println!("{cid}"); - - if api.get_current_phase().unwrap() != CeremonyPhaseType::Registering { - error!("Wrong ceremony phase for registering new locations for {}", cid); - error!("Aborting without registering additional locations"); - std::process::exit(exit_code::WRONG_PHASE); - } - send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call), tx_payment_cid_arg); - Ok(()) - }), - ) - .add_cmd( - Command::new("add-locations") - .description("Register new locations for a community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges") - .dryrun_flag() - .arg( - Arg::with_name("specfile") - .takes_value(true) - .required(true) - .help("geojson file that specifies locations to add as points"), - ) - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - // -----setup - let spec_file = matches.value_of("specfile").unwrap(); - let spec = read_community_spec_from_file(spec_file); - - let mut api = get_chain_api(matches).await; - if !matches.dryrun_flag() { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - info!("signer ss58 is {}", signer.public().to_ss58check()); - let signer = ParentchainExtrinsicSigner::new(signer); - api.set_signer(signer); - } - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - - let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; - - let add_location_calls: Vec= spec.locations().into_iter().map(|l| - { - info!("adding location {:?}", l); - add_location_call(api.metadata(), cid, l) - } - ).collect(); - - let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { - [call] => OpaqueCall::from_tuple(call), - _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) - }; - - if matches.signer_arg().is_none() { - // return calls as `OpaqueCall`s to get the same return type in both branches - add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { - let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); - info!("Printing raw sudo calls for js/apps for cid: {}", cid); - print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - OpaqueCall::from_tuple(&sudo_add_location_batch) - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); - print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - OpaqueCall::from_tuple(&propose_add_location_batch) - }; - } - - if matches.dryrun_flag() { - println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); - } else { - // ---- send xt's to chain - if api.get_current_phase().unwrap() != CeremonyPhaseType::Registering { - error!("Wrong ceremony phase for registering new locations for {}", cid); - error!("Aborting without registering additional locations"); - std::process::exit(exit_code::WRONG_PHASE); - } - send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call), tx_payment_cid_arg); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("list-communities") - .description("list all registered communities") - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - let names = get_cid_names(&api).unwrap(); - println!("number of communities: {}", names.len()); - for n in names.iter() { - let loc = api.get_locations(n.cid).unwrap(); - println!("{}: {} locations: {}", n.cid, String::from_utf8(n.name.to_vec()).unwrap(), loc.len()); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("list-locations") - .description("list all meetup locations for a community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - }) - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - let maybe_at = matches.at_block_arg(); - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - maybe_at - ).await; - println!("listing locations for cid {cid}"); - let loc = api.get_locations(cid).unwrap(); - for l in loc.iter() { - println!("lat: {} lon: {} (raw lat: {} lon: {})", l.lat, l.lon, - i128::decode(&mut l.lat.encode().as_slice()).unwrap(), - i128::decode(&mut l.lon.encode().as_slice()).unwrap() - ); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("get-phase") - .description("read current ceremony phase from chain") - .runner(|_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - - // >>>> add some debug info as well - let bn = get_block_number(&api, None); - debug!("block number: {}", bn); - let cindex = get_ceremony_index(&api, None); - info!("ceremony index: {}", cindex); - let tnext: Moment = api.get_next_phase_timestamp().unwrap(); - debug!("next phase timestamp: {}", tnext); - // <<<< - - let phase = api.get_current_phase().unwrap(); - println!("{phase:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("next-phase") - .description("Advance ceremony state machine to next phase by ROOT call") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - - let mut api = get_chain_api(matches).await; - let signer = ParentchainExtrinsicSigner::new(signer); - api.set_signer(signer); - let next_phase_call = compose_call!( - api.metadata(), - "EncointerScheduler", - "next_phase" - ); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let next_phase_call = if contains_sudo_pallet(api.metadata()) { - let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(next_phase)", &sudo_next_phase_call); - - OpaqueCall::from_tuple(&sudo_next_phase_call) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_next_phase = collective_propose_call(api.metadata(), threshold, next_phase_call); - print_raw_call("collective_propose(next_phase)", &propose_next_phase); - - OpaqueCall::from_tuple(&propose_next_phase) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, next_phase_call), tx_payment_cid_arg); - - let phase = api.get_current_phase().unwrap(); - println!("Phase is now: {phase:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-participants") - .description("list all registered participants supplied community identifier and ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - println!("listing participants for cid {cid} and ceremony nr {cindex}"); - - let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None); - - let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - let account_query = |registry_index, p_index| api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None); - - let mut num_participants: Vec = vec![0, 0, 0, 0]; - for i in 0..registries.len() { - println!("Querying {}", registries[i]); - - let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); - println!("number of participants assigned: {count}"); - num_participants[i] = count; - for p_index in 1..count +1 { - let accountid: AccountId = account_query(i, p_index)?.unwrap(); - println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); - } - } - println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", - num_participants[0..=2].iter().sum::(), - num_participants[3], - num_participants[0..=3].iter().sum::() - ); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("list-meetups") - .description("list all assigned meetups for supplied community identifier and ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - let community_ceremony = (cid, cindex); - - println!("listing meetups for cid {cid} and ceremony nr {cindex}"); - - let stats = api.get_community_ceremony_stats(community_ceremony).unwrap(); - - let mut num_assignees = 0u64; - - for meetup in stats.meetups.iter() { - println!("MeetupRegistry[{:?}, {}] location is {:?}, {:?}", &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon); - - println!("MeetupRegistry[{:?}, {}] meeting time is {:?}", &community_ceremony, meetup.index, meetup.time); - - if !meetup.registrations.is_empty() { - let num = meetup.registrations.len(); - num_assignees += num as u64; - println!("MeetupRegistry[{:?}, {}] participants: {}", &community_ceremony, meetup.index, num); - for (participant, _registration) in meetup.registrations.iter() { - println!(" {participant}"); - } - } else { - println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); - } - } - println!("total number of assignees: {num_assignees}"); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("print-ceremony-stats") - .description("pretty prints all information for a community ceremony") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - let community_ceremony = (cid, cindex); - - let stats = api.get_community_ceremony_stats(community_ceremony).unwrap(); - - // serialization prints the the account id better than `debug` - println!("{}", serde_json::to_string_pretty(&stats).unwrap()); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("list-attestees") - .description("list all attestees for participants for supplied community identifier and ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .ceremony_index_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - - let current_ceremony_index = get_ceremony_index(&api, None).await; - - let cindex = matches.ceremony_index_arg() - .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - - println!("listing attestees for cid {cid} and ceremony nr {cindex}"); - - let wcount = get_attestee_count(&api, (cid, cindex)).await; - println!("number of attestees: {wcount}"); - - println!("listing participants for cid {cid} and ceremony nr {cindex}"); - - let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None).await; - - let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - let account_query = |registry_index, p_index| async move { - api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None).await - }; - - let mut participants_windex = HashMap::new(); - - for (i, item) in registries.iter().enumerate() { - println!("Querying {item}"); - - let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); - println!("number of participants assigned: {count}"); - - for p_index in 1..count +1 { - let accountid: AccountId = account_query(i, p_index)?.unwrap(); - - match get_participant_attestation_index(&api, (cid, cindex), &accountid).await { - Some(windex) => { - participants_windex.insert(windex as AttestationIndexType, accountid) - } - _ => continue, - }; - } - } - - let mut attestation_states = Vec::with_capacity(wcount as usize); - - for w in 1..wcount + 1 { - let attestor = participants_windex[&w].clone(); - let meetup_index = api.get_meetup_index(&(cid, cindex), &attestor).await.unwrap().unwrap(); - let attestees = api.get_attestees((cid, cindex), w).await.unwrap(); - let vote = api.get_meetup_participant_count_vote((cid, cindex), attestor.clone()).await.unwrap(); - let attestation_state = AttestationState::new( - (cid, cindex), - meetup_index, - vote, - w, - attestor, - attestees, - ); - - attestation_states.push(attestation_state); - } - - // Group attestation states by meetup index - attestation_states.sort_by(|a, b| a.meetup_index.partial_cmp(&b.meetup_index).unwrap()); - - for a in attestation_states.iter() { - println!("{a:?}"); - } - - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("list-reputables") - .description("list all reputables for all cycles within the current reputation-lifetime for all communities") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - .verbose_flag() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - - let is_verbose = matches.verbose_flag(); - let at_block = matches.at_block_arg(); - - let lifetime = get_reputation_lifetime(&api, at_block); - let current_ceremony_index = get_ceremony_index(&api, at_block); - - - let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); - let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); - - let community_ids = get_cid_names(&api).unwrap().into_iter().map(|names| names.cid); - - let mut reputables_csv = Vec::new(); - - println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); - for community_id in community_ids { - println!("Community ID: {community_id:?}"); - let mut reputables: HashMap = HashMap::new(); - for ceremony_index in &ceremony_indices { - let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block); - println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); - for attendee in attendees { - reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); - *reputables.entry(attendee.clone()).or_insert(0) += 1; - } - } - println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); - } - if is_verbose { - for reputable in reputables_csv { - println!("{reputable}"); - } - } - Ok(()) - }), - ) - .add_cmd( - Command::new("register-participant") - .description("Register encointer ceremony participant for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .signer_arg("Account which signs the tx.") - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who) - }; - - let api = get_chain_api(matches).await; - let cindex = get_ceremony_index(&api, None); - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ).await; - let rep = get_reputation(&api, &accountid, cid, cindex -1); - info!("{} has reputation {:?}", accountid, rep); - let proof = match rep { - Reputation::Unverified => None, - Reputation::UnverifiedReputable => None, // this should never by the case during Registering! - Reputation::VerifiedUnlinked => Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), - Reputation::VerifiedLinked => { - error!("reputation of {} has already been linked! Not registering again", accountid); - std::process::exit(exit_code::INVALID_REPUTATION); - }, - }; - debug!("proof: {:x?}", proof.encode()); - let current_phase = api.get_current_phase().unwrap(); - if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - error!("wrong ceremony phase for registering participant"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "register_participant", - cid, - proof - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("upgrade-registration") - .description("Upgrade registration to repuable for encointer ceremony participant for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .signer_arg("Account which signs the tx.") - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who) - }; - - let api = get_chain_api(matches).await; - let cindex = get_ceremony_index(&api, None); - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ).await; - - let current_phase = api.get_current_phase().unwrap(); - if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - error!("wrong ceremony phase for registering participant"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut reputation_cindex = cindex; - if current_phase == CeremonyPhaseType::Registering { - reputation_cindex -= 1; - } - let rep = get_reputation(&api, &accountid, cid, reputation_cindex); - info!("{} has reputation {:?}", accountid, rep); - let proof = match rep { - Reputation::VerifiedUnlinked => prove_attendance(accountid, cid, reputation_cindex, arg_who), - _ => { - error!("No valid reputation in last ceremony."); - std::process::exit(exit_code::INVALID_REPUTATION); - }, - }; - - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "upgrade_registration", - cid, - proof - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("unregister-participant") - .description("Unregister encointer ceremony participant for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .signer_arg("Account which signs the tx.") - .ceremony_index_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who) - }; - - let api = get_chain_api(matches).await; - - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ).await; - - - let cc = match matches.ceremony_index_arg() { - Some(cindex_arg) => { - let current_ceremony_index = get_ceremony_index(&api, None); - let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - Some((cid, cindex)) - }, - None => None, - }; - - let current_phase = api.get_current_phase().unwrap(); - if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - error!("wrong ceremony phase for unregistering"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "unregister_participant", - cid, - cc - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - // Send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("endorse-newcomers") - .description("Endorse newbies with a bootstrapper account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .bootstrapper_arg() - .endorsees_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - - extract_and_execute( - matches, |mut api, cid| endorse_newcomers(&mut api, cid, matches) - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("get-bootstrappers-with-remaining-newbie-tickets") - .description("Get the bootstrappers along with the remaining newbie tickets") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let bs_with_tickets : Vec = extract_and_execute( - matches, |api, cid| get_bootstrappers_with_remaining_newbie_tickets(&api, cid) - ).unwrap(); - - info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); - - // transform it to simple tuples, which is easier to parse in python - let bt_vec = bs_with_tickets.into_iter() - .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)).collect::>(); - - println!("{bt_vec:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("get-proof-of-attendance") - .description("creates a proof of ProofOfAttendances for an for the given ceremony index") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .setting(AppSettings::AllowLeadingHyphen) - .account_arg() - .ceremony_index_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let api = get_chain_api(matches).await; - - let current_ceremony_index = get_ceremony_index(&api, None); - - let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); - let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - - let cid = verify_cid( - &api, - matches.cid_arg().expect("please supply argument --cid"), - None - ).await; - - debug!("Getting proof for ceremony index: {:?}", cindex); - let proof = prove_attendance(accountid, cid, cindex, arg_who); - info!("Proof: {:?}\n", &proof); - println!("0x{}", hex::encode(proof.encode())); - - Ok(()) - }), - ) - .add_cmd( - Command::new("attest-attendees") - .description("Register encointer ceremony claim of attendances for supplied community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .optional_cid_arg() - .attestees_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let who = matches.account_arg().map(get_pair_from_str).unwrap(); - - let attestees: Vec<_> = matches.attestees_arg().unwrap() - .into_iter() - .map(get_accountid_from_str) - .collect(); - - let vote = attestees.len() as u32 + 1u32; - - debug!("attestees: {:?}", attestees); - - info!("send attest_attendees by {}", who.public()); - - let mut api = - get_chain_api(matches).await; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ).await; - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "attest_attendees", - cid, - vote, - attestees - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - - println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("new-claim") - .description("create a fresh claim of attendance for account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .arg( - Arg::with_name("vote") - .takes_value(true) - .required(true) - .value_name("VOTE") - .help("participant's vote on the number of people present at meetup time"), - ) - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - extract_and_execute( - matches, |api, cid| -> ApiResult<()>{ - let arg_who = matches.account_arg().unwrap(); - let claimant = get_pair_from_str(arg_who); - - let n_participants = matches - .value_of("vote") - .unwrap() - .parse::() - .unwrap(); - - let claim = new_claim_for(&api, &claimant.into(), cid, n_participants); - - println!("{}", hex::encode(claim)); - Ok(()) - } - ).unwrap(); - - Ok(()) - }), - ) - .add_cmd( - Command::new("claim-reward") - .description("Claim the rewards for all meetup participants of the last ceremony.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("Account which signs the tx.") - .meetup_index_arg() - .all_flag() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - - extract_and_execute( - matches, |api, cid| async move { - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => panic!("please specify --signer.") - }; - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer.clone()); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let meetup_index_arg = matches.meetup_index_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - if matches.all_flag() { - let mut cindex = get_ceremony_index(&api, None); - if api.get_current_phase().unwrap() == CeremonyPhaseType::Registering { - cindex -= 1; - } - let meetup_count = api - .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None) - .unwrap().unwrap_or(0u64); - let calls: Vec<_> = (1u64..=meetup_count) - .map(|idx| compose_call!( - api.metadata(), - ENCOINTER_CEREMONIES, - "claim_rewards", - cid, - Option::::Some(idx) - )) - .collect(); - let batch_call = compose_call!( - api.metadata(), - "Utility", - "batch", - calls - ); - send_and_wait_for_in_block(&api, xt(&api, batch_call), tx_payment_cid_arg); - println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); - } else { - let meetup_index = meetup_index_arg; - let xt: EncointerXt<_> = compose_extrinsic!( - api, - ENCOINTER_CEREMONIES, - "claim_rewards", - cid, - meetup_index - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - match meetup_index_arg { - Some(idx)=>{println!("Claiming reward for meetup_index {idx}. xt-status: '{:?}'", report.status);} - None=>{println!("Claiming reward for {}. xt-status: 'ready'", signer.public_account_id());} - } - } - } - ); - - Ok(()) - }), - ) - .add_cmd( - Command::new("reputation") - .description("List reputation history for an account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg()}) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - let account = matches.account_arg().unwrap(); - let account_id = get_accountid_from_str(account); - if let Some(reputation) = get_reputation_history(&api, &account_id) { - for rep in reputation.iter() { - println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); - } - } else { - error!("could not fetch reputation over rpc"); - std::process::exit(exit_code::RPC_ERROR); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("create-business") - .description("Register a community business on behalf of the account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .ipfs_cid_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).unwrap(); - Ok(()) - }), - ) - .add_cmd( - Command::new("update-business") - .description("Update an already existing community business on behalf of the account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .ipfs_cid_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).unwrap(); - Ok(()) - }), - ) - .add_cmd( - Command::new("create-offering") - .description("Create an offering for the business belonging to account") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .ipfs_cid_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - send_bazaar_xt(matches, &BazaarCalls::CreateOffering).unwrap(); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-businesses") - .description("List businesses for a community") - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - - let businesses = extract_and_execute( - matches, |api, cid| get_businesses(&api, cid).unwrap() - ); - // only print plain businesses to be able to parse them in python scripts - println!("{businesses:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-offerings") - .description("List offerings for a community") - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let offerings = extract_and_execute( - matches, |api, cid| get_offerings(&api, cid).unwrap() - ); - // only print plain offerings to be able to parse them in python scripts - println!("{offerings:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-business-offerings") - .description("List offerings for a business") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let account = matches.account_arg().map(get_accountid_from_str).unwrap(); - - let offerings = extract_and_execute( - matches, |api, cid| get_offerings_for_business(&api, cid, account).unwrap() - ); - // only print plain offerings to be able to parse them in python scripts - println!("{offerings:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("purge-community-ceremony") - .description("purge all history within the provided ceremony index range for the specified community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .from_cindex_arg() - .to_cindex_arg() - - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let sudoer = AccountKeyring::Alice.pair(); - let signer = ParentchainExtrinsicSigner::new(sudoer); - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - let current_ceremony_index = get_ceremony_index(&api, None); - - let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); - let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); - - let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); - let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); - - if from_cindex > to_cindex { - panic!("'from' <= 'to' ceremony index violated"); - } - let cid = verify_cid(&api, - matches - .cid_arg() - .expect("please supply argument --cid"), - None - ).await; - println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); - - let calls: Vec<_> = (from_cindex..=to_cindex) - .map(|idx| compose_call!( - api.metadata(), - "EncointerCeremonies", - "purge_community_ceremony", - (cid, idx) - )) - .collect(); - let batch_call = compose_call!( - api.metadata(), - "Utility", - "batch", - calls - ); - let unsigned_sudo_call = compose_call!( - api.metadata(), - "Sudo", - "sudo", - batch_call.clone() - ); - info!("raw sudo batch call to sign with js/apps {}: 0x{}", cid, hex::encode(unsigned_sudo_call.encode())); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "Sudo", - "sudo", - batch_call - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); - info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); - Ok(()) - }), - ) - .add_cmd( - Command::new("set-meetup-time-offset") - .description("signed value to offset the ceremony meetup time relative to solar noon") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .setting(AppSettings::AllowLeadingHyphen) - .time_offset_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let mut api = get_chain_api(matches).await; - let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); - api - .set_signer(signer); - let time_offset = matches.time_offset_arg().unwrap_or(0); - let call = compose_call!( - api.metadata(), - "EncointerCeremonies", - "set_meetup_time_offset", - time_offset - ); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let privileged_call = if contains_sudo_pallet(api.metadata()) { - let sudo_call = sudo_call(api.metadata(), call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(...)", &sudo_call); - OpaqueCall::from_tuple(&sudo_call) - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_call = collective_propose_call(api.metadata(), threshold, call); - print_raw_call("collective_propose(...)", &propose_call); - OpaqueCall::from_tuple(&propose_call) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt = xt(&api, privileged_call); - send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg); - Ok(()) - }), - ) - .add_cmd( - Command::new("create-faucet") - .description("Create faucet") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_name_arg() - .faucet_balance_arg() - .faucet_drip_amount_arg() - .whitelist_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - 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 faucet_name_raw = matches.faucet_name_arg().unwrap(); - let faucet_balance = matches.faucet_balance_arg().unwrap(); - let drip_amount = matches.faucet_drip_amount_arg().unwrap(); - - let whitelist = matches.whitelist_arg().map(|wl| { - let whitelist_vec: Vec<_> = wl - .into_iter() - .map(|c| async move { verify_cid(&api, - c, - None).await}) - .collect(); - WhiteListType::try_from(whitelist_vec).unwrap() - }); - - let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerFaucet", - "create_faucet", - faucet_name, - faucet_balance, - whitelist, - drip_amount - ).unwrap(); - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - - - let result = api.submit_and_watch_extrinsic_until_success(xt, false).await; - - match result { - Ok(report) => { - for event in report.events.unwrap().iter() { - if event.pallet_name() == "EncointerFaucet" && event.variant_name() == "FaucetCreated" { - println!("{}", AccountId::decode(&mut event.field_bytes()[0..32].as_ref()).unwrap().to_ss58check()); - } - } - }, - Err(e) => { - println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - }, - }; - - Ok(()) - }), - ) - .add_cmd( - Command::new("drip-faucet") - .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_account_arg() - .cindex_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - 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 cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - - let cindex = matches.cindex_arg().unwrap(); - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerFaucet", - "drip", - faucet_account, - cid, - cindex - ).unwrap(); - - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - - let result = api.submit_and_watch_extrinsic_until_success(xt, false).await; - - match result { - Ok(_report) => { - println!("Faucet dripped to {}", who.public()); - - }, - Err(e) => { - println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - }, - }; - - Ok(()) - }), - ) - .add_cmd( - Command::new("dissolve-faucet") - .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - .faucet_account_arg() - .faucet_beneficiary_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let signer = ParentchainExtrinsicSigner::new(signer); - - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); - - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - - let dissolve_faucet_call = compose_call!( - api.metadata(), - "EncointerFaucet", - "dissolve_faucet", - faucet_account.clone(), - beneficiary - ); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { - let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); - - OpaqueCall::from_tuple(&dissolve_faucet_call) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_dissolve_faucet = collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); - print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); - - OpaqueCall::from_tuple(&propose_dissolve_faucet) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call), tx_payment_cid_arg); - - println!("Faucet dissolved: {faucet_account:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("close-faucet") - .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_account_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - 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, - ))); - - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerFaucet", - "close_faucet", - faucet_account.clone() - ).unwrap(); - - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - - println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); - Ok(()) - }), - ) - .add_cmd( - Command::new("set-faucet-reserve-amount") - .description("Set faucet pallet reserve amount") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - .faucet_reserve_amount_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let signer = ParentchainExtrinsicSigner::new(signer); - - let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); - - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - - let set_reserve_amount_call = compose_call!( - api.metadata(), - "EncointerFaucet", - "set_reserve_amount", - reserve_amount - ); - // return calls as `OpaqueCall`s to get the same return type in both branches - let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { - let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); - - OpaqueCall::from_tuple(&set_reserve_amount_call) - - } else { - let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_set_reserve_amount = collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); - print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); - - OpaqueCall::from_tuple(&propose_set_reserve_amount) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - send_and_wait_for_in_block(&api, xt(&api, set_reserve_amount_call), tx_payment_cid_arg); - - println!("Reserve amount set: {reserve_amount:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-faucets") - .description("list all faucets. use -v to get faucet details.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - .verbose_flag() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - - let is_verbose = matches.verbose_flag(); - let at_block = matches.at_block_arg(); - - let key_prefix = api - .get_storage_map_key_prefix( - "EncointerFaucet", - "Faucets", - ) - .unwrap(); - - let max_keys = 1000; - let storage_keys = - api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).unwrap(); - - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - - for storage_key in storage_keys.iter() { - let key_postfix = storage_key.as_ref(); - let faucet_address = AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); - let faucet: Faucet = api.get_storage_by_key(storage_key.clone(), at_block).unwrap().unwrap(); - - if is_verbose { - println!("address: {}", faucet_address.to_ss58check()); - println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); - println!("creator: {}", AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check()); - println!("balance: {}", api.get_account_data(&faucet_address).unwrap().unwrap().free); - println!("drip amount: {}", faucet.drip_amount); - if let Some(whitelist) = faucet.whitelist { - println!("whitelist:"); - for cid in whitelist.to_vec() { - println!("{}", cid); - } - } else { - println!("whitelist: None"); - } - println!(""); - } else { - println!{"{}", faucet_address}; - } - - } - Ok(()) - }), - ) - .add_cmd( - Command::new("submit-set-inactivity-timeout-proposal") - .description("Submit set inactivity timeout proposal") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .inactivity_timeout_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - 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 inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerDemocracy", - "submit_proposal", - ProposalAction::SetInactivityTimeout(inactivity_timeout) - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; - println!("Proposal Submitted: Set inactivity timeout to {inactivity_timeout:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("list-proposals") - .description("list all proposals.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - let api = get_chain_api(matches).await; - let at_block = matches.at_block_arg(); - let key_prefix = api - .get_storage_map_key_prefix( - "EncointerDemocracy", - "Proposals", - ).await - .unwrap(); - let max_keys = 1000; - let storage_keys = - api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).await.unwrap(); - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - 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 = api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); - println!("id: {}", proposal_id); - println!("action: {:?}", proposal.action); - println!("start block: {}", proposal.start); - println!("start cindex: {}", proposal.start_cindex); - println!("state: {:?}", proposal.state); - println!(""); - } - Ok(()) - }), - ) - .add_cmd( - Command::new("vote") - .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .proposal_id_arg() - .vote_arg() - .reputation_vec_arg() - }) - .runner(async move |_args: &str, matches: &ArgMatches<'_>| { - 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 proposal_id = matches.proposal_id_arg().unwrap(); - let vote_raw = matches.vote_arg().unwrap(); - let vote = match vote_raw { - "aye" => Vote::Aye, - "nay" => Vote::Nay, - &_ => panic!("invalid vote") - }; - let reputation_vec: ReputationVec> = matches.reputation_vec_arg().map(|rv| { - let reputations: Vec<(CommunityIdentifier, CeremonyIndexType)> = rv - .into_iter() - .map(|rep| async move { - let cc: Vec<_> = rep.split("_").collect(); - (verify_cid(&api,cc[0],None), cc[1].parse().unwrap()).await - }).collect(); - ReputationVec::try_from(reputations).unwrap() - }).unwrap(); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerDemocracy", - "vote", - proposal_id, - vote, - reputation_vec - ).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; - println!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); - Ok(()) - }), - ) - .add_cmd( - Command::new("update-proposal-state") - .description("Update proposal state") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .proposal_id_arg() - }) - .runner(move |_args: &str, matches: &ArgMatches<'_>| update_proposal_state(_args, matches).await), - ) - // To handle when no subcommands match - .no_cmd(|_args, _matches| { - println!("No subcommand matched"); - Ok(()) - }) - .run(); + .options(|app| { + app.arg( + Arg::with_name("node-url") + .short("u") + .long("node-url") + .global(true) + .takes_value(true) + .value_name("STRING") + .default_value("ws://127.0.0.1") + .help("node url"), + ) + .arg( + Arg::with_name("node-port") + .short("p") + .long("node-port") + .global(true) + .takes_value(true) + .value_name("STRING") + .default_value("9944") + .help("node port"), + ) + .optional_cid_arg() + .tx_payment_cid_arg() + .name("encointer-client-notee") + .version(VERSION) + .author("Encointer Association ") + .about("interact with encointer-node-notee") + .after_help("") + .setting(AppSettings::ColoredHelp) + }) + .args(|_args, _matches| "") + // .add_cmd( + // Command::new("new-account") + // .description("Imports account into the key store. Either creates a new account or with the supplied seed.") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .seed_arg() + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // + // let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + // + // // This does not place the key into the keystore if we have a seed, but it does + // // place it into the keystore if the seed is none. + // let key = store.sr25519_generate_new( + // SR25519, + // matches.seed_arg(), + // ).unwrap(); + // + // if let Some(suri) = matches.seed_arg() { + // store.insert(SR25519, suri, &key.0).unwrap(); + // } + // + // drop(store); + // println!("{}", key.to_ss58check()); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-accounts") + // .description("lists all accounts in keystore") + // .runner(|_args: &str, _matches: &ArgMatches<'_>| { + // let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + // info!("sr25519 keys:"); + // for pubkey in store.public_keys::() + // .unwrap() + // .into_iter() + // { + // println!("{}", pubkey.to_ss58check()); + // } + // info!("ed25519 keys:"); + // for pubkey in store.public_keys::() + // .unwrap() + // .into_iter() + // { + // println!("{}", pubkey.to_ss58check()); + // } + // drop(store); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("print-metadata") + // .description("query node metadata and print it as json to stdout") + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("faucet") + // .description("send some bootstrapping funds to supplied account(s)") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .fundees_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let mut api = get_chain_api(matches).await; + // api + // .set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); + // let accounts = matches.fundees_arg().unwrap(); + // + // let existential_deposit = api.get_existential_deposit().unwrap(); + // info!("Existential deposit is = {:?}", existential_deposit); + // + // let mut nonce = api.get_nonce().unwrap(); + // + // let amount = reasonable_native_balance(&api); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // for account in accounts.into_iter() { + // let to = get_accountid_from_str(account); + // let call = compose_call!( + // api.metadata(), + // "Balances", + // "transfer_keep_alive", + // ExtrinsicAddress::from(to.clone()), + // Compact(amount) + // ).unwrap(); + // let xt: EncointerXt<_> = compose_extrinsic_offline!( + // api.clone().signer().unwrap(), + // call.clone(), + // api.extrinsic_params(nonce) + // ); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // // send and watch extrinsic until ready + // println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); + // let _blockh = api + // .submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await + // .unwrap(); + // nonce += 1; + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("balance") + // .description("query on-chain balance for AccountId. If --cid is supplied, returns balance in that community. Otherwise balance of native ERT token") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .all_flag() + // .at_block_arg() + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // let account = matches.account_arg().unwrap(); + // let maybe_at = matches.at_block_arg(); + // let accountid = get_accountid_from_str(account); + // match matches.cid_arg() { + // Some(cid_str) => { + // let balance = get_community_balance(&api, cid_str, &accountid, maybe_at); + // println!{"{balance:?}"}; + // } + // None => { + // if matches.all_flag() { + // let community_balances = get_all_balances(&api, &accountid).unwrap(); + // let bn = get_block_number(&api, maybe_at); + // for b in community_balances.iter() { + // let dr = get_demurrage_per_block(&api, b.0); + // println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) + // } + // } + // let balance = if let Some(data) = api.get_account_data(&accountid).unwrap() { + // data.free + // } else { + // 0 + // }; + // println!("{balance}"); + // } + // }; + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("issuance") + // .description("query total issuance for community. must supply --cid") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .at_block_arg() + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // let maybe_at = matches.at_block_arg(); + // let cid_str = matches.cid_arg().expect("please supply argument --cid"); + // let issuance = get_community_issuance(&api, cid_str, maybe_at); + // println!{"{issuance:?}"}; + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("transfer") + // .description("transfer funds from one account to another. If --cid is supplied, send that community (amount is fixpoint). Otherwise send native ERT tokens (amount is integer)") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .dryrun_flag() + // .arg( + // Arg::with_name("from") + // .takes_value(true) + // .required(true) + // .value_name("SS58") + // .help("sender's AccountId in ss58check format"), + // ) + // .arg( + // Arg::with_name("to") + // .takes_value(true) + // .required(true) + // .value_name("SS58") + // .help("recipient's AccountId in ss58check format"), + // ) + // .arg( + // Arg::with_name("amount") + // .takes_value(true) + // .required(true) + // .value_name("U128") + // .help("amount to be transferred"), + // ) + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // let mut api = get_chain_api(matches).await; + // let arg_from = matches.value_of("from").unwrap(); + // let arg_to = matches.value_of("to").unwrap(); + // if !matches.dryrun_flag() { + // let from = get_pair_from_str(arg_from); + // info!("from ss58 is {}", from.public().to_ss58check()); + // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + // api.set_signer(signer); + // } + // let to = get_accountid_from_str(arg_to); + // info!("to ss58 is {}", to.to_ss58check()); + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // let tx_hash = match matches.cid_arg() { + // Some(cid_str) => { + // let cid = verify_cid(&api, cid_str, None).await; + // let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) + // .expect("amount can be converted to fixpoint"); + // + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerBalances", + // "transfer", + // to.clone(), + // cid, + // amount + // ).unwrap(); + // if matches.dryrun_flag() { + // println!("0x{}", hex::encode(xt.function.encode())); + // None + // } else { + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + // } + // }, + // None => { + // let amount = matches.value_of("amount").unwrap().parse::() + // .expect("amount can be converted to u128"); + // let xt = api.balance_transfer_allow_death( + // to.clone().into(), + // amount + // ); + // if matches.dryrun_flag() { + // println!("0x{}", hex::encode(xt.function.encode())); + // None + // } else { + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + // } + // } + // }; + // if let Some(txh) = tx_hash { + // info!("[+] Transaction included. Hash: {:?}\n", txh); + // let result = api.get_account_data(&to).unwrap().unwrap(); + // println!("balance for {} is now {}", to, result.free); + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("transfer_all") + // .description("transfer all available funds from one account to another for a community specified with --cid.") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .arg( + // Arg::with_name("from") + // .takes_value(true) + // .required(true) + // .value_name("SS58") + // .help("sender's AccountId in ss58check format"), + // ) + // .arg( + // Arg::with_name("to") + // .takes_value(true) + // .required(true) + // .value_name("SS58") + // .help("recipient's AccountId in ss58check format"), + // ) + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // let mut api = get_chain_api(matches).await; + // let arg_from = matches.value_of("from").unwrap(); + // let arg_to = matches.value_of("to").unwrap(); + // let from = get_pair_from_str(arg_from); + // let to = get_accountid_from_str(arg_to); + // info!("from ss58 is {}", from.public().to_ss58check()); + // info!("to ss58 is {}", to.to_ss58check()); + // + // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + // api.set_signer(signer); + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // let tx_hash = match matches.cid_arg() { + // Some(cid_str) => { + // let cid = verify_cid(&api, cid_str, None).await; + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerBalances", + // "transfer_all", + // to.clone(), + // cid + // ).unwrap(); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() + // }, + // None => { + // error!("No cid specified"); + // std::process::exit(exit_code::NO_CID_SPECIFIED); + // } + // }; + // info!("[+] Transaction included. Hash: {:?}\n", tx_hash); + // let result = api.get_account_data(&to).unwrap().unwrap(); + // println!("balance for {} is now {}", to, result.free); + // Ok(()) + // + // }), + // ) + // .add_cmd( + // Command::new("listen") + // .description("listen to on-chain events") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .arg( + // Arg::with_name("events") + // .short("e") + // .long("await-events") + // .takes_value(true) + // .help("exit after given number of encointer events"), + // ) + // .arg( + // Arg::with_name("blocks") + // .short("b") + // .long("await-blocks") + // .takes_value(true) + // .help("exit after given number of blocks"), + // ) + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // listen(matches); + // Ok(()) + // }), + // ) + // // start encointer stuff + // .add_cmd( + // Command::new("new-community") + // .description("Register new community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .arg( + // Arg::with_name("specfile") + // .takes_value(true) + // .required(true) + // .help("enhanced geojson file that specifies a community"), + // ) + // .signer_arg("account with necessary privileges") + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // // -----setup + // let spec_file = matches.value_of("specfile").unwrap(); + // let spec = read_community_spec_from_file(spec_file); + // let cid = spec.community_identifier(); + // + // let signer = matches.signer_arg() + // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + // let signer = ParentchainExtrinsicSigner::new(signer); + // + // let mut api = get_chain_api(matches).await; + // api.set_signer(signer); + // + // + // // ------- create calls for xt's + // let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); + // // only the first meetup location has been registered now. register all others one-by-one + // let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); + // let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); + // + // + // if matches.signer_arg().is_none() { + // // return calls as `OpaqueCall`s to get the same return type in both branches + // (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { + // let sudo_new_community = sudo_call(api.metadata(), new_community_call); + // let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); + // info!("Printing raw sudo calls for js/apps for cid: {}", cid); + // print_raw_call("sudo(new_community)", &sudo_new_community); + // print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + // + // (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) + // + // } else { + // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + // let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); + // let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); + // print_raw_call("collective_propose(new_community)", &propose_new_community); + // print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + // + // (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) + // }; + // } + // + // // ---- send xt's to chain + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // send_and_wait_for_in_block(&api, xt(&api, new_community_call), matches.tx_payment_cid_arg()); + // println!("{cid}"); + // + // if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + // error!("Wrong ceremony phase for registering new locations for {}", cid); + // error!("Aborting without registering additional locations"); + // std::process::exit(exit_code::WRONG_PHASE); + // } + // send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call), tx_payment_cid_arg); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("add-locations") + // .description("Register new locations for a community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .signer_arg("account with necessary privileges") + // .dryrun_flag() + // .arg( + // Arg::with_name("specfile") + // .takes_value(true) + // .required(true) + // .help("geojson file that specifies locations to add as points"), + // ) + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // // -----setup + // let spec_file = matches.value_of("specfile").unwrap(); + // let spec = read_community_spec_from_file(spec_file); + // + // let mut api = get_chain_api(matches).await; + // if !matches.dryrun_flag() { + // let signer = matches.signer_arg() + // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + // info!("signer ss58 is {}", signer.public().to_ss58check()); + // let signer = ParentchainExtrinsicSigner::new(signer); + // api.set_signer(signer); + // } + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // + // let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; + // + // let add_location_calls: Vec= spec.locations().into_iter().map(|l| + // { + // info!("adding location {:?}", l); + // add_location_call(api.metadata(), cid, l) + // } + // ).collect(); + // + // let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { + // [call] => OpaqueCall::from_tuple(call), + // _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) + // }; + // + // if matches.signer_arg().is_none() { + // // return calls as `OpaqueCall`s to get the same return type in both branches + // add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { + // let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); + // info!("Printing raw sudo calls for js/apps for cid: {}", cid); + // print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + // OpaqueCall::from_tuple(&sudo_add_location_batch) + // } else { + // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + // let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); + // print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + // OpaqueCall::from_tuple(&propose_add_location_batch) + // }; + // } + // + // if matches.dryrun_flag() { + // println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); + // } else { + // // ---- send xt's to chain + // if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + // error!("Wrong ceremony phase for registering new locations for {}", cid); + // error!("Aborting without registering additional locations"); + // std::process::exit(exit_code::WRONG_PHASE); + // } + // send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call), tx_payment_cid_arg); + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-communities") + // .description("list all registered communities") + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // let names = get_cid_names(&api).await.unwrap(); + // println!("number of communities: {}", names.len()); + // for n in names.iter() { + // let loc = api.get_locations(n.cid).await.unwrap(); + // println!("{}: {} locations: {}", n.cid, String::from_utf8(n.name.to_vec()).unwrap(), loc.len()); + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-locations") + // .description("list all meetup locations for a community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .at_block_arg() + // }) + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // let maybe_at = matches.at_block_arg(); + // let cid = verify_cid(&api, + // matches + // .cid_arg() + // .expect("please supply argument --cid"), + // maybe_at + // ).await; + // println!("listing locations for cid {cid}"); + // let loc = api.get_locations(cid).await.unwrap(); + // for l in loc.iter() { + // println!("lat: {} lon: {} (raw lat: {} lon: {})", l.lat, l.lon, + // i128::decode(&mut l.lat.encode().as_slice()).unwrap(), + // i128::decode(&mut l.lon.encode().as_slice()).unwrap() + // ); + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("get-phase") + // .description("read current ceremony phase from chain") + // .runner(|_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // + // // >>>> add some debug info as well + // let bn = get_block_number(&api, None).await; + // debug!("block number: {}", bn); + // let cindex = get_ceremony_index(&api, None).await; + // info!("ceremony index: {}", cindex); + // let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); + // debug!("next phase timestamp: {}", tnext); + // // <<<< + // + // let phase = api.get_current_phase().await.unwrap(); + // println!("{phase:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("next-phase") + // .description("Advance ceremony state machine to next phase by ROOT call") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .signer_arg("account with necessary privileges (sudo or councillor)") + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let signer = matches.signer_arg() + // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + // + // let mut api = get_chain_api(matches).await; + // let signer = ParentchainExtrinsicSigner::new(signer); + // api.set_signer(signer); + // let next_phase_call = compose_call!( + // api.metadata(), + // "EncointerScheduler", + // "next_phase" + // ).unwrap(); + // + // // return calls as `OpaqueCall`s to get the same return type in both branches + // let next_phase_call = if contains_sudo_pallet(api.metadata()) { + // let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); + // info!("Printing raw sudo call for js/apps:"); + // print_raw_call("sudo(next_phase)", &sudo_next_phase_call); + // + // OpaqueCall::from_tuple(&sudo_next_phase_call) + // + // } else { + // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + // let propose_next_phase = collective_propose_call(api.metadata(), threshold, next_phase_call).await; + // print_raw_call("collective_propose(next_phase)", &propose_next_phase); + // + // OpaqueCall::from_tuple(&propose_next_phase) + // }; + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // send_and_wait_for_in_block(&api, xt(&api, next_phase_call), tx_payment_cid_arg); + // + // let phase = api.get_current_phase().await.unwrap(); + // println!("Phase is now: {phase:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-participants") + // .description("list all registered participants supplied community identifier and ceremony index") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .ceremony_index_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // extract_and_execute( + // matches, |api, cid| -> ApiResult<()>{ + // + // let current_ceremony_index = get_ceremony_index(&api, None).await; + // + // let cindex = matches.ceremony_index_arg() + // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); + // + // println!("listing participants for cid {cid} and ceremony nr {cindex}"); + // + // let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; + // let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None).await; + // + // let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; + // let account_query = |registry_index, p_index| api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None).await; + // + // let mut num_participants: Vec = vec![0, 0, 0, 0]; + // for i in 0..registries.len() { + // println!("Querying {}", registries[i]); + // + // let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); + // println!("number of participants assigned: {count}"); + // num_participants[i] = count; + // for p_index in 1..count +1 { + // let accountid: AccountId = account_query(i, p_index)?.unwrap(); + // println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); + // } + // } + // println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", + // num_participants[0..=2].iter().sum::(), + // num_participants[3], + // num_participants[0..=3].iter().sum::() + // ); + // Ok(()) + // } + // ).await.unwrap(); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-meetups") + // .description("list all assigned meetups for supplied community identifier and ceremony index") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .ceremony_index_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // extract_and_execute( + // matches, |api, cid| -> ApiResult<()>{ + // + // let current_ceremony_index = get_ceremony_index(&api, None).await; + // + // let cindex = matches.ceremony_index_arg() + // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); + // + // let community_ceremony = (cid, cindex); + // + // println!("listing meetups for cid {cid} and ceremony nr {cindex}"); + // + // let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + // + // let mut num_assignees = 0u64; + // + // for meetup in stats.meetups.iter() { + // println!("MeetupRegistry[{:?}, {}] location is {:?}, {:?}", &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon); + // + // println!("MeetupRegistry[{:?}, {}] meeting time is {:?}", &community_ceremony, meetup.index, meetup.time); + // + // if !meetup.registrations.is_empty() { + // let num = meetup.registrations.len(); + // num_assignees += num as u64; + // println!("MeetupRegistry[{:?}, {}] participants: {}", &community_ceremony, meetup.index, num); + // for (participant, _registration) in meetup.registrations.iter() { + // println!(" {participant}"); + // } + // } else { + // println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); + // } + // } + // println!("total number of assignees: {num_assignees}"); + // Ok(()) + // } + // ).await.unwrap(); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("print-ceremony-stats") + // .description("pretty prints all information for a community ceremony") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .ceremony_index_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // extract_and_execute( + // matches, |api, cid| -> ApiResult<()>{ + // + // let current_ceremony_index = get_ceremony_index(&api, None).await; + // + // let cindex = matches.ceremony_index_arg() + // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); + // + // let community_ceremony = (cid, cindex); + // + // let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + // + // // serialization prints the the account id better than `debug` + // println!("{}", serde_json::to_string_pretty(&stats).unwrap()); + // Ok(()) + // } + // ).unwrap(); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-attestees") + // .description("list all attestees for participants for supplied community identifier and ceremony index") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .ceremony_index_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // extract_and_execute( + // matches, |api, cid| -> ApiResult<()>{ + // + // let current_ceremony_index = get_ceremony_index(&api, None).await; + // + // let cindex = matches.ceremony_index_arg() + // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); + // + // println!("listing attestees for cid {cid} and ceremony nr {cindex}"); + // + // let wcount = get_attestee_count(&api, (cid, cindex)).await; + // println!("number of attestees: {wcount}"); + // + // println!("listing participants for cid {cid} and ceremony nr {cindex}"); + // + // let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; + // let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None).await; + // + // let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; + // let account_query = |registry_index, p_index| async move { + // api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None).await + // }; + // + // let mut participants_windex = HashMap::new(); + // + // for (i, item) in registries.iter().enumerate() { + // println!("Querying {item}"); + // + // let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); + // println!("number of participants assigned: {count}"); + // + // for p_index in 1..count +1 { + // let accountid: AccountId = account_query(i, p_index)?.unwrap(); + // + // match get_participant_attestation_index(&api, (cid, cindex), &accountid).await { + // Some(windex) => { + // participants_windex.insert(windex as AttestationIndexType, accountid) + // } + // _ => continue, + // }; + // } + // } + // + // let mut attestation_states = Vec::with_capacity(wcount as usize); + // + // for w in 1..wcount + 1 { + // let attestor = participants_windex[&w].clone(); + // let meetup_index = api.get_meetup_index(&(cid, cindex), &attestor).await.unwrap().unwrap(); + // let attestees = api.get_attestees((cid, cindex), w).await.unwrap(); + // let vote = api.get_meetup_participant_count_vote((cid, cindex), attestor.clone()).await.unwrap(); + // let attestation_state = AttestationState::new( + // (cid, cindex), + // meetup_index, + // vote, + // w, + // attestor, + // attestees, + // ); + // + // attestation_states.push(attestation_state); + // } + // + // // Group attestation states by meetup index + // attestation_states.sort_by(|a, b| a.meetup_index.partial_cmp(&b.meetup_index).unwrap()); + // + // for a in attestation_states.iter() { + // println!("{a:?}"); + // } + // + // Ok(()) + // } + // ).await.unwrap(); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-reputables") + // .description("list all reputables for all cycles within the current reputation-lifetime for all communities") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .at_block_arg() + // .verbose_flag() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // + // let is_verbose = matches.verbose_flag(); + // let at_block = matches.at_block_arg(); + // + // let lifetime = get_reputation_lifetime(&api, at_block).await; + // let current_ceremony_index = get_ceremony_index(&api, at_block).await; + // + // + // let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); + // let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); + // + // let community_ids = get_cid_names(&api).await.unwrap().into_iter().map(|names| names.cid); + // + // let mut reputables_csv = Vec::new(); + // + // println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); + // for community_id in community_ids { + // println!("Community ID: {community_id:?}"); + // let mut reputables: HashMap = HashMap::new(); + // for ceremony_index in &ceremony_indices { + // let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block).await; + // println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); + // for attendee in attendees { + // reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); + // *reputables.entry(attendee.clone()).or_insert(0) += 1; + // } + // } + // println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); + // } + // if is_verbose { + // for reputable in reputables_csv { + // println!("{reputable}"); + // } + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("register-participant") + // .description("Register encointer ceremony participant for supplied community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .signer_arg("Account which signs the tx.") + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let arg_who = matches.account_arg().unwrap(); + // let accountid = get_accountid_from_str(arg_who); + // let signer = match matches.signer_arg() { + // Some(sig) => get_pair_from_str(sig), + // None => get_pair_from_str(arg_who) + // }; + // + // let api = get_chain_api(matches).await; + // let cindex = get_ceremony_index(&api, None).await; + // let cid = verify_cid(&api, + // matches + // .cid_arg() + // .expect("please supply argument --cid"), + // None + // ).await; + // let rep = get_reputation(&api, &accountid, cid, cindex -1).await; + // info!("{} has reputation {:?}", accountid, rep); + // let proof = match rep { + // Reputation::Unverified => None, + // Reputation::UnverifiedReputable => None, // this should never be the case during Registering! + // Reputation::VerifiedUnlinked => Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), + // Reputation::VerifiedLinked(_) => Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), + // }; + // debug!("proof: {:x?}", proof.encode()); + // let current_phase = api.get_current_phase().await.unwrap(); + // if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { + // error!("wrong ceremony phase for registering participant"); + // std::process::exit(exit_code::WRONG_PHASE); + // } + // let mut api = api; + // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + // api.set_signer(signer); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerCeremonies", + // "register_participant", + // cid, + // proof + // ).unwrap(); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // // send and watch extrinsic until ready + // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + // info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("upgrade-registration") + // .description("Upgrade registration to repuable for encointer ceremony participant for supplied community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .signer_arg("Account which signs the tx.") + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let arg_who = matches.account_arg().unwrap(); + // let accountid = get_accountid_from_str(arg_who); + // let signer = match matches.signer_arg() { + // Some(sig) => get_pair_from_str(sig), + // None => get_pair_from_str(arg_who) + // }; + // + // let api = get_chain_api(matches).await; + // let cindex = get_ceremony_index(&api, None).await; + // let cid = verify_cid(&api, + // matches + // .cid_arg() + // .expect("please supply argument --cid"), + // None + // ).await; + // + // let current_phase = api.get_current_phase().await.unwrap(); + // if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { + // error!("wrong ceremony phase for registering participant"); + // std::process::exit(exit_code::WRONG_PHASE); + // } + // let mut reputation_cindex = cindex; + // if current_phase == CeremonyPhaseType::Registering { + // reputation_cindex -= 1; + // } + // let rep = get_reputation(&api, &accountid, cid, reputation_cindex).await; + // info!("{} has reputation {:?}", accountid, rep); + // let proof = match rep { + // Reputation::VerifiedUnlinked => prove_attendance(accountid, cid, reputation_cindex, arg_who), + // _ => { + // error!("No valid reputation in last ceremony."); + // std::process::exit(exit_code::INVALID_REPUTATION); + // }, + // }; + // + // let mut api = api; + // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + // api.set_signer(signer); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerCeremonies", + // "upgrade_registration", + // cid, + // proof + // ).unwrap(); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // // send and watch extrinsic until ready + // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + // info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("unregister-participant") + // .description("Unregister encointer ceremony participant for supplied community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .signer_arg("Account which signs the tx.") + // .ceremony_index_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let arg_who = matches.account_arg().unwrap(); + // let signer = match matches.signer_arg() { + // Some(sig) => get_pair_from_str(sig), + // None => get_pair_from_str(arg_who) + // }; + // + // let api = get_chain_api(matches).await; + // + // let cid = verify_cid(&api, + // matches + // .cid_arg() + // .expect("please supply argument --cid"), + // None + // ).await; + // + // + // let cc = match matches.ceremony_index_arg() { + // Some(cindex_arg) => { + // let current_ceremony_index = get_ceremony_index(&api, None).await; + // let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + // Some((cid, cindex)) + // }, + // None => None, + // }; + // + // let current_phase = api.get_current_phase().await.unwrap(); + // if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { + // error!("wrong ceremony phase for unregistering"); + // std::process::exit(exit_code::WRONG_PHASE); + // } + // let mut api = api; + // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + // api.set_signer(signer); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerCeremonies", + // "unregister_participant", + // cid, + // cc + // ).unwrap(); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // // Send and watch extrinsic until ready + // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + // info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("endorse-newcomers") + // .description("Endorse newbies with a bootstrapper account") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .bootstrapper_arg() + // .endorsees_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // + // extract_and_execute( + // matches, |mut api, cid| endorse_newcomers(&mut api, cid, matches) + // ).await.unwrap(); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("get-bootstrappers-with-remaining-newbie-tickets") + // .description("Get the bootstrappers along with the remaining newbie tickets") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let bs_with_tickets : Vec = extract_and_execute( + // matches, |api, cid| get_bootstrappers_with_remaining_newbie_tickets(&api, cid) + // ).await.unwrap(); + // + // info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); + // + // // transform it to simple tuples, which is easier to parse in python + // let bt_vec = bs_with_tickets.into_iter() + // .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)).collect::>(); + // + // println!("{bt_vec:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("get-proof-of-attendance") + // .description("creates a proof of ProofOfAttendances for an for the given ceremony index") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .setting(AppSettings::AllowLeadingHyphen) + // .account_arg() + // .ceremony_index_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let arg_who = matches.account_arg().unwrap(); + // let accountid = get_accountid_from_str(arg_who); + // let api = get_chain_api(matches).await; + // + // let current_ceremony_index = get_ceremony_index(&api, None).await; + // + // let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); + // let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + // + // let cid = verify_cid( + // &api, + // matches.cid_arg().expect("please supply argument --cid"), + // None + // ).await; + // + // debug!("Getting proof for ceremony index: {:?}", cindex); + // let proof = prove_attendance(accountid, cid, cindex, arg_who); + // info!("Proof: {:?}\n", &proof); + // println!("0x{}", hex::encode(proof.encode())); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("attest-attendees") + // .description("Register encointer ceremony claim of attendances for supplied community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .optional_cid_arg() + // .attestees_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let who = matches.account_arg().map(get_pair_from_str).unwrap(); + // + // let attestees: Vec<_> = matches.attestees_arg().unwrap() + // .into_iter() + // .map(get_accountid_from_str) + // .collect(); + // + // let vote = attestees.len() as u32 + 1u32; + // + // debug!("attestees: {:?}", attestees); + // + // info!("send attest_attendees by {}", who.public()); + // + // let mut api = + // get_chain_api(matches).await; + // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); + // api.set_signer(signer); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let cid = verify_cid(&api, + // matches + // .cid_arg() + // .expect("please supply argument --cid"), + // None + // ).await; + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerCeremonies", + // "attest_attendees", + // cid, + // vote, + // attestees + // ).unwrap(); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + // + // println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("new-claim") + // .description("create a fresh claim of attendance for account") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .arg( + // Arg::with_name("vote") + // .takes_value(true) + // .required(true) + // .value_name("VOTE") + // .help("participant's vote on the number of people present at meetup time"), + // ) + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // extract_and_execute( + // matches, |api, cid| -> ApiResult<()>{ + // let arg_who = matches.account_arg().unwrap(); + // let claimant = get_pair_from_str(arg_who); + // + // let n_participants = matches + // .value_of("vote") + // .unwrap() + // .parse::() + // .unwrap(); + // + // let claim = new_claim_for(&api, &claimant.into(), cid, n_participants).await; + // + // println!("{}", hex::encode(claim)); + // Ok(()) + // } + // ).await.unwrap(); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("claim-reward") + // .description("Claim the rewards for all meetup participants of the last ceremony.") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .signer_arg("Account which signs the tx.") + // .meetup_index_arg() + // .all_flag() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // + // extract_and_execute( + // matches, |api, cid| async move { + // let signer = match matches.signer_arg() { + // Some(sig) => get_pair_from_str(sig), + // None => panic!("please specify --signer.") + // }; + // let mut api = api; + // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + // api.set_signer(signer.clone()); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // let meetup_index_arg = matches.meetup_index_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // if matches.all_flag() { + // let mut cindex = get_ceremony_index(&api, None).await; + // if api.get_current_phase().await.unwrap() == CeremonyPhaseType::Registering { + // cindex -= 1; + // } + // let meetup_count = api + // .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None).await + // .unwrap().unwrap_or(0u64); + // let calls: Vec<_> = (1u64..=meetup_count) + // .map(|idx| compose_call!( + // api.metadata(), + // ENCOINTER_CEREMONIES, + // "claim_rewards", + // cid, + // Option::::Some(idx) + // ).unwrap()) + // .collect(); + // let batch_call = compose_call!( + // api.metadata(), + // "Utility", + // "batch", + // calls + // ).unwrap(); + // send_and_wait_for_in_block(&api, xt(&api, batch_call), tx_payment_cid_arg); + // println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); + // } else { + // let meetup_index = meetup_index_arg; + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // ENCOINTER_CEREMONIES, + // "claim_rewards", + // cid, + // meetup_index + // ).unwrap(); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + // match meetup_index_arg { + // Some(idx)=>{println!("Claiming reward for meetup_index {idx}. xt-status: '{:?}'", report.status);} + // None=>{println!("Claiming reward for {}. xt-status: 'ready'", signer.public_account_id());} + // } + // } + // } + // ); + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("reputation") + // .description("List reputation history for an account") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg()}) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // let account = matches.account_arg().unwrap(); + // let account_id = get_accountid_from_str(account); + // if let Some(reputation) = get_reputation_history(&api, &account_id).await { + // for rep in reputation.iter() { + // println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); + // } + // } else { + // error!("could not fetch reputation over rpc"); + // std::process::exit(exit_code::RPC_ERROR); + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("create-business") + // .description("Register a community business on behalf of the account") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .ipfs_cid_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).await.unwrap(); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("update-business") + // .description("Update an already existing community business on behalf of the account") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .ipfs_cid_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).await.unwrap(); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("create-offering") + // .description("Create an offering for the business belonging to account") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .ipfs_cid_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // send_bazaar_xt(matches, &BazaarCalls::CreateOffering).await.unwrap(); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-businesses") + // .description("List businesses for a community") + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // + // let businesses = extract_and_execute( + // matches, |api, cid| get_businesses(&api, cid).await.unwrap() + // ); + // // only print plain businesses to be able to parse them in python scripts + // println!("{businesses:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-offerings") + // .description("List offerings for a community") + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let offerings = extract_and_execute( + // matches, |api, cid| get_offerings(&api, cid).await.unwrap() + // ); + // // only print plain offerings to be able to parse them in python scripts + // println!("{offerings:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-business-offerings") + // .description("List offerings for a business") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let account = matches.account_arg().map(get_accountid_from_str).unwrap(); + // + // let offerings = extract_and_execute( + // matches, |api, cid| get_offerings_for_business(&api, cid, account).await.unwrap() + // ); + // // only print plain offerings to be able to parse them in python scripts + // println!("{offerings:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("purge-community-ceremony") + // .description("purge all history within the provided ceremony index range for the specified community") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .from_cindex_arg() + // .to_cindex_arg() + // + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let sudoer = AccountKeyring::Alice.pair(); + // let signer = ParentchainExtrinsicSigner::new(sudoer); + // let mut api = get_chain_api(matches).await; + // api.set_signer(signer); + // + // let current_ceremony_index = get_ceremony_index(&api, None).await; + // + // let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); + // let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); + // + // let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); + // let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); + // + // if from_cindex > to_cindex { + // panic!("'from' <= 'to' ceremony index violated"); + // } + // let cid = verify_cid(&api, + // matches + // .cid_arg() + // .expect("please supply argument --cid"), + // None + // ).await; + // println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); + // + // let calls: Vec<_> = (from_cindex..=to_cindex) + // .map(|idx| compose_call!( + // api.metadata(), + // "EncointerCeremonies", + // "purge_community_ceremony", + // (cid, idx) + // ).unwrap()) + // .collect(); + // let batch_call = compose_call!( + // api.metadata(), + // "Utility", + // "batch", + // calls + // ).unwrap(); + // let unsigned_sudo_call = compose_call!( + // api.metadata(), + // "Sudo", + // "sudo", + // batch_call.clone() + // ).unwrap(); + // info!("raw sudo batch call to sign with js/apps {}: 0x{}", cid, hex::encode(unsigned_sudo_call.encode())); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "Sudo", + // "sudo", + // batch_call + // ).unwrap(); + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); + // info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("set-meetup-time-offset") + // .description("signed value to offset the ceremony meetup time relative to solar noon") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .setting(AppSettings::AllowLeadingHyphen) + // .time_offset_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let mut api = get_chain_api(matches).await; + // let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); + // api + // .set_signer(signer); + // let time_offset = matches.time_offset_arg().unwrap_or(0); + // let call = compose_call!( + // api.metadata(), + // "EncointerCeremonies", + // "set_meetup_time_offset", + // time_offset + // ).unwrap(); + // + // // return calls as `OpaqueCall`s to get the same return type in both branches + // let privileged_call = if contains_sudo_pallet(api.metadata()) { + // let sudo_call = sudo_call(api.metadata(), call); + // info!("Printing raw sudo call for js/apps:"); + // print_raw_call("sudo(...)", &sudo_call); + // OpaqueCall::from_tuple(&sudo_call) + // } else { + // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + // let propose_call = collective_propose_call(api.metadata(), threshold, call); + // print_raw_call("collective_propose(...)", &propose_call); + // OpaqueCall::from_tuple(&propose_call) + // }; + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // let xt = xt(&api, privileged_call); + // send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("create-faucet") + // .description("Create faucet") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .faucet_name_arg() + // .faucet_balance_arg() + // .faucet_drip_amount_arg() + // .whitelist_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // 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 faucet_name_raw = matches.faucet_name_arg().unwrap(); + // let faucet_balance = matches.faucet_balance_arg().unwrap(); + // let drip_amount = matches.faucet_drip_amount_arg().unwrap(); + // + // let whitelist = matches.whitelist_arg().map(|wl| { + // let whitelist_vec: Vec<_> = wl + // .into_iter() + // .map(|c| async move { verify_cid(&api, + // c, + // None).await}) + // .collect().await; + // WhiteListType::try_from(whitelist_vec).unwrap() + // }); + // + // let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerFaucet", + // "create_faucet", + // faucet_name, + // faucet_balance, + // whitelist, + // drip_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; + // + // match result { + // Ok(report) => { + // for event in report.events.unwrap().iter() { + // if event.pallet_name() == "EncointerFaucet" && event.variant_name() == "FaucetCreated" { + // println!("{}", AccountId::decode(&mut event.field_bytes()[0..32].as_ref()).unwrap().to_ss58check()); + // } + // } + // }, + // Err(e) => { + // println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + // }, + // }; + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("drip-faucet") + // .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .faucet_account_arg() + // .cindex_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // 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 cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + // + // let cindex = matches.cindex_arg().unwrap(); + // let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerFaucet", + // "drip", + // faucet_account, + // cid, + // cindex + // ).unwrap(); + // + // + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // + // let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + // + // match result { + // Ok(_report) => { + // println!("Faucet dripped to {}", who.public()); + // + // }, + // Err(e) => { + // println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + // }, + // }; + // + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("dissolve-faucet") + // .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .signer_arg("account with necessary privileges (sudo or councillor)") + // .faucet_account_arg() + // .faucet_beneficiary_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let signer = matches.signer_arg() + // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + // let signer = ParentchainExtrinsicSigner::new(signer); + // + // let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + // let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); + // + // let mut api = get_chain_api(matches).await; + // api.set_signer(signer); + // + // + // let dissolve_faucet_call = compose_call!( + // api.metadata(), + // "EncointerFaucet", + // "dissolve_faucet", + // faucet_account.clone(), + // beneficiary + // ).unwrap(); + // + // // return calls as `OpaqueCall`s to get the same return type in both branches + // let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { + // let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); + // info!("Printing raw sudo call for js/apps:"); + // print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); + // + // OpaqueCall::from_tuple(&dissolve_faucet_call) + // + // } else { + // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + // let propose_dissolve_faucet = collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); + // print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); + // + // OpaqueCall::from_tuple(&propose_dissolve_faucet) + // }; + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call), tx_payment_cid_arg); + // + // println!("Faucet dissolved: {faucet_account:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("close-faucet") + // .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .faucet_account_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // 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, + // ))); + // + // let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerFaucet", + // "close_faucet", + // faucet_account.clone() + // ).unwrap(); + // + // + // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + // + // println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("set-faucet-reserve-amount") + // .description("Set faucet pallet reserve amount") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .signer_arg("account with necessary privileges (sudo or councillor)") + // .faucet_reserve_amount_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let signer = matches.signer_arg() + // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + // let signer = ParentchainExtrinsicSigner::new(signer); + // + // let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); + // + // let mut api = get_chain_api(matches).await; + // api.set_signer(signer); + // + // + // let set_reserve_amount_call = compose_call!( + // api.metadata(), + // "EncointerFaucet", + // "set_reserve_amount", + // reserve_amount + // ).unwrap(); + // // return calls as `OpaqueCall`s to get the same return type in both branches + // let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { + // let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); + // info!("Printing raw sudo call for js/apps:"); + // print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); + // + // OpaqueCall::from_tuple(&set_reserve_amount_call) + // + // } else { + // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + // let propose_set_reserve_amount = collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); + // print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); + // + // OpaqueCall::from_tuple(&propose_set_reserve_amount) + // }; + // + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // send_and_wait_for_in_block(&api, xt(&api, set_reserve_amount_call), tx_payment_cid_arg); + // + // println!("Reserve amount set: {reserve_amount:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-faucets") + // .description("list all faucets. use -v to get faucet details.") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .at_block_arg() + // .verbose_flag() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // let api = get_chain_api(matches).await; + // + // let is_verbose = matches.verbose_flag(); + // let at_block = matches.at_block_arg(); + // + // let key_prefix = api + // .get_storage_map_key_prefix( + // "EncointerFaucet", + // "Faucets", + // ) + // .await.unwrap(); + // + // let max_keys = 1000; + // let storage_keys = + // api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).await.unwrap(); + // + // if storage_keys.len() == max_keys as usize { + // error!("results can be wrong because max keys reached for query") + // } + // + // for storage_key in storage_keys.iter() { + // let key_postfix = storage_key.as_ref(); + // let faucet_address = AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); + // let faucet: Faucet = api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + // + // if is_verbose { + // println!("address: {}", faucet_address.to_ss58check()); + // println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); + // println!("creator: {}", AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check()); + // println!("balance: {}", api.get_account_data(&faucet_address).await.unwrap().unwrap().free); + // println!("drip amount: {}", faucet.drip_amount); + // if let Some(whitelist) = faucet.whitelist { + // println!("whitelist:"); + // for cid in whitelist.to_vec() { + // println!("{}", cid); + // } + // } else { + // println!("whitelist: None"); + // } + // println!(""); + // } else { + // println!{"{}", faucet_address}; + // } + // + // } + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("submit-set-inactivity-timeout-proposal") + // .description("Submit set inactivity timeout proposal") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .inactivity_timeout_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| { + // 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 inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); + // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + // + // let xt: EncointerXt<_> = compose_extrinsic!( + // api, + // "EncointerDemocracy", + // "submit_proposal", + // ProposalAction::SetInactivityTimeout(inactivity_timeout) + // ).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: Set inactivity timeout to {inactivity_timeout:?}"); + // Ok(()) + // }), + // ) + // .add_cmd( + // Command::new("list-proposals") + // .description("list all proposals.") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .at_block_arg() + // }) + // .runner(move |_args: &str, matches: &ArgMatches<'_>| async { + // let api = get_chain_api(matches).await; + // let at_block = matches.at_block_arg(); + // let key_prefix = api + // .get_storage_map_key_prefix( + // "EncointerDemocracy", + // "Proposals", + // ).await + // .unwrap(); + // let max_keys = 1000; + // let storage_keys = + // api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).await.unwrap(); + // if storage_keys.len() == max_keys as usize { + // error!("results can be wrong because max keys reached for query") + // } + // 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 = api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + // println!("id: {}", proposal_id); + // println!("action: {:?}", proposal.action); + // println!("start block: {}", proposal.start); + // println!("start cindex: {}", proposal.start_cindex); + // println!("state: {:?}", proposal.state); + // println!(""); + // } + // Ok(()) + // }.await), + // ) + // .add_cmd( + // Command::new("vote") + // .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") + // .options(|app| { + // app.setting(AppSettings::ColoredHelp) + // .account_arg() + // .proposal_id_arg() + // .vote_arg() + // .reputation_vec_arg() + // }) + // .runner(move |args: &str, matches: &ArgMatches<'_>| cmd_vote(args, matches).await), + // ) + .add_cmd( + Command::new("update-proposal-state") + .description("Update proposal state") + .options(|app| { + app.setting(AppSettings::ColoredHelp).account_arg().proposal_id_arg() + }) + .runner(cmd_update_proposal_state), + ) + // To handle when no subcommands match + .no_cmd(|_args, _matches| { + println!("No subcommand matched"); + Ok(()) + }) + .run(); } -async fn update_proposal_state(_args: &str, matches: &ArgMatches<'_>) -> ApiResult<()> { - 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 proposal_id = matches.proposal_id_arg().unwrap(); - 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", "update_proposal_state", proposal_id) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); - let _result = api.submit_and_watch_extrinsic_until_success(xt, false).await; - println!("Proposal state updated for proposal {proposal_id:?}"); - Ok(()) +// async fn cmd_vote(_args: &str, matches: &ArgMatches<'_>) -> ApiResult<()> { +// 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 proposal_id = matches.proposal_id_arg().unwrap(); +// let vote_raw = matches.vote_arg().unwrap(); +// let vote = match vote_raw { +// "aye" => Vote::Aye, +// "nay" => Vote::Nay, +// &_ => panic!("invalid vote"), +// }; +// let reputation_vec: ReputationVec> = matches +// .reputation_vec_arg() +// .map(|rv| { +// let reputations: Vec<(CommunityIdentifier, CeremonyIndexType)> = rv +// .into_iter() +// .map(|rep| { +// let cc: Vec<_> = rep.split("_").collect(); +// (verify_cid(&api, cc[0], None), cc[1].parse().unwrap()) +// }) +// .collect(); +// ReputationVec::try_from(reputations).unwrap() +// }) +// .await +// .unwrap(); +// let tx_payment_cid_arg = matches.tx_payment_cid_arg(); +// set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); +// let xt: EncointerXt<_> = +// compose_extrinsic!(api, "EncointerDemocracy", "vote", proposal_id, vote, reputation_vec) +// .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!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); +// Ok(()) +// } +fn cmd_update_proposal_state(_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 proposal_id = matches.proposal_id_arg().unwrap(); + 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", "update_proposal_state", proposal_id) + .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 state updated for proposal {proposal_id:?}"); + Ok(()) + }) + .into() } async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { let url = format!( @@ -2091,9 +2089,9 @@ async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { async fn reasonable_native_balance(api: &Api) -> u128 { let alice: AccountId = AccountKeyring::Alice.into(); - let xt = api.balance_transfer_allow_death(alice.into(), 9999); + let xt = api.balance_transfer_allow_death(alice.into(), 9999).await.unwrap(); let fee = api - .get_fee_details(xt.encode().into(), None) + .get_fee_details(&xt.encode().into(), None) .await .unwrap() .unwrap() @@ -2226,7 +2224,7 @@ async fn extract_and_execute( } async fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { - let cids = get_community_identifiers(api, maybe_at).expect("no community registered").await; + let cids = get_community_identifiers(api, maybe_at).await.expect("no community registered"); let cid = CommunityIdentifier::from_str(cid).unwrap(); if !cids.contains(&cid) { panic!("cid {cid} does not exist on chain"); @@ -2268,8 +2266,8 @@ pub async fn get_community_issuance( maybe_at: Option, ) -> BalanceType { let cid = verify_cid(api, cid_str, maybe_at).await; - let bn = get_block_number(api, maybe_at); - let dr = get_demurrage_per_block(api, cid); + let bn = get_block_number(api, maybe_at).await; + let dr = get_demurrage_per_block(api, cid).await; if let Some(entry) = api .get_storage_map("EncointerBalances", "TotalIssuance", cid, maybe_at) @@ -2341,7 +2339,7 @@ async fn get_attendees_for_community_ceremony( let mut noshows = Vec::new(); for storage_key in storage_keys.iter() { match api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap() { - Reputation::VerifiedUnlinked | Reputation::VerifiedLinked => { + Reputation::VerifiedUnlinked | Reputation::VerifiedLinked(_) => { let key_postfix = storage_key.as_ref(); attendees.push( AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), @@ -2381,9 +2379,10 @@ async fn new_claim_for( cid: CommunityIdentifier, n_participants: u32, ) -> Vec { - let cindex = get_ceremony_index(api, None); + let cindex = get_ceremony_index(api, None).await; let mindex = api .get_meetup_index(&(cid, cindex), &claimant.public().into()) + .await .unwrap() .expect("participant must be assigned to meetup to generate a claim"); @@ -2562,7 +2561,7 @@ async fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> let xt: EncointerXt<_> = compose_extrinsic!(api, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid) .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; // send and watch extrinsic until ready let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); println!( @@ -2584,7 +2583,7 @@ async fn endorse_newcomers( api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(bootstrapper))); - let mut nonce = api.get_nonce()?; + let mut nonce = api.get_nonce().await?; let tx_payment_cid_arg = matches.tx_payment_cid_arg(); set_api_extrisic_params_builder(api, tx_payment_cid_arg); @@ -2593,12 +2592,13 @@ async fn endorse_newcomers( let endorsee = get_accountid_from_str(e); let call = - compose_call!(api.metadata(), "EncointerCeremonies", "endorse_newcomer", cid, endorsee); + compose_call!(api.metadata(), "EncointerCeremonies", "endorse_newcomer", cid, endorsee) + .unwrap(); let encoded_xt: Bytes = api.compose_extrinsic_offline(call, nonce).encode().into(); - ensure_payment(api, &encoded_xt, tx_payment_cid_arg); + ensure_payment(api, &encoded_xt, tx_payment_cid_arg).await; let _tx_report = api - .submit_and_watch_opaque_extrinsic_until(encoded_xt, XtStatus::Ready) + .submit_and_watch_opaque_extrinsic_until(&encoded_xt, XtStatus::Ready) .await .unwrap(); @@ -2639,7 +2639,7 @@ async fn get_bootstrappers_with_remaining_newbie_tickets( .await? .unwrap_or(0u8); - Ok(remaining_tickets) + Ok::<_, ApiClientError>(remaining_tickets) }; let bootstrappers: Vec = api diff --git a/client/src/utils.rs b/client/src/utils.rs index 2f83421e..6d914d95 100644 --- a/client/src/utils.rs +++ b/client/src/utils.rs @@ -17,19 +17,19 @@ use substrate_api_client::{ /// Creates a signed extrinsic from a call /// /// Panics if no signer is set. -pub fn xt(api: &Api, call: C) -> EncointerXt { - let nonce = api.get_nonce().unwrap(); +pub async fn xt(api: &Api, call: C) -> EncointerXt { + let nonce = api.get_nonce().await.unwrap(); api.compose_extrinsic_offline(call, nonce) } /// Wraps the supplied call in a sudo call pub fn sudo_call(metadata: &Metadata, call: C) -> ([u8; 2], C) { - compose_call!(metadata, "Sudo", "sudo", call) + compose_call!(metadata, "Sudo", "sudo", call).unwrap() } /// Wraps the supplied calls in a batch call pub fn batch_call(metadata: &Metadata, calls: Vec) -> ([u8; 2], Vec) { - compose_call!(metadata, "Utility", "batch", calls) + compose_call!(metadata, "Utility", "batch", calls).unwrap() } /// ([pallet_index, call_index], threshold, Proposal,length_bound) @@ -53,19 +53,21 @@ pub fn collective_propose_call( proposal, Compact(length_bound) ) + .unwrap() } -pub fn get_councillors(api: &Api) -> Result> { - api.get_storage("Membership", "Members", None)? +pub async fn get_councillors(api: &Api) -> Result> { + api.get_storage("Membership", "Members", None) + .await? .ok_or_else(|| ApiClientError::Other("Couldn't get councillors".into())) } -pub fn send_and_wait_for_in_block( +pub async fn send_and_wait_for_in_block( api: &Api, xt: EncointerXt, tx_payment_cid: Option<&str>, ) -> Option { - ensure_payment(api, &xt.encode().into(), tx_payment_cid); - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).unwrap(); + ensure_payment(api, &xt.encode().into(), tx_payment_cid).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); info!("[+] Transaction got included in Block: {:?}\n", report.block_hash.unwrap()); Some(report.extrinsic_hash) } @@ -80,7 +82,7 @@ pub fn print_raw_call(name: &str, call: &Call) { /// This will implicitly distinguish between solo-chain (sudo exists) and parachain /// (sudo doesn't exist). pub fn contains_sudo_pallet(metadata: &Metadata) -> bool { - if metadata.pallet("Sudo").is_ok() { + if metadata.pallet_by_name("Sudo").is_some() { info!("'Sudo' pallet found on chain. Will send privileged xt's as sudo"); true } else { @@ -90,19 +92,20 @@ pub fn contains_sudo_pallet(metadata: &Metadata) -> bool { } /// Checks if the account has sufficient funds. Exits the process if not. -pub fn ensure_payment(api: &Api, encoded_xt: &Bytes, tx_payment_cid: Option<&str>) { +pub async fn ensure_payment(api: &Api, encoded_xt: &Bytes, tx_payment_cid: Option<&str>) { if let Some(cid_str) = tx_payment_cid { - ensure_payment_cc(api, cid_str, encoded_xt); + ensure_payment_cc(api, cid_str, encoded_xt).await; } else { - ensure_payment_native(api, encoded_xt); + ensure_payment_native(api, encoded_xt).await; } } -fn ensure_payment_cc(api: &Api, cid_str: &str, encoded_xt: &Bytes) { +async fn ensure_payment_cc(api: &Api, cid_str: &str, encoded_xt: &Bytes) { let balance: BalanceType = - get_community_balance(api, cid_str, api.signer_account().unwrap(), None); + get_community_balance(api, cid_str, api.signer_account().unwrap(), None).await; let fee: BalanceType = get_asset_fee_details(api, cid_str, encoded_xt) + .await .unwrap() .inclusion_fee .map(|details| details.base_fee.into_u256().as_u128()) @@ -116,8 +119,8 @@ fn ensure_payment_cc(api: &Api, cid_str: &str, encoded_xt: &Bytes) { debug!("account can pay fees in CC: fee: {} bal: {}", fee, balance); } -fn ensure_payment_native(api: &Api, encoded_xt: &Bytes) { - let signer_balance = match api.get_account_data(api.signer_account().unwrap()).unwrap() { +async fn ensure_payment_native(api: &Api, encoded_xt: &Bytes) { + let signer_balance = match api.get_account_data(api.signer_account().unwrap()).await.unwrap() { Some(bal) => bal.free, None => { error!("account does not exist on chain"); @@ -125,12 +128,13 @@ fn ensure_payment_native(api: &Api, encoded_xt: &Bytes) { }, }; let fee = api - .get_fee_details(encoded_xt.clone(), None) + .get_fee_details(encoded_xt, None) + .await .unwrap() .unwrap() .inclusion_fee .map_or_else(|| 0, |details| details.base_fee); - let ed = api.get_existential_deposit().unwrap(); + let ed = api.get_existential_deposit().await.unwrap(); if signer_balance < fee + ed { error!("insufficient funds: fee: {} ed: {} bal: {:?}", fee, ed, signer_balance); std::process::exit(exit_code::FEE_PAYMENT_FAILED); @@ -200,9 +204,10 @@ pub mod keys { pub fn get_accountid_from_str(account: &str) -> AccountId { debug!("getting AccountId from -{}-", account); match &account[..2] { - "//" => + "//" => { AccountPublic::from(sr25519::Pair::from_string(account, None).unwrap().public()) - .into_account(), + .into_account() + }, _ => AccountPublic::from(sr25519::Public::from_ss58check(account).unwrap()) .into_account(), } @@ -217,7 +222,7 @@ pub mod keys { _ => { if sr25519::Public::from_ss58check(account).is_err() { // could be mnemonic phrase - return sr25519::AppPair::from_string_with_seed(account, None).unwrap().0 + return sr25519::AppPair::from_string_with_seed(account, None).unwrap().0; } debug!("fetching from keystore at {}", &KEYSTORE_PATH); // open store without password protection From 5e4bda12c9d98694057f3713f99df2b6c6f3b547 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 08:51:44 +0100 Subject: [PATCH 18/41] fixed cmd_vote --- Cargo.lock | 1 + client/Cargo.toml | 1 + client/src/main.rs | 113 ++++++++++++++++++++++++++------------------- 3 files changed, 68 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abb019f3..b779f260 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2111,6 +2111,7 @@ dependencies = [ "env_logger 0.9.3", "frame-support", "frame-system", + "futures", "geojson", "hex", "log", diff --git a/client/Cargo.toml b/client/Cargo.toml index 053c6efc..f5dc084c 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -16,6 +16,7 @@ log = { workspace = true } parity-scale-codec = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true } +futures = { workspace = true } # local deps encointer-api-client-extension = { path = "./encointer-api-client-extension" } diff --git a/client/src/main.rs b/client/src/main.rs index 2dc0a2b9..6c35fd87 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -61,6 +61,7 @@ use encointer_primitives::{ fixed::transcendental::exp, scheduler::{CeremonyIndexType, CeremonyPhaseType}, }; +use futures::stream::{self, StreamExt, TryStreamExt}; use log::*; use pallet_transaction_payment::FeeDetails; use parity_scale_codec::{Compact, Decode, Encode}; @@ -1994,18 +1995,18 @@ async fn main() { // Ok(()) // }.await), // ) - // .add_cmd( - // Command::new("vote") - // .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .proposal_id_arg() - // .vote_arg() - // .reputation_vec_arg() - // }) - // .runner(move |args: &str, matches: &ArgMatches<'_>| cmd_vote(args, matches).await), - // ) + .add_cmd( + Command::new("vote") + .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .proposal_id_arg() + .vote_arg() + .reputation_vec_arg() + }) + .runner(cmd_vote), + ) .add_cmd( Command::new("update-proposal-state") .description("Update proposal state") @@ -2022,41 +2023,59 @@ async fn main() { .run(); } -// async fn cmd_vote(_args: &str, matches: &ArgMatches<'_>) -> ApiResult<()> { -// 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 proposal_id = matches.proposal_id_arg().unwrap(); -// let vote_raw = matches.vote_arg().unwrap(); -// let vote = match vote_raw { -// "aye" => Vote::Aye, -// "nay" => Vote::Nay, -// &_ => panic!("invalid vote"), -// }; -// let reputation_vec: ReputationVec> = matches -// .reputation_vec_arg() -// .map(|rv| { -// let reputations: Vec<(CommunityIdentifier, CeremonyIndexType)> = rv -// .into_iter() -// .map(|rep| { -// let cc: Vec<_> = rep.split("_").collect(); -// (verify_cid(&api, cc[0], None), cc[1].parse().unwrap()) -// }) -// .collect(); -// ReputationVec::try_from(reputations).unwrap() -// }) -// .await -// .unwrap(); -// let tx_payment_cid_arg = matches.tx_payment_cid_arg(); -// set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); -// let xt: EncointerXt<_> = -// compose_extrinsic!(api, "EncointerDemocracy", "vote", proposal_id, vote, reputation_vec) -// .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!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); -// Ok(()) -// } +fn cmd_vote(_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 proposal_id = matches.proposal_id_arg().unwrap(); + let vote_raw = matches.vote_arg().unwrap(); + let vote = match vote_raw { + "aye" => Vote::Aye, + "nay" => Vote::Nay, + &_ => panic!("invalid vote"), + }; + let reputation_vec: Vec = futures::future::join_all( + matches + .reputation_vec_arg() + .ok_or(clap::Error::with_description( + "missing reputation-vec argument", + clap::ErrorKind::MissingRequiredArgument, + ))? + .into_iter() + .map(|rep| { + let api_local = api.clone(); + async move { + let cc: Vec<_> = rep.split("_").collect(); + ( + verify_cid(&api_local, cc[0], None).await, + cc[1].parse::().unwrap(), + ) + } + }), + ) + .await; + let reputation_bvec = ReputationVec::>::try_from(reputation_vec); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerDemocracy", + "vote", + proposal_id, + vote, + reputation_bvec + ) + .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!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); + Ok(()) + }) + .into() +} fn cmd_update_proposal_state(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { From 48d5270a912324c52cda94f6170faeaca97be619 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 09:56:59 +0100 Subject: [PATCH 19/41] added more fn --- client/src/main.rs | 835 ++++++++++++++++++++++++--------------------- 1 file changed, 439 insertions(+), 396 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index 6c35fd87..dd937950 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -512,7 +512,7 @@ async fn main() { // (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) // // } else { - // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; // info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); // let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); // let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); @@ -527,7 +527,7 @@ async fn main() { // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); // - // send_and_wait_for_in_block(&api, xt(&api, new_community_call), matches.tx_payment_cid_arg()); + // send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()); // println!("{cid}"); // // if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { @@ -535,7 +535,7 @@ async fn main() { // error!("Aborting without registering additional locations"); // std::process::exit(exit_code::WRONG_PHASE); // } - // send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call), tx_payment_cid_arg); + // send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg); // Ok(()) // }), // ) @@ -591,7 +591,7 @@ async fn main() { // print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); // OpaqueCall::from_tuple(&sudo_add_location_batch) // } else { - // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; // info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); // let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); // print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); @@ -608,7 +608,7 @@ async fn main() { // error!("Aborting without registering additional locations"); // std::process::exit(exit_code::WRONG_PHASE); // } - // send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call), tx_payment_cid_arg); + // send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call).await, tx_payment_cid_arg); // } // Ok(()) // }), @@ -703,7 +703,7 @@ async fn main() { // OpaqueCall::from_tuple(&sudo_next_phase_call) // // } else { - // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); // let propose_next_phase = collective_propose_call(api.metadata(), threshold, next_phase_call).await; // print_raw_call("collective_propose(next_phase)", &propose_next_phase); @@ -714,7 +714,7 @@ async fn main() { // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); // - // send_and_wait_for_in_block(&api, xt(&api, next_phase_call), tx_payment_cid_arg); + // send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg); // // let phase = api.get_current_phase().await.unwrap(); // println!("Phase is now: {phase:?}"); @@ -1370,7 +1370,7 @@ async fn main() { // "batch", // calls // ).unwrap(); - // send_and_wait_for_in_block(&api, xt(&api, batch_call), tx_payment_cid_arg); + // send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg); // println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); // } else { // let meetup_index = meetup_index_arg; @@ -1595,7 +1595,7 @@ async fn main() { // print_raw_call("sudo(...)", &sudo_call); // OpaqueCall::from_tuple(&sudo_call) // } else { - // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; + // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); // let propose_call = collective_propose_call(api.metadata(), threshold, call); // print_raw_call("collective_propose(...)", &propose_call); @@ -1604,397 +1604,95 @@ async fn main() { // // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // let xt = xt(&api, privileged_call); + // let xt = xt(&api, privileged_call).await; // send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg); // Ok(()) // }), // ) - // .add_cmd( - // Command::new("create-faucet") - // .description("Create faucet") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .faucet_name_arg() - // .faucet_balance_arg() - // .faucet_drip_amount_arg() - // .whitelist_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // 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 faucet_name_raw = matches.faucet_name_arg().unwrap(); - // let faucet_balance = matches.faucet_balance_arg().unwrap(); - // let drip_amount = matches.faucet_drip_amount_arg().unwrap(); - // - // let whitelist = matches.whitelist_arg().map(|wl| { - // let whitelist_vec: Vec<_> = wl - // .into_iter() - // .map(|c| async move { verify_cid(&api, - // c, - // None).await}) - // .collect().await; - // WhiteListType::try_from(whitelist_vec).unwrap() - // }); - // - // let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerFaucet", - // "create_faucet", - // faucet_name, - // faucet_balance, - // whitelist, - // drip_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; - // - // match result { - // Ok(report) => { - // for event in report.events.unwrap().iter() { - // if event.pallet_name() == "EncointerFaucet" && event.variant_name() == "FaucetCreated" { - // println!("{}", AccountId::decode(&mut event.field_bytes()[0..32].as_ref()).unwrap().to_ss58check()); - // } - // } - // }, - // Err(e) => { - // println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - // }, - // }; - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("drip-faucet") - // .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .faucet_account_arg() - // .cindex_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // 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 cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - // - // let cindex = matches.cindex_arg().unwrap(); - // let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerFaucet", - // "drip", - // faucet_account, - // cid, - // cindex - // ).unwrap(); - // - // - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // - // let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; - // - // match result { - // Ok(_report) => { - // println!("Faucet dripped to {}", who.public()); - // - // }, - // Err(e) => { - // println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - // }, - // }; - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("dissolve-faucet") - // .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .signer_arg("account with necessary privileges (sudo or councillor)") - // .faucet_account_arg() - // .faucet_beneficiary_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let signer = matches.signer_arg() - // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - // let signer = ParentchainExtrinsicSigner::new(signer); - // - // let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - // let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); - // - // let mut api = get_chain_api(matches).await; - // api.set_signer(signer); - // - // - // let dissolve_faucet_call = compose_call!( - // api.metadata(), - // "EncointerFaucet", - // "dissolve_faucet", - // faucet_account.clone(), - // beneficiary - // ).unwrap(); - // - // // return calls as `OpaqueCall`s to get the same return type in both branches - // let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { - // let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); - // info!("Printing raw sudo call for js/apps:"); - // print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); - // - // OpaqueCall::from_tuple(&dissolve_faucet_call) - // - // } else { - // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - // let propose_dissolve_faucet = collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); - // print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); - // - // OpaqueCall::from_tuple(&propose_dissolve_faucet) - // }; - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call), tx_payment_cid_arg); - // - // println!("Faucet dissolved: {faucet_account:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("close-faucet") - // .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .faucet_account_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // 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, - // ))); - // - // let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerFaucet", - // "close_faucet", - // faucet_account.clone() - // ).unwrap(); - // - // - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - // - // println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("set-faucet-reserve-amount") - // .description("Set faucet pallet reserve amount") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .signer_arg("account with necessary privileges (sudo or councillor)") - // .faucet_reserve_amount_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let signer = matches.signer_arg() - // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - // let signer = ParentchainExtrinsicSigner::new(signer); - // - // let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); - // - // let mut api = get_chain_api(matches).await; - // api.set_signer(signer); - // - // - // let set_reserve_amount_call = compose_call!( - // api.metadata(), - // "EncointerFaucet", - // "set_reserve_amount", - // reserve_amount - // ).unwrap(); - // // return calls as `OpaqueCall`s to get the same return type in both branches - // let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { - // let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); - // info!("Printing raw sudo call for js/apps:"); - // print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); - // - // OpaqueCall::from_tuple(&set_reserve_amount_call) - // - // } else { - // let threshold = (get_councillors(&api).unwrap().len() / 2 + 1) as u32; - // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - // let propose_set_reserve_amount = collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); - // print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); - // - // OpaqueCall::from_tuple(&propose_set_reserve_amount) - // }; - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // send_and_wait_for_in_block(&api, xt(&api, set_reserve_amount_call), tx_payment_cid_arg); - // - // println!("Reserve amount set: {reserve_amount:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-faucets") - // .description("list all faucets. use -v to get faucet details.") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .at_block_arg() - // .verbose_flag() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // - // let is_verbose = matches.verbose_flag(); - // let at_block = matches.at_block_arg(); - // - // let key_prefix = api - // .get_storage_map_key_prefix( - // "EncointerFaucet", - // "Faucets", - // ) - // .await.unwrap(); - // - // let max_keys = 1000; - // let storage_keys = - // api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).await.unwrap(); - // - // if storage_keys.len() == max_keys as usize { - // error!("results can be wrong because max keys reached for query") - // } - // - // for storage_key in storage_keys.iter() { - // let key_postfix = storage_key.as_ref(); - // let faucet_address = AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); - // let faucet: Faucet = api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); - // - // if is_verbose { - // println!("address: {}", faucet_address.to_ss58check()); - // println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); - // println!("creator: {}", AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check()); - // println!("balance: {}", api.get_account_data(&faucet_address).await.unwrap().unwrap().free); - // println!("drip amount: {}", faucet.drip_amount); - // if let Some(whitelist) = faucet.whitelist { - // println!("whitelist:"); - // for cid in whitelist.to_vec() { - // println!("{}", cid); - // } - // } else { - // println!("whitelist: None"); - // } - // println!(""); - // } else { - // println!{"{}", faucet_address}; - // } - // - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("submit-set-inactivity-timeout-proposal") - // .description("Submit set inactivity timeout proposal") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .inactivity_timeout_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // 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 inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerDemocracy", - // "submit_proposal", - // ProposalAction::SetInactivityTimeout(inactivity_timeout) - // ).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: Set inactivity timeout to {inactivity_timeout:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-proposals") - // .description("list all proposals.") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .at_block_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| async { - // let api = get_chain_api(matches).await; - // let at_block = matches.at_block_arg(); - // let key_prefix = api - // .get_storage_map_key_prefix( - // "EncointerDemocracy", - // "Proposals", - // ).await - // .unwrap(); - // let max_keys = 1000; - // let storage_keys = - // api.get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block).await.unwrap(); - // if storage_keys.len() == max_keys as usize { - // error!("results can be wrong because max keys reached for query") - // } - // 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 = api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); - // println!("id: {}", proposal_id); - // println!("action: {:?}", proposal.action); - // println!("start block: {}", proposal.start); - // println!("start cindex: {}", proposal.start_cindex); - // println!("state: {:?}", proposal.state); - // println!(""); - // } - // Ok(()) - // }.await), - // ) + .add_cmd( + Command::new("create-faucet") + .description("Create faucet") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_name_arg() + .faucet_balance_arg() + .faucet_drip_amount_arg() + .whitelist_arg() + }) + .runner(cmd_create_faucet), + ) + .add_cmd( + Command::new("drip-faucet") + .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_account_arg() + .cindex_arg() + }) + .runner(cmd_drip_faucet), + ) + .add_cmd( + Command::new("dissolve-faucet") + .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + .faucet_account_arg() + .faucet_beneficiary_arg() + }) + .runner(cmd_dissolve_faucet), + ) + .add_cmd( + Command::new("close-faucet") + .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_account_arg() + }) + .runner(cmd_close_faucet), + ) + .add_cmd( + Command::new("set-faucet-reserve-amount") + .description("Set faucet pallet reserve amount") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + .faucet_reserve_amount_arg() + }) + .runner(cmd_set_faucet_reserve_amount), + ) + .add_cmd( + Command::new("list-faucets") + .description("list all faucets. use -v to get faucet details.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + .verbose_flag() + }) + .runner(cmd_list_faucets) + ) + .add_cmd( + Command::new("submit-set-inactivity-timeout-proposal") + .description("Submit set inactivity timeout proposal") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .inactivity_timeout_arg() + }) + .runner(cmd_submit_set_inactivity_timeout_proposal), + ) + .add_cmd( + Command::new("list-proposals") + .description("list all proposals.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + }) + .runner(cmd_list_proposals), + ) .add_cmd( Command::new("vote") .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") @@ -2023,6 +1721,351 @@ async fn main() { .run(); } +fn cmd_create_faucet(_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 faucet_name_raw = matches.faucet_name_arg().unwrap(); + let faucet_balance = matches.faucet_balance_arg().unwrap(); + let drip_amount = matches.faucet_drip_amount_arg().unwrap(); + + let api2 = api.clone(); + let whitelist = futures::future::join_all(matches.whitelist_arg().map(|wl| async move { + let whitelist_vec: Vec<_> = futures::future::join_all(wl.into_iter().map(|c| { + let api_local = api2.clone(); + async move { verify_cid(&api_local, c, None).await } + })) + .await; + WhiteListType::try_from(whitelist_vec).unwrap() + })) + .await; + + let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerFaucet", + "create_faucet", + faucet_name, + faucet_balance, + whitelist, + drip_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; + + match result { + Ok(report) => { + for event in report.events.unwrap().iter() { + if event.pallet_name() == "EncointerFaucet" + && event.variant_name() == "FaucetCreated" + { + println!( + "{}", + AccountId::decode(&mut event.field_bytes()[0..32].as_ref()) + .unwrap() + .to_ss58check() + ); + } + } + }, + Err(e) => { + println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + }, + }; + + Ok(()) + }) + .into() +} +fn cmd_drip_faucet(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let cindex = matches.cindex_arg().unwrap(); + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerFaucet", "drip", faucet_account, cid, cindex) + .unwrap(); + + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + + let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + + match result { + Ok(_report) => { + println!("Faucet dripped to {}", who.public()); + }, + Err(e) => { + println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + }, + }; + + Ok(()) + }) + .into() +} +fn cmd_dissolve_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + let signer = ParentchainExtrinsicSigner::new(signer); + + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let dissolve_faucet_call = compose_call!( + api.metadata(), + "EncointerFaucet", + "dissolve_faucet", + faucet_account.clone(), + beneficiary + ) + .unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { + let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); + + OpaqueCall::from_tuple(&dissolve_faucet_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_dissolve_faucet = + collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); + print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); + + OpaqueCall::from_tuple(&propose_dissolve_faucet) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call).await, tx_payment_cid_arg); + + println!("Faucet dissolved: {faucet_account:?}"); + Ok(()) + }) + .into() +} +fn cmd_close_faucet(_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))); + + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerFaucet", "close_faucet", faucet_account.clone()) + .unwrap(); + + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + + println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); + Ok(()) + }) + .into() +} +fn cmd_set_faucet_reserve_amount(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + let signer = ParentchainExtrinsicSigner::new(signer); + + let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let set_reserve_amount_call = + compose_call!(api.metadata(), "EncointerFaucet", "set_reserve_amount", reserve_amount) + .unwrap(); + // return calls as `OpaqueCall`s to get the same return type in both branches + let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { + let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); + + OpaqueCall::from_tuple(&set_reserve_amount_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_set_reserve_amount = + collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); + print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); + + OpaqueCall::from_tuple(&propose_set_reserve_amount) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + send_and_wait_for_in_block( + &api, + xt(&api, set_reserve_amount_call).await, + tx_payment_cid_arg, + ); + + println!("Reserve amount set: {reserve_amount:?}"); + Ok(()) + }) + .into() +} +fn cmd_list_faucets(_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 is_verbose = matches.verbose_flag(); + let at_block = matches.at_block_arg(); + + let key_prefix = + api.get_storage_map_key_prefix("EncointerFaucet", "Faucets").await.unwrap(); + + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + + for storage_key in storage_keys.iter() { + let key_postfix = storage_key.as_ref(); + let faucet_address = + AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); + let faucet: Faucet = + api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + + if is_verbose { + println!("address: {}", faucet_address.to_ss58check()); + println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); + println!( + "creator: {}", + AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check() + ); + println!( + "balance: {}", + api.get_account_data(&faucet_address).await.unwrap().unwrap().free + ); + println!("drip amount: {}", faucet.drip_amount); + if let Some(whitelist) = faucet.whitelist { + println!("whitelist:"); + for cid in whitelist.to_vec() { + println!("{}", cid); + } + } else { + println!("whitelist: None"); + } + println!(""); + } else { + println! {"{}", faucet_address}; + } + } + Ok(()) + }) + .into() +} +fn cmd_submit_set_inactivity_timeout_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 inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerDemocracy", + "submit_proposal", + ProposalAction::SetInactivityTimeout(inactivity_timeout) + ) + .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: Set inactivity timeout to {inactivity_timeout:?}"); + Ok(()) + }) + .into() +} +fn cmd_list_proposals(_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 at_block = matches.at_block_arg(); + let key_prefix = + api.get_storage_map_key_prefix("EncointerDemocracy", "Proposals").await.unwrap(); + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + 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 = + api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + println!("id: {}", proposal_id); + println!("action: {:?}", proposal.action); + println!("start block: {}", proposal.start); + println!("start cindex: {}", proposal.start_cindex); + println!("state: {:?}", proposal.state); + println!(""); + } + Ok(()) + }) + .into() +} fn cmd_vote(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { From 3272916d622732b9a03cc6d2f0418cc2ed751d62 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 10:33:15 +0100 Subject: [PATCH 20/41] moar fn --- client/src/main.rs | 467 ++++++++++++++++++++++++--------------------- 1 file changed, 252 insertions(+), 215 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index dd937950..60480d61 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -1394,221 +1394,84 @@ async fn main() { // Ok(()) // }), // ) - // .add_cmd( - // Command::new("reputation") - // .description("List reputation history for an account") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg()}) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // let account = matches.account_arg().unwrap(); - // let account_id = get_accountid_from_str(account); - // if let Some(reputation) = get_reputation_history(&api, &account_id).await { - // for rep in reputation.iter() { - // println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); - // } - // } else { - // error!("could not fetch reputation over rpc"); - // std::process::exit(exit_code::RPC_ERROR); - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("create-business") - // .description("Register a community business on behalf of the account") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .ipfs_cid_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).await.unwrap(); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("update-business") - // .description("Update an already existing community business on behalf of the account") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .ipfs_cid_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).await.unwrap(); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("create-offering") - // .description("Create an offering for the business belonging to account") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .ipfs_cid_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // send_bazaar_xt(matches, &BazaarCalls::CreateOffering).await.unwrap(); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-businesses") - // .description("List businesses for a community") - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // - // let businesses = extract_and_execute( - // matches, |api, cid| get_businesses(&api, cid).await.unwrap() - // ); - // // only print plain businesses to be able to parse them in python scripts - // println!("{businesses:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-offerings") - // .description("List offerings for a community") - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let offerings = extract_and_execute( - // matches, |api, cid| get_offerings(&api, cid).await.unwrap() - // ); - // // only print plain offerings to be able to parse them in python scripts - // println!("{offerings:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-business-offerings") - // .description("List offerings for a business") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let account = matches.account_arg().map(get_accountid_from_str).unwrap(); - // - // let offerings = extract_and_execute( - // matches, |api, cid| get_offerings_for_business(&api, cid, account).await.unwrap() - // ); - // // only print plain offerings to be able to parse them in python scripts - // println!("{offerings:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("purge-community-ceremony") - // .description("purge all history within the provided ceremony index range for the specified community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .from_cindex_arg() - // .to_cindex_arg() - // - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let sudoer = AccountKeyring::Alice.pair(); - // let signer = ParentchainExtrinsicSigner::new(sudoer); - // let mut api = get_chain_api(matches).await; - // api.set_signer(signer); - // - // let current_ceremony_index = get_ceremony_index(&api, None).await; - // - // let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); - // let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); - // - // let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); - // let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); - // - // if from_cindex > to_cindex { - // panic!("'from' <= 'to' ceremony index violated"); - // } - // let cid = verify_cid(&api, - // matches - // .cid_arg() - // .expect("please supply argument --cid"), - // None - // ).await; - // println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); - // - // let calls: Vec<_> = (from_cindex..=to_cindex) - // .map(|idx| compose_call!( - // api.metadata(), - // "EncointerCeremonies", - // "purge_community_ceremony", - // (cid, idx) - // ).unwrap()) - // .collect(); - // let batch_call = compose_call!( - // api.metadata(), - // "Utility", - // "batch", - // calls - // ).unwrap(); - // let unsigned_sudo_call = compose_call!( - // api.metadata(), - // "Sudo", - // "sudo", - // batch_call.clone() - // ).unwrap(); - // info!("raw sudo batch call to sign with js/apps {}: 0x{}", cid, hex::encode(unsigned_sudo_call.encode())); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "Sudo", - // "sudo", - // batch_call - // ).unwrap(); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); - // info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("set-meetup-time-offset") - // .description("signed value to offset the ceremony meetup time relative to solar noon") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .setting(AppSettings::AllowLeadingHyphen) - // .time_offset_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let mut api = get_chain_api(matches).await; - // let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); - // api - // .set_signer(signer); - // let time_offset = matches.time_offset_arg().unwrap_or(0); - // let call = compose_call!( - // api.metadata(), - // "EncointerCeremonies", - // "set_meetup_time_offset", - // time_offset - // ).unwrap(); - // - // // return calls as `OpaqueCall`s to get the same return type in both branches - // let privileged_call = if contains_sudo_pallet(api.metadata()) { - // let sudo_call = sudo_call(api.metadata(), call); - // info!("Printing raw sudo call for js/apps:"); - // print_raw_call("sudo(...)", &sudo_call); - // OpaqueCall::from_tuple(&sudo_call) - // } else { - // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - // let propose_call = collective_propose_call(api.metadata(), threshold, call); - // print_raw_call("collective_propose(...)", &propose_call); - // OpaqueCall::from_tuple(&propose_call) - // }; - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // let xt = xt(&api, privileged_call).await; - // send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg); - // Ok(()) - // }), - // ) + .add_cmd( + Command::new("reputation") + .description("List reputation history for an account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg()}) + .runner(cmd_reputation), + ) + .add_cmd( + Command::new("create-business") + .description("Register a community business on behalf of the account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .ipfs_cid_arg() + }) + .runner(cmd_create_business), + ) + .add_cmd( + Command::new("update-business") + .description("Update an already existing community business on behalf of the account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .ipfs_cid_arg() + }) + .runner(cmd_update_business), + ) + .add_cmd( + Command::new("create-offering") + .description("Create an offering for the business belonging to account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .ipfs_cid_arg() + }) + .runner(cmd_create_offering), + ) + .add_cmd( + Command::new("list-businesses") + .description("List businesses for a community") + .runner(cmd_list_businesses), + ) + .add_cmd( + Command::new("list-offerings") + .description("List offerings for a community") + .runner(cmd_list_offerings), + ) + .add_cmd( + Command::new("list-business-offerings") + .description("List offerings for a business") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + }) + .runner(cmd_list_business_offerings), + ) + .add_cmd( + Command::new("purge-community-ceremony") + .description("purge all history within the provided ceremony index range for the specified community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .from_cindex_arg() + .to_cindex_arg() + + }) + .runner(cmd_purge_community_ceremony), + ) + .add_cmd( + Command::new("set-meetup-time-offset") + .description("signed value to offset the ceremony meetup time relative to solar noon") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .setting(AppSettings::AllowLeadingHyphen) + .time_offset_arg() + }) + .runner(cmd_set_meetup_time_offset), + ) .add_cmd( Command::new("create-faucet") .description("Create faucet") @@ -1721,6 +1584,180 @@ async fn main() { .run(); } +fn cmd_reputation(_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 account = matches.account_arg().unwrap(); + let account_id = get_accountid_from_str(account); + if let Some(reputation) = get_reputation_history(&api, &account_id).await { + for rep in reputation.iter() { + println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); + } + } else { + error!("could not fetch reputation over rpc"); + std::process::exit(exit_code::RPC_ERROR); + } + Ok(()) + }) + .into() +} +fn cmd_create_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).await.unwrap(); + Ok(()) + }) + .into() +} +fn cmd_update_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).await.unwrap(); + Ok(()) + }) + .into() +} +fn cmd_create_offering(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::CreateOffering).await.unwrap(); + Ok(()) + }) + .into() +} +fn cmd_list_businesses(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let businesses = get_businesses(&api, cid).await.unwrap(); + // only print plain businesses to be able to parse them in python scripts + println!("{businesses:?}"); + Ok(()) + }) + .into() +} +fn cmd_list_offerings(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let offerings = get_offerings(&api, cid).await.unwrap(); + // only print plain offerings to be able to parse them in python scripts + println!("{offerings:?}"); + Ok(()) + }) + .into() +} + +fn cmd_list_business_offerings(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let account = matches.account_arg().map(get_accountid_from_str).unwrap(); + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let offerings = get_offerings_for_business(&api, cid, account).await.unwrap(); + // only print plain offerings to be able to parse them in python scripts + println!("{offerings:?}"); + Ok(()) + }) + .into() +} +fn cmd_set_meetup_time_offset(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); + api.set_signer(signer); + let time_offset = matches.time_offset_arg().unwrap_or(0); + let call = compose_call!( + api.metadata(), + "EncointerCeremonies", + "set_meetup_time_offset", + time_offset + ) + .unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let privileged_call = if contains_sudo_pallet(api.metadata()) { + let sudo_call = sudo_call(api.metadata(), call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(...)", &sudo_call); + OpaqueCall::from_tuple(&sudo_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_call = collective_propose_call(api.metadata(), threshold, call); + print_raw_call("collective_propose(...)", &propose_call); + OpaqueCall::from_tuple(&propose_call) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + let xt = xt(&api, privileged_call).await; + send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg); + Ok(()) + }) + .into() +} + +fn cmd_purge_community_ceremony(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let sudoer = AccountKeyring::Alice.pair(); + let signer = ParentchainExtrinsicSigner::new(sudoer); + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); + let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); + + let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); + let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); + + if from_cindex > to_cindex { + panic!("'from' <= 'to' ceremony index violated"); + } + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); + + let calls: Vec<_> = (from_cindex..=to_cindex) + .map(|idx| { + compose_call!( + api.metadata(), + "EncointerCeremonies", + "purge_community_ceremony", + (cid, idx) + ) + .unwrap() + }) + .collect(); + let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); + let unsigned_sudo_call = + compose_call!(api.metadata(), "Sudo", "sudo", batch_call.clone()).unwrap(); + info!( + "raw sudo batch call to sign with js/apps {}: 0x{}", + cid, + hex::encode(unsigned_sudo_call.encode()) + ); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + let xt: EncointerXt<_> = compose_extrinsic!(api, "Sudo", "sudo", batch_call).unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); + info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); + Ok(()) + }) + .into() +} fn cmd_create_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { From 6a0b67788bf215ba7acef758fa21d3aa5148f9c1 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 11:36:48 +0100 Subject: [PATCH 21/41] moar fn --- client/src/main.rs | 2032 +++++++++++++++++++++++--------------------- 1 file changed, 1040 insertions(+), 992 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index 60480d61..883bdd44 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -35,7 +35,7 @@ use crate::{ print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, }, }; -use clap::{value_t, AppSettings, Arg, ArgMatches}; +use clap::{value_t, AppSettings, Arg, ArgMatches, ErrorKind}; use clap_nested::{Command, Commander}; use cli_args::{EncointerArgs, EncointerArgsExtractor}; use encointer_api_client_extension::{ @@ -539,861 +539,194 @@ async fn main() { // Ok(()) // }), // ) - // .add_cmd( - // Command::new("add-locations") - // .description("Register new locations for a community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .signer_arg("account with necessary privileges") - // .dryrun_flag() - // .arg( - // Arg::with_name("specfile") - // .takes_value(true) - // .required(true) - // .help("geojson file that specifies locations to add as points"), - // ) - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // // -----setup - // let spec_file = matches.value_of("specfile").unwrap(); - // let spec = read_community_spec_from_file(spec_file); - // - // let mut api = get_chain_api(matches).await; - // if !matches.dryrun_flag() { - // let signer = matches.signer_arg() - // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - // info!("signer ss58 is {}", signer.public().to_ss58check()); - // let signer = ParentchainExtrinsicSigner::new(signer); - // api.set_signer(signer); - // } - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // - // let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; - // - // let add_location_calls: Vec= spec.locations().into_iter().map(|l| - // { - // info!("adding location {:?}", l); - // add_location_call(api.metadata(), cid, l) - // } - // ).collect(); - // - // let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { - // [call] => OpaqueCall::from_tuple(call), - // _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) - // }; - // - // if matches.signer_arg().is_none() { - // // return calls as `OpaqueCall`s to get the same return type in both branches - // add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { - // let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); - // info!("Printing raw sudo calls for js/apps for cid: {}", cid); - // print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - // OpaqueCall::from_tuple(&sudo_add_location_batch) - // } else { - // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - // info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - // let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); - // print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - // OpaqueCall::from_tuple(&propose_add_location_batch) - // }; - // } - // - // if matches.dryrun_flag() { - // println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); - // } else { - // // ---- send xt's to chain - // if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { - // error!("Wrong ceremony phase for registering new locations for {}", cid); - // error!("Aborting without registering additional locations"); - // std::process::exit(exit_code::WRONG_PHASE); - // } - // send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call).await, tx_payment_cid_arg); - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-communities") - // .description("list all registered communities") - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // let names = get_cid_names(&api).await.unwrap(); - // println!("number of communities: {}", names.len()); - // for n in names.iter() { - // let loc = api.get_locations(n.cid).await.unwrap(); - // println!("{}: {} locations: {}", n.cid, String::from_utf8(n.name.to_vec()).unwrap(), loc.len()); - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-locations") - // .description("list all meetup locations for a community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .at_block_arg() - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // let maybe_at = matches.at_block_arg(); - // let cid = verify_cid(&api, - // matches - // .cid_arg() - // .expect("please supply argument --cid"), - // maybe_at - // ).await; - // println!("listing locations for cid {cid}"); - // let loc = api.get_locations(cid).await.unwrap(); - // for l in loc.iter() { - // println!("lat: {} lon: {} (raw lat: {} lon: {})", l.lat, l.lon, - // i128::decode(&mut l.lat.encode().as_slice()).unwrap(), - // i128::decode(&mut l.lon.encode().as_slice()).unwrap() - // ); - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("get-phase") - // .description("read current ceremony phase from chain") - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // - // // >>>> add some debug info as well - // let bn = get_block_number(&api, None).await; - // debug!("block number: {}", bn); - // let cindex = get_ceremony_index(&api, None).await; - // info!("ceremony index: {}", cindex); - // let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); - // debug!("next phase timestamp: {}", tnext); - // // <<<< - // - // let phase = api.get_current_phase().await.unwrap(); - // println!("{phase:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("next-phase") - // .description("Advance ceremony state machine to next phase by ROOT call") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .signer_arg("account with necessary privileges (sudo or councillor)") - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let signer = matches.signer_arg() - // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - // - // let mut api = get_chain_api(matches).await; - // let signer = ParentchainExtrinsicSigner::new(signer); - // api.set_signer(signer); - // let next_phase_call = compose_call!( - // api.metadata(), - // "EncointerScheduler", - // "next_phase" - // ).unwrap(); - // - // // return calls as `OpaqueCall`s to get the same return type in both branches - // let next_phase_call = if contains_sudo_pallet(api.metadata()) { - // let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); - // info!("Printing raw sudo call for js/apps:"); - // print_raw_call("sudo(next_phase)", &sudo_next_phase_call); - // - // OpaqueCall::from_tuple(&sudo_next_phase_call) - // - // } else { - // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - // info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - // let propose_next_phase = collective_propose_call(api.metadata(), threshold, next_phase_call).await; - // print_raw_call("collective_propose(next_phase)", &propose_next_phase); - // - // OpaqueCall::from_tuple(&propose_next_phase) - // }; - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg); - // - // let phase = api.get_current_phase().await.unwrap(); - // println!("Phase is now: {phase:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-participants") - // .description("list all registered participants supplied community identifier and ceremony index") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .ceremony_index_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // extract_and_execute( - // matches, |api, cid| -> ApiResult<()>{ - // - // let current_ceremony_index = get_ceremony_index(&api, None).await; - // - // let cindex = matches.ceremony_index_arg() - // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - // - // println!("listing participants for cid {cid} and ceremony nr {cindex}"); - // - // let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - // let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None).await; - // - // let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - // let account_query = |registry_index, p_index| api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None).await; - // - // let mut num_participants: Vec = vec![0, 0, 0, 0]; - // for i in 0..registries.len() { - // println!("Querying {}", registries[i]); - // - // let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); - // println!("number of participants assigned: {count}"); - // num_participants[i] = count; - // for p_index in 1..count +1 { - // let accountid: AccountId = account_query(i, p_index)?.unwrap(); - // println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); - // } - // } - // println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", - // num_participants[0..=2].iter().sum::(), - // num_participants[3], - // num_participants[0..=3].iter().sum::() - // ); - // Ok(()) - // } - // ).await.unwrap(); - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-meetups") - // .description("list all assigned meetups for supplied community identifier and ceremony index") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .ceremony_index_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // extract_and_execute( - // matches, |api, cid| -> ApiResult<()>{ - // - // let current_ceremony_index = get_ceremony_index(&api, None).await; - // - // let cindex = matches.ceremony_index_arg() - // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - // - // let community_ceremony = (cid, cindex); - // - // println!("listing meetups for cid {cid} and ceremony nr {cindex}"); - // - // let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); - // - // let mut num_assignees = 0u64; - // - // for meetup in stats.meetups.iter() { - // println!("MeetupRegistry[{:?}, {}] location is {:?}, {:?}", &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon); - // - // println!("MeetupRegistry[{:?}, {}] meeting time is {:?}", &community_ceremony, meetup.index, meetup.time); - // - // if !meetup.registrations.is_empty() { - // let num = meetup.registrations.len(); - // num_assignees += num as u64; - // println!("MeetupRegistry[{:?}, {}] participants: {}", &community_ceremony, meetup.index, num); - // for (participant, _registration) in meetup.registrations.iter() { - // println!(" {participant}"); - // } - // } else { - // println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); - // } - // } - // println!("total number of assignees: {num_assignees}"); - // Ok(()) - // } - // ).await.unwrap(); - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("print-ceremony-stats") - // .description("pretty prints all information for a community ceremony") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .ceremony_index_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // extract_and_execute( - // matches, |api, cid| -> ApiResult<()>{ - // - // let current_ceremony_index = get_ceremony_index(&api, None).await; - // - // let cindex = matches.ceremony_index_arg() - // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - // - // let community_ceremony = (cid, cindex); - // - // let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); - // - // // serialization prints the the account id better than `debug` - // println!("{}", serde_json::to_string_pretty(&stats).unwrap()); - // Ok(()) - // } - // ).unwrap(); - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-attestees") - // .description("list all attestees for participants for supplied community identifier and ceremony index") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .ceremony_index_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // extract_and_execute( - // matches, |api, cid| -> ApiResult<()>{ - // - // let current_ceremony_index = get_ceremony_index(&api, None).await; - // - // let cindex = matches.ceremony_index_arg() - // .map_or_else(|| current_ceremony_index , |ci| into_effective_cindex(ci, current_ceremony_index)); - // - // println!("listing attestees for cid {cid} and ceremony nr {cindex}"); - // - // let wcount = get_attestee_count(&api, (cid, cindex)).await; - // println!("number of attestees: {wcount}"); - // - // println!("listing participants for cid {cid} and ceremony nr {cindex}"); - // - // let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - // let count_query = |count_index| api.get_storage_map(ENCOINTER_CEREMONIES, counts[count_index], (cid, cindex), None).await; - // - // let registries = vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - // let account_query = |registry_index, p_index| async move { - // api.get_storage_double_map(ENCOINTER_CEREMONIES, registries[registry_index],(cid, cindex), p_index, None).await - // }; - // - // let mut participants_windex = HashMap::new(); - // - // for (i, item) in registries.iter().enumerate() { - // println!("Querying {item}"); - // - // let count: ParticipantIndexType = count_query(i)?.unwrap_or(0); - // println!("number of participants assigned: {count}"); - // - // for p_index in 1..count +1 { - // let accountid: AccountId = account_query(i, p_index)?.unwrap(); - // - // match get_participant_attestation_index(&api, (cid, cindex), &accountid).await { - // Some(windex) => { - // participants_windex.insert(windex as AttestationIndexType, accountid) - // } - // _ => continue, - // }; - // } - // } - // - // let mut attestation_states = Vec::with_capacity(wcount as usize); - // - // for w in 1..wcount + 1 { - // let attestor = participants_windex[&w].clone(); - // let meetup_index = api.get_meetup_index(&(cid, cindex), &attestor).await.unwrap().unwrap(); - // let attestees = api.get_attestees((cid, cindex), w).await.unwrap(); - // let vote = api.get_meetup_participant_count_vote((cid, cindex), attestor.clone()).await.unwrap(); - // let attestation_state = AttestationState::new( - // (cid, cindex), - // meetup_index, - // vote, - // w, - // attestor, - // attestees, - // ); - // - // attestation_states.push(attestation_state); - // } - // - // // Group attestation states by meetup index - // attestation_states.sort_by(|a, b| a.meetup_index.partial_cmp(&b.meetup_index).unwrap()); - // - // for a in attestation_states.iter() { - // println!("{a:?}"); - // } - // - // Ok(()) - // } - // ).await.unwrap(); - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-reputables") - // .description("list all reputables for all cycles within the current reputation-lifetime for all communities") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .at_block_arg() - // .verbose_flag() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // - // let is_verbose = matches.verbose_flag(); - // let at_block = matches.at_block_arg(); - // - // let lifetime = get_reputation_lifetime(&api, at_block).await; - // let current_ceremony_index = get_ceremony_index(&api, at_block).await; - // - // - // let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); - // let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); - // - // let community_ids = get_cid_names(&api).await.unwrap().into_iter().map(|names| names.cid); - // - // let mut reputables_csv = Vec::new(); - // - // println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); - // for community_id in community_ids { - // println!("Community ID: {community_id:?}"); - // let mut reputables: HashMap = HashMap::new(); - // for ceremony_index in &ceremony_indices { - // let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block).await; - // println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); - // for attendee in attendees { - // reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); - // *reputables.entry(attendee.clone()).or_insert(0) += 1; - // } - // } - // println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); - // } - // if is_verbose { - // for reputable in reputables_csv { - // println!("{reputable}"); - // } - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("register-participant") - // .description("Register encointer ceremony participant for supplied community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .signer_arg("Account which signs the tx.") - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let arg_who = matches.account_arg().unwrap(); - // let accountid = get_accountid_from_str(arg_who); - // let signer = match matches.signer_arg() { - // Some(sig) => get_pair_from_str(sig), - // None => get_pair_from_str(arg_who) - // }; - // - // let api = get_chain_api(matches).await; - // let cindex = get_ceremony_index(&api, None).await; - // let cid = verify_cid(&api, - // matches - // .cid_arg() - // .expect("please supply argument --cid"), - // None - // ).await; - // let rep = get_reputation(&api, &accountid, cid, cindex -1).await; - // info!("{} has reputation {:?}", accountid, rep); - // let proof = match rep { - // Reputation::Unverified => None, - // Reputation::UnverifiedReputable => None, // this should never be the case during Registering! - // Reputation::VerifiedUnlinked => Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), - // Reputation::VerifiedLinked(_) => Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), - // }; - // debug!("proof: {:x?}", proof.encode()); - // let current_phase = api.get_current_phase().await.unwrap(); - // if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - // error!("wrong ceremony phase for registering participant"); - // std::process::exit(exit_code::WRONG_PHASE); - // } - // let mut api = api; - // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - // api.set_signer(signer); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerCeremonies", - // "register_participant", - // cid, - // proof - // ).unwrap(); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // // send and watch extrinsic until ready - // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - // info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("upgrade-registration") - // .description("Upgrade registration to repuable for encointer ceremony participant for supplied community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .signer_arg("Account which signs the tx.") - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let arg_who = matches.account_arg().unwrap(); - // let accountid = get_accountid_from_str(arg_who); - // let signer = match matches.signer_arg() { - // Some(sig) => get_pair_from_str(sig), - // None => get_pair_from_str(arg_who) - // }; - // - // let api = get_chain_api(matches).await; - // let cindex = get_ceremony_index(&api, None).await; - // let cid = verify_cid(&api, - // matches - // .cid_arg() - // .expect("please supply argument --cid"), - // None - // ).await; - // - // let current_phase = api.get_current_phase().await.unwrap(); - // if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - // error!("wrong ceremony phase for registering participant"); - // std::process::exit(exit_code::WRONG_PHASE); - // } - // let mut reputation_cindex = cindex; - // if current_phase == CeremonyPhaseType::Registering { - // reputation_cindex -= 1; - // } - // let rep = get_reputation(&api, &accountid, cid, reputation_cindex).await; - // info!("{} has reputation {:?}", accountid, rep); - // let proof = match rep { - // Reputation::VerifiedUnlinked => prove_attendance(accountid, cid, reputation_cindex, arg_who), - // _ => { - // error!("No valid reputation in last ceremony."); - // std::process::exit(exit_code::INVALID_REPUTATION); - // }, - // }; - // - // let mut api = api; - // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - // api.set_signer(signer); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerCeremonies", - // "upgrade_registration", - // cid, - // proof - // ).unwrap(); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // // send and watch extrinsic until ready - // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - // info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("unregister-participant") - // .description("Unregister encointer ceremony participant for supplied community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .signer_arg("Account which signs the tx.") - // .ceremony_index_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let arg_who = matches.account_arg().unwrap(); - // let signer = match matches.signer_arg() { - // Some(sig) => get_pair_from_str(sig), - // None => get_pair_from_str(arg_who) - // }; - // - // let api = get_chain_api(matches).await; - // - // let cid = verify_cid(&api, - // matches - // .cid_arg() - // .expect("please supply argument --cid"), - // None - // ).await; - // - // - // let cc = match matches.ceremony_index_arg() { - // Some(cindex_arg) => { - // let current_ceremony_index = get_ceremony_index(&api, None).await; - // let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - // Some((cid, cindex)) - // }, - // None => None, - // }; - // - // let current_phase = api.get_current_phase().await.unwrap(); - // if !(current_phase == CeremonyPhaseType::Registering || current_phase == CeremonyPhaseType::Attesting) { - // error!("wrong ceremony phase for unregistering"); - // std::process::exit(exit_code::WRONG_PHASE); - // } - // let mut api = api; - // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - // api.set_signer(signer); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerCeremonies", - // "unregister_participant", - // cid, - // cc - // ).unwrap(); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // // Send and watch extrinsic until ready - // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - // info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("endorse-newcomers") - // .description("Endorse newbies with a bootstrapper account") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .bootstrapper_arg() - // .endorsees_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // - // extract_and_execute( - // matches, |mut api, cid| endorse_newcomers(&mut api, cid, matches) - // ).await.unwrap(); - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("get-bootstrappers-with-remaining-newbie-tickets") - // .description("Get the bootstrappers along with the remaining newbie tickets") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let bs_with_tickets : Vec = extract_and_execute( - // matches, |api, cid| get_bootstrappers_with_remaining_newbie_tickets(&api, cid) - // ).await.unwrap(); - // - // info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); - // - // // transform it to simple tuples, which is easier to parse in python - // let bt_vec = bs_with_tickets.into_iter() - // .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)).collect::>(); - // - // println!("{bt_vec:?}"); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("get-proof-of-attendance") - // .description("creates a proof of ProofOfAttendances for an for the given ceremony index") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .setting(AppSettings::AllowLeadingHyphen) - // .account_arg() - // .ceremony_index_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let arg_who = matches.account_arg().unwrap(); - // let accountid = get_accountid_from_str(arg_who); - // let api = get_chain_api(matches).await; - // - // let current_ceremony_index = get_ceremony_index(&api, None).await; - // - // let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); - // let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - // - // let cid = verify_cid( - // &api, - // matches.cid_arg().expect("please supply argument --cid"), - // None - // ).await; - // - // debug!("Getting proof for ceremony index: {:?}", cindex); - // let proof = prove_attendance(accountid, cid, cindex, arg_who); - // info!("Proof: {:?}\n", &proof); - // println!("0x{}", hex::encode(proof.encode())); - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("attest-attendees") - // .description("Register encointer ceremony claim of attendances for supplied community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .optional_cid_arg() - // .attestees_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let who = matches.account_arg().map(get_pair_from_str).unwrap(); - // - // let attestees: Vec<_> = matches.attestees_arg().unwrap() - // .into_iter() - // .map(get_accountid_from_str) - // .collect(); - // - // let vote = attestees.len() as u32 + 1u32; - // - // debug!("attestees: {:?}", attestees); - // - // info!("send attest_attendees by {}", who.public()); - // - // let mut api = - // get_chain_api(matches).await; - // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); - // api.set_signer(signer); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let cid = verify_cid(&api, - // matches - // .cid_arg() - // .expect("please supply argument --cid"), - // None - // ).await; - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerCeremonies", - // "attest_attendees", - // cid, - // vote, - // attestees - // ).unwrap(); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - // - // println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("new-claim") - // .description("create a fresh claim of attendance for account") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .arg( - // Arg::with_name("vote") - // .takes_value(true) - // .required(true) - // .value_name("VOTE") - // .help("participant's vote on the number of people present at meetup time"), - // ) - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // extract_and_execute( - // matches, |api, cid| -> ApiResult<()>{ - // let arg_who = matches.account_arg().unwrap(); - // let claimant = get_pair_from_str(arg_who); - // - // let n_participants = matches - // .value_of("vote") - // .unwrap() - // .parse::() - // .unwrap(); - // - // let claim = new_claim_for(&api, &claimant.into(), cid, n_participants).await; - // - // println!("{}", hex::encode(claim)); - // Ok(()) - // } - // ).await.unwrap(); - // - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("claim-reward") - // .description("Claim the rewards for all meetup participants of the last ceremony.") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .signer_arg("Account which signs the tx.") - // .meetup_index_arg() - // .all_flag() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // - // extract_and_execute( - // matches, |api, cid| async move { - // let signer = match matches.signer_arg() { - // Some(sig) => get_pair_from_str(sig), - // None => panic!("please specify --signer.") - // }; - // let mut api = api; - // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - // api.set_signer(signer.clone()); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // let meetup_index_arg = matches.meetup_index_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // if matches.all_flag() { - // let mut cindex = get_ceremony_index(&api, None).await; - // if api.get_current_phase().await.unwrap() == CeremonyPhaseType::Registering { - // cindex -= 1; - // } - // let meetup_count = api - // .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None).await - // .unwrap().unwrap_or(0u64); - // let calls: Vec<_> = (1u64..=meetup_count) - // .map(|idx| compose_call!( - // api.metadata(), - // ENCOINTER_CEREMONIES, - // "claim_rewards", - // cid, - // Option::::Some(idx) - // ).unwrap()) - // .collect(); - // let batch_call = compose_call!( - // api.metadata(), - // "Utility", - // "batch", - // calls - // ).unwrap(); - // send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg); - // println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); - // } else { - // let meetup_index = meetup_index_arg; - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // ENCOINTER_CEREMONIES, - // "claim_rewards", - // cid, - // meetup_index - // ).unwrap(); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - // match meetup_index_arg { - // Some(idx)=>{println!("Claiming reward for meetup_index {idx}. xt-status: '{:?}'", report.status);} - // None=>{println!("Claiming reward for {}. xt-status: 'ready'", signer.public_account_id());} - // } - // } - // } - // ); - // - // Ok(()) - // }), - // ) + .add_cmd( + Command::new("add-locations") + .description("Register new locations for a community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges") + .dryrun_flag() + .arg( + Arg::with_name("specfile") + .takes_value(true) + .required(true) + .help("geojson file that specifies locations to add as points"), + ) + }) + .runner(cmd_add_locations), + ) + .add_cmd( + Command::new("list-communities") + .description("list all registered communities") + .runner(cmd_list_communities), + ) + .add_cmd( + Command::new("list-locations") + .description("list all meetup locations for a community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + }) + .runner(cmd_list_locations), + ) + .add_cmd( + Command::new("get-phase") + .description("read current ceremony phase from chain") + .runner(cmd_get_phase), + ) + .add_cmd( + Command::new("next-phase") + .description("Advance ceremony state machine to next phase by ROOT call") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + }) + .runner(cmd_next_phase), + ) + .add_cmd( + Command::new("list-participants") + .description("list all registered participants supplied community identifier and ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(cmd_list_participants), + ) + .add_cmd( + Command::new("list-meetups") + .description("list all assigned meetups for supplied community identifier and ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(cmd_list_meetups), + ) + .add_cmd( + Command::new("print-ceremony-stats") + .description("pretty prints all information for a community ceremony") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(cmd_print_ceremony_stats), + ) + .add_cmd( + Command::new("list-attestees") + .description("list all attestees for participants for supplied community identifier and ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .ceremony_index_arg() + }) + .runner(cmd_list_attestees), + ) + .add_cmd( + Command::new("list-reputables") + .description("list all reputables for all cycles within the current reputation-lifetime for all communities") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + .verbose_flag() + }) + .runner(cmd_list_reputables), + ) + .add_cmd( + Command::new("register-participant") + .description("Register encointer ceremony participant for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .signer_arg("Account which signs the tx.") + }) + .runner(cmd_register_participant), + ) + .add_cmd( + Command::new("upgrade-registration") + .description("Upgrade registration to repuable for encointer ceremony participant for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .signer_arg("Account which signs the tx.") + }) + .runner(cmd_upgrade_registration), + ) + .add_cmd( + Command::new("unregister-participant") + .description("Unregister encointer ceremony participant for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .signer_arg("Account which signs the tx.") + .ceremony_index_arg() + }) + .runner(cmd_unregister_participant), + ) + .add_cmd( + Command::new("endorse-newcomers") + .description("Endorse newbies with a bootstrapper account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .bootstrapper_arg() + .endorsees_arg() + }) + .runner(cmd_endorse_newcomers), + ) + .add_cmd( + Command::new("get-bootstrappers-with-remaining-newbie-tickets") + .description("Get the bootstrappers along with the remaining newbie tickets") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + }) + .runner(cmd_get_bootstrappers_with_remaining_newbie_tickets), + ) + .add_cmd( + Command::new("get-proof-of-attendance") + .description("creates a proof of ProofOfAttendances for an for the given ceremony index") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .setting(AppSettings::AllowLeadingHyphen) + .account_arg() + .ceremony_index_arg() + }) + .runner(cmd_get_proof_of_attendance), + ) + .add_cmd( + Command::new("attest-attendees") + .description("Register encointer ceremony claim of attendances for supplied community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .optional_cid_arg() + .attestees_arg() + }) + .runner(cmd_attest_attendees), + ) + .add_cmd( + Command::new("new-claim") + .description("create a fresh claim of attendance for account") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .arg( + Arg::with_name("vote") + .takes_value(true) + .required(true) + .value_name("VOTE") + .help("participant's vote on the number of people present at meetup time"), + ) + }) + .runner(cmd_new_claim), + ) + .add_cmd( + Command::new("claim-reward") + .description("Claim the rewards for all meetup participants of the last ceremony.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("Account which signs the tx.") + .meetup_index_arg() + .all_flag() + }) + .runner(cmd_claim_reward), + ) .add_cmd( Command::new("reputation") .description("List reputation history for an account") @@ -1443,147 +776,862 @@ async fn main() { .runner(cmd_list_offerings), ) .add_cmd( - Command::new("list-business-offerings") - .description("List offerings for a business") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - }) - .runner(cmd_list_business_offerings), + Command::new("list-business-offerings") + .description("List offerings for a business") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + }) + .runner(cmd_list_business_offerings), + ) + .add_cmd( + Command::new("purge-community-ceremony") + .description("purge all history within the provided ceremony index range for the specified community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .from_cindex_arg() + .to_cindex_arg() + + }) + .runner(cmd_purge_community_ceremony), + ) + .add_cmd( + Command::new("set-meetup-time-offset") + .description("signed value to offset the ceremony meetup time relative to solar noon") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .setting(AppSettings::AllowLeadingHyphen) + .time_offset_arg() + }) + .runner(cmd_set_meetup_time_offset), + ) + .add_cmd( + Command::new("create-faucet") + .description("Create faucet") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_name_arg() + .faucet_balance_arg() + .faucet_drip_amount_arg() + .whitelist_arg() + }) + .runner(cmd_create_faucet), + ) + .add_cmd( + Command::new("drip-faucet") + .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_account_arg() + .cindex_arg() + }) + .runner(cmd_drip_faucet), + ) + .add_cmd( + Command::new("dissolve-faucet") + .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + .faucet_account_arg() + .faucet_beneficiary_arg() + }) + .runner(cmd_dissolve_faucet), + ) + .add_cmd( + Command::new("close-faucet") + .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .faucet_account_arg() + }) + .runner(cmd_close_faucet), + ) + .add_cmd( + Command::new("set-faucet-reserve-amount") + .description("Set faucet pallet reserve amount") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .signer_arg("account with necessary privileges (sudo or councillor)") + .faucet_reserve_amount_arg() + }) + .runner(cmd_set_faucet_reserve_amount), + ) + .add_cmd( + Command::new("list-faucets") + .description("list all faucets. use -v to get faucet details.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + .verbose_flag() + }) + .runner(cmd_list_faucets) + ) + .add_cmd( + Command::new("submit-set-inactivity-timeout-proposal") + .description("Submit set inactivity timeout proposal") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .inactivity_timeout_arg() + }) + .runner(cmd_submit_set_inactivity_timeout_proposal), + ) + .add_cmd( + Command::new("list-proposals") + .description("list all proposals.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + }) + .runner(cmd_list_proposals), + ) + .add_cmd( + Command::new("vote") + .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .proposal_id_arg() + .vote_arg() + .reputation_vec_arg() + }) + .runner(cmd_vote), + ) + .add_cmd( + Command::new("update-proposal-state") + .description("Update proposal state") + .options(|app| { + app.setting(AppSettings::ColoredHelp).account_arg().proposal_id_arg() + }) + .runner(cmd_update_proposal_state), ) - .add_cmd( - Command::new("purge-community-ceremony") - .description("purge all history within the provided ceremony index range for the specified community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .from_cindex_arg() - .to_cindex_arg() + // To handle when no subcommands match + .no_cmd(|_args, _matches| { + println!("No subcommand matched"); + Ok(()) + }) + .run(); +} +////////////////////// +fn cmd_add_locations(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + // -----setup + let spec_file = matches.value_of("specfile").unwrap(); + let spec = read_community_spec_from_file(spec_file); + + let mut api = get_chain_api(matches).await; + if !matches.dryrun_flag() { + let signer = matches.signer_arg() + .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + info!("signer ss58 is {}", signer.public().to_ss58check()); + let signer = ParentchainExtrinsicSigner::new(signer); + api.set_signer(signer); + } + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + + let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; + + let add_location_calls: Vec= spec.locations().into_iter().map(|l| + { + info!("adding location {:?}", l); + add_location_call(api.metadata(), cid, l) + } + ).collect(); + + let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { + [call] => OpaqueCall::from_tuple(call), + _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) + }; + + if matches.signer_arg().is_none() { + // return calls as `OpaqueCall`s to get the same return type in both branches + add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { + let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); + info!("Printing raw sudo calls for js/apps for cid: {}", cid); + print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + OpaqueCall::from_tuple(&sudo_add_location_batch) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); + print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + OpaqueCall::from_tuple(&propose_add_location_batch) + }; + } + + if matches.dryrun_flag() { + println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); + } else { + // ---- send xt's to chain + if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + error!("Wrong ceremony phase for registering new locations for {}", cid); + error!("Aborting without registering additional locations"); + std::process::exit(exit_code::WRONG_PHASE); + } + send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call).await, tx_payment_cid_arg).await; + } + Ok(()) + + }) + .into() +} +fn cmd_list_communities(_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 names = get_cid_names(&api).await.unwrap(); + println!("number of communities: {}", names.len()); + for n in names.iter() { + let loc = api.get_locations(n.cid).await.unwrap(); + println!( + "{}: {} locations: {}", + n.cid, + String::from_utf8(n.name.to_vec()).unwrap(), + loc.len() + ); + } + Ok(()) + }) + .into() +} +fn cmd_list_locations(_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 maybe_at = matches.at_block_arg(); + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), maybe_at) + .await; + println!("listing locations for cid {cid}"); + let loc = api.get_locations(cid).await.unwrap(); + for l in loc.iter() { + println!( + "lat: {} lon: {} (raw lat: {} lon: {})", + l.lat, + l.lon, + i128::decode(&mut l.lat.encode().as_slice()).unwrap(), + i128::decode(&mut l.lon.encode().as_slice()).unwrap() + ); + } + Ok(()) + }) + .into() +} +fn cmd_get_phase(_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; + + // >>>> add some debug info as well + let bn = get_block_number(&api, None).await; + debug!("block number: {}", bn); + let cindex = get_ceremony_index(&api, None).await; + info!("ceremony index: {}", cindex); + let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); + debug!("next phase timestamp: {}", tnext); + // <<<< + + let phase = api.get_current_phase().await.unwrap(); + println!("{phase:?}"); + Ok(()) + }) + .into() +} +fn cmd_next_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(signer); + api.set_signer(signer); + let next_phase_call = + compose_call!(api.metadata(), "EncointerScheduler", "next_phase").unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let next_phase_call = if contains_sudo_pallet(api.metadata()) { + let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(next_phase)", &sudo_next_phase_call); + + OpaqueCall::from_tuple(&sudo_next_phase_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_next_phase = + collective_propose_call(api.metadata(), threshold, next_phase_call); + print_raw_call("collective_propose(next_phase)", &propose_next_phase); + + OpaqueCall::from_tuple(&propose_next_phase) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg); + + let phase = api.get_current_phase().await.unwrap(); + println!("Phase is now: {phase:?}"); + Ok(()) + }) + .into() +} +fn cmd_list_participants(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + println!("listing participants for cid {cid} and ceremony nr {cindex}"); + + let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; + + let registries = + vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; + + let mut num_participants: Vec = vec![0, 0, 0, 0]; + for i in 0..registries.len() { + println!("Querying {}", registries[i]); + + let count: ParticipantIndexType = api + .get_storage_map(ENCOINTER_CEREMONIES, counts[i], (cid, cindex), None) + .await + .unwrap() + .unwrap_or(0); + println!("number of participants assigned: {count}"); + num_participants[i] = count; + for p_index in 1..count + 1 { + let accountid: AccountId = api + .get_storage_double_map( + ENCOINTER_CEREMONIES, + registries[i], + (cid, cindex), + p_index, + None, + ) + .await + .unwrap() + .unwrap(); + println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); + } + } + println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", + num_participants[0..=2].iter().sum::(), + num_participants[3], + num_participants[0..=3].iter().sum::() + ); + Ok(()) + }) + .into() +} +fn cmd_list_meetups(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + println!("listing meetups for cid {cid} and ceremony nr {cindex}"); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + let mut num_assignees = 0u64; + + for meetup in stats.meetups.iter() { + println!( + "MeetupRegistry[{:?}, {}] location is {:?}, {:?}", + &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon + ); + + println!( + "MeetupRegistry[{:?}, {}] meeting time is {:?}", + &community_ceremony, meetup.index, meetup.time + ); + + if !meetup.registrations.is_empty() { + let num = meetup.registrations.len(); + num_assignees += num as u64; + println!( + "MeetupRegistry[{:?}, {}] participants: {}", + &community_ceremony, meetup.index, num + ); + for (participant, _registration) in meetup.registrations.iter() { + println!(" {participant}"); + } + } else { + println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); + } + } + println!("total number of assignees: {num_assignees}"); + Ok(()) + }) + .into() +} + +fn cmd_print_ceremony_stats(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + // serialization prints the the account id better than `debug` + println!("{}", serde_json::to_string_pretty(&stats).unwrap()); + Ok(()) + }) + .into() +} +fn cmd_list_attestees(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + // serialization prints the the account id better than `debug` + println!("{}", serde_json::to_string_pretty(&stats).unwrap()); + Ok(()) + }) + .into() +} +fn cmd_list_reputables(_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 is_verbose = matches.verbose_flag(); + let at_block = matches.at_block_arg(); + + let lifetime = get_reputation_lifetime(&api, at_block).await; + let current_ceremony_index = get_ceremony_index(&api, at_block).await; + + + let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); + let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); + + let community_ids = get_cid_names(&api).await.unwrap().into_iter().map(|names| names.cid); + + let mut reputables_csv = Vec::new(); + + println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); + for community_id in community_ids { + println!("Community ID: {community_id:?}"); + let mut reputables: HashMap = HashMap::new(); + for ceremony_index in &ceremony_indices { + let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block).await; + println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); + for attendee in attendees { + reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); + *reputables.entry(attendee.clone()).or_insert(0) += 1; + } + } + println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); + } + if is_verbose { + for reputable in reputables_csv { + println!("{reputable}"); + } + } + Ok(()) + + }) + .into() +} +fn cmd_upgrade_registration(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + let cindex = get_ceremony_index(&api, None).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering + || current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for registering participant"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut reputation_cindex = cindex; + if current_phase == CeremonyPhaseType::Registering { + reputation_cindex -= 1; + } + let rep = get_reputation(&api, &accountid, cid, reputation_cindex).await; + info!("{} has reputation {:?}", accountid, rep); + let proof = match rep { + Reputation::VerifiedUnlinked => { + prove_attendance(accountid, cid, reputation_cindex, arg_who) + }, + _ => { + error!("No valid reputation in last ceremony."); + std::process::exit(exit_code::INVALID_REPUTATION); + }, + }; + + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerCeremonies", "upgrade_registration", cid, proof) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +fn cmd_register_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + let cindex = get_ceremony_index(&api, None).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let rep = get_reputation(&api, &accountid, cid, cindex - 1).await; + info!("{} has reputation {:?}", accountid, rep); + let proof = match rep { + Reputation::Unverified => None, + Reputation::UnverifiedReputable => None, // this should never be the case during Registering! + Reputation::VerifiedUnlinked => { + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) + }, + Reputation::VerifiedLinked(_) => { + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) + }, + }; + debug!("proof: {:x?}", proof.encode()); + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering + || current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for registering participant"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerCeremonies", "register_participant", cid, proof) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +fn cmd_unregister_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; - }) - .runner(cmd_purge_community_ceremony), - ) - .add_cmd( - Command::new("set-meetup-time-offset") - .description("signed value to offset the ceremony meetup time relative to solar noon") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .setting(AppSettings::AllowLeadingHyphen) - .time_offset_arg() - }) - .runner(cmd_set_meetup_time_offset), - ) - .add_cmd( - Command::new("create-faucet") - .description("Create faucet") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_name_arg() - .faucet_balance_arg() - .faucet_drip_amount_arg() - .whitelist_arg() - }) - .runner(cmd_create_faucet), - ) - .add_cmd( - Command::new("drip-faucet") - .description("Drip faucet. args: 1. faucet account, 2. cindex of the reputation. use --cid to specify the community.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_account_arg() - .cindex_arg() - }) - .runner(cmd_drip_faucet), - ) - .add_cmd( - Command::new("dissolve-faucet") - .description("can only be called by root. args: 1. faucet address, 2. beneficiary of the remaining funds.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - .faucet_account_arg() - .faucet_beneficiary_arg() - }) - .runner(cmd_dissolve_faucet), - ) - .add_cmd( - Command::new("close-faucet") - .description("lazy garbage collection. can only be called by faucet creator and only once the faucet is empty") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .faucet_account_arg() - }) - .runner(cmd_close_faucet), - ) - .add_cmd( - Command::new("set-faucet-reserve-amount") - .description("Set faucet pallet reserve amount") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .signer_arg("account with necessary privileges (sudo or councillor)") - .faucet_reserve_amount_arg() - }) - .runner(cmd_set_faucet_reserve_amount), - ) - .add_cmd( - Command::new("list-faucets") - .description("list all faucets. use -v to get faucet details.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - .verbose_flag() - }) - .runner(cmd_list_faucets) - ) - .add_cmd( - Command::new("submit-set-inactivity-timeout-proposal") - .description("Submit set inactivity timeout proposal") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .inactivity_timeout_arg() - }) - .runner(cmd_submit_set_inactivity_timeout_proposal), - ) - .add_cmd( - Command::new("list-proposals") - .description("list all proposals.") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .at_block_arg() - }) - .runner(cmd_list_proposals), - ) - .add_cmd( - Command::new("vote") - .description("Submit vote for porposal. Vote is either ay or nay. Reputation vec to be specified as cid1_cindex1,cid2_cindex2,...") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .account_arg() - .proposal_id_arg() - .vote_arg() - .reputation_vec_arg() - }) - .runner(cmd_vote), - ) - .add_cmd( - Command::new("update-proposal-state") - .description("Update proposal state") - .options(|app| { - app.setting(AppSettings::ColoredHelp).account_arg().proposal_id_arg() - }) - .runner(cmd_update_proposal_state), + let api = get_chain_api(matches).await; + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let cc = match matches.ceremony_index_arg() { + Some(cindex_arg) => { + let current_ceremony_index = get_ceremony_index(&api, None).await; + let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + Some((cid, cindex)) + }, + None => None, + }; + + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering + || current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for unregistering"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerCeremonies", "unregister_participant", cid, cc) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // Send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +fn cmd_endorse_newcomers(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + endorse_newcomers(&mut api, cid, matches).await.unwrap(); + + Ok(()) + }) + .into() +} +fn cmd_get_bootstrappers_with_remaining_newbie_tickets( + _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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let bs_with_tickets: Vec = + get_bootstrappers_with_remaining_newbie_tickets(&api, cid).await.unwrap(); + + info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); + + // transform it to simple tuples, which is easier to parse in python + let bt_vec = bs_with_tickets + .into_iter() + .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)) + .collect::>(); + + println!("{bt_vec:?}"); + Ok(()) + }) + .into() +} +fn cmd_get_proof_of_attendance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let api = get_chain_api(matches).await; + + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); + let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + debug!("Getting proof for ceremony index: {:?}", cindex); + let proof = prove_attendance(accountid, cid, cindex, arg_who); + info!("Proof: {:?}\n", &proof); + println!("0x{}", hex::encode(proof.encode())); + + Ok(()) + }) + .into() +} +fn cmd_attest_attendees(_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 attestees: Vec<_> = matches + .attestees_arg() + .unwrap() + .into_iter() + .map(get_accountid_from_str) + .collect(); + + let vote = attestees.len() as u32 + 1u32; + + debug!("attestees: {:?}", attestees); + + info!("send attest_attendees by {}", who.public()); + + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerCeremonies", + "attest_attendees", + cid, + vote, + attestees ) - // To handle when no subcommands match - .no_cmd(|_args, _matches| { - println!("No subcommand matched"); - Ok(()) - }) - .run(); + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + + println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); + Ok(()) + }) + .into() +} +fn cmd_new_claim(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let arg_who = matches.account_arg().unwrap(); + let claimant = get_pair_from_str(arg_who); + + let n_participants = matches.value_of("vote").unwrap().parse::().unwrap(); + + let claim = new_claim_for(&api, &claimant.into(), cid, n_participants).await; + + println!("{}", hex::encode(claim)); + + Ok(()) + }) + .into() } +fn cmd_claim_reward(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => panic!("please specify --signer."), + }; + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer.clone()); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let meetup_index_arg = matches.meetup_index_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + if matches.all_flag() { + let mut cindex = get_ceremony_index(&api, None).await; + if api.get_current_phase().await.unwrap() == CeremonyPhaseType::Registering { + cindex -= 1; + } + let meetup_count = api + .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None) + .await + .unwrap() + .unwrap_or(0u64); + let calls: Vec<_> = (1u64..=meetup_count) + .map(|idx| { + compose_call!( + api.metadata(), + ENCOINTER_CEREMONIES, + "claim_rewards", + cid, + Option::::Some(idx) + ) + .unwrap() + }) + .collect(); + let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); + send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg); + println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); + } else { + let meetup_index = meetup_index_arg; + let xt: EncointerXt<_> = + compose_extrinsic!(api, ENCOINTER_CEREMONIES, "claim_rewards", cid, meetup_index) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + match meetup_index_arg { + Some(idx) => { + println!( + "Claiming reward for meetup_index {idx}. xt-status: '{:?}'", + report.status + ); + }, + None => { + println!( + "Claiming reward for {}. xt-status: 'ready'", + signer.public_account_id() + ); + }, + } + } + Ok(()) + }) + .into() +} fn cmd_reputation(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { From 72a9698c6ea2be6958c947910309e393e3086450 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 12:03:47 +0100 Subject: [PATCH 22/41] all commands refactored --- client/src/main.rs | 845 +++++++++++++++++++++++---------------------- 1 file changed, 436 insertions(+), 409 deletions(-) diff --git a/client/src/main.rs b/client/src/main.rs index 883bdd44..3b72b3f4 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -130,415 +130,143 @@ async fn main() { .setting(AppSettings::ColoredHelp) }) .args(|_args, _matches| "") - // .add_cmd( - // Command::new("new-account") - // .description("Imports account into the key store. Either creates a new account or with the supplied seed.") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .seed_arg() - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // - // let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - // - // // This does not place the key into the keystore if we have a seed, but it does - // // place it into the keystore if the seed is none. - // let key = store.sr25519_generate_new( - // SR25519, - // matches.seed_arg(), - // ).unwrap(); - // - // if let Some(suri) = matches.seed_arg() { - // store.insert(SR25519, suri, &key.0).unwrap(); - // } - // - // drop(store); - // println!("{}", key.to_ss58check()); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("list-accounts") - // .description("lists all accounts in keystore") - // .runner(|_args: &str, _matches: &ArgMatches<'_>| { - // let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - // info!("sr25519 keys:"); - // for pubkey in store.public_keys::() - // .unwrap() - // .into_iter() - // { - // println!("{}", pubkey.to_ss58check()); - // } - // info!("ed25519 keys:"); - // for pubkey in store.public_keys::() - // .unwrap() - // .into_iter() - // { - // println!("{}", pubkey.to_ss58check()); - // } - // drop(store); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("print-metadata") - // .description("query node metadata and print it as json to stdout") - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("faucet") - // .description("send some bootstrapping funds to supplied account(s)") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .fundees_arg() - // }) - // .runner(move |_args: &str, matches: &ArgMatches<'_>| { - // let mut api = get_chain_api(matches).await; - // api - // .set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); - // let accounts = matches.fundees_arg().unwrap(); - // - // let existential_deposit = api.get_existential_deposit().unwrap(); - // info!("Existential deposit is = {:?}", existential_deposit); - // - // let mut nonce = api.get_nonce().unwrap(); - // - // let amount = reasonable_native_balance(&api); - // - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // for account in accounts.into_iter() { - // let to = get_accountid_from_str(account); - // let call = compose_call!( - // api.metadata(), - // "Balances", - // "transfer_keep_alive", - // ExtrinsicAddress::from(to.clone()), - // Compact(amount) - // ).unwrap(); - // let xt: EncointerXt<_> = compose_extrinsic_offline!( - // api.clone().signer().unwrap(), - // call.clone(), - // api.extrinsic_params(nonce) - // ); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // // send and watch extrinsic until ready - // println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); - // let _blockh = api - // .submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await - // .unwrap(); - // nonce += 1; - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("balance") - // .description("query on-chain balance for AccountId. If --cid is supplied, returns balance in that community. Otherwise balance of native ERT token") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .account_arg() - // .all_flag() - // .at_block_arg() - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // let account = matches.account_arg().unwrap(); - // let maybe_at = matches.at_block_arg(); - // let accountid = get_accountid_from_str(account); - // match matches.cid_arg() { - // Some(cid_str) => { - // let balance = get_community_balance(&api, cid_str, &accountid, maybe_at); - // println!{"{balance:?}"}; - // } - // None => { - // if matches.all_flag() { - // let community_balances = get_all_balances(&api, &accountid).unwrap(); - // let bn = get_block_number(&api, maybe_at); - // for b in community_balances.iter() { - // let dr = get_demurrage_per_block(&api, b.0); - // println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) - // } - // } - // let balance = if let Some(data) = api.get_account_data(&accountid).unwrap() { - // data.free - // } else { - // 0 - // }; - // println!("{balance}"); - // } - // }; - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("issuance") - // .description("query total issuance for community. must supply --cid") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .at_block_arg() - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // let api = get_chain_api(matches).await; - // let maybe_at = matches.at_block_arg(); - // let cid_str = matches.cid_arg().expect("please supply argument --cid"); - // let issuance = get_community_issuance(&api, cid_str, maybe_at); - // println!{"{issuance:?}"}; - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("transfer") - // .description("transfer funds from one account to another. If --cid is supplied, send that community (amount is fixpoint). Otherwise send native ERT tokens (amount is integer)") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .dryrun_flag() - // .arg( - // Arg::with_name("from") - // .takes_value(true) - // .required(true) - // .value_name("SS58") - // .help("sender's AccountId in ss58check format"), - // ) - // .arg( - // Arg::with_name("to") - // .takes_value(true) - // .required(true) - // .value_name("SS58") - // .help("recipient's AccountId in ss58check format"), - // ) - // .arg( - // Arg::with_name("amount") - // .takes_value(true) - // .required(true) - // .value_name("U128") - // .help("amount to be transferred"), - // ) - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // let mut api = get_chain_api(matches).await; - // let arg_from = matches.value_of("from").unwrap(); - // let arg_to = matches.value_of("to").unwrap(); - // if !matches.dryrun_flag() { - // let from = get_pair_from_str(arg_from); - // info!("from ss58 is {}", from.public().to_ss58check()); - // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - // api.set_signer(signer); - // } - // let to = get_accountid_from_str(arg_to); - // info!("to ss58 is {}", to.to_ss58check()); - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // let tx_hash = match matches.cid_arg() { - // Some(cid_str) => { - // let cid = verify_cid(&api, cid_str, None).await; - // let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) - // .expect("amount can be converted to fixpoint"); - // - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerBalances", - // "transfer", - // to.clone(), - // cid, - // amount - // ).unwrap(); - // if matches.dryrun_flag() { - // println!("0x{}", hex::encode(xt.function.encode())); - // None - // } else { - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) - // } - // }, - // None => { - // let amount = matches.value_of("amount").unwrap().parse::() - // .expect("amount can be converted to u128"); - // let xt = api.balance_transfer_allow_death( - // to.clone().into(), - // amount - // ); - // if matches.dryrun_flag() { - // println!("0x{}", hex::encode(xt.function.encode())); - // None - // } else { - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) - // } - // } - // }; - // if let Some(txh) = tx_hash { - // info!("[+] Transaction included. Hash: {:?}\n", txh); - // let result = api.get_account_data(&to).unwrap().unwrap(); - // println!("balance for {} is now {}", to, result.free); - // } - // Ok(()) - // }), - // ) - // .add_cmd( - // Command::new("transfer_all") - // .description("transfer all available funds from one account to another for a community specified with --cid.") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .arg( - // Arg::with_name("from") - // .takes_value(true) - // .required(true) - // .value_name("SS58") - // .help("sender's AccountId in ss58check format"), - // ) - // .arg( - // Arg::with_name("to") - // .takes_value(true) - // .required(true) - // .value_name("SS58") - // .help("recipient's AccountId in ss58check format"), - // ) - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // let mut api = get_chain_api(matches).await; - // let arg_from = matches.value_of("from").unwrap(); - // let arg_to = matches.value_of("to").unwrap(); - // let from = get_pair_from_str(arg_from); - // let to = get_accountid_from_str(arg_to); - // info!("from ss58 is {}", from.public().to_ss58check()); - // info!("to ss58 is {}", to.to_ss58check()); - // - // let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - // api.set_signer(signer); - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // let tx_hash = match matches.cid_arg() { - // Some(cid_str) => { - // let cid = verify_cid(&api, cid_str, None).await; - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // let xt: EncointerXt<_> = compose_extrinsic!( - // api, - // "EncointerBalances", - // "transfer_all", - // to.clone(), - // cid - // ).unwrap(); - // ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() - // }, - // None => { - // error!("No cid specified"); - // std::process::exit(exit_code::NO_CID_SPECIFIED); - // } - // }; - // info!("[+] Transaction included. Hash: {:?}\n", tx_hash); - // let result = api.get_account_data(&to).unwrap().unwrap(); - // println!("balance for {} is now {}", to, result.free); - // Ok(()) - // - // }), - // ) - // .add_cmd( - // Command::new("listen") - // .description("listen to on-chain events") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .arg( - // Arg::with_name("events") - // .short("e") - // .long("await-events") - // .takes_value(true) - // .help("exit after given number of encointer events"), - // ) - // .arg( - // Arg::with_name("blocks") - // .short("b") - // .long("await-blocks") - // .takes_value(true) - // .help("exit after given number of blocks"), - // ) - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // listen(matches); - // Ok(()) - // }), - // ) - // // start encointer stuff - // .add_cmd( - // Command::new("new-community") - // .description("Register new community") - // .options(|app| { - // app.setting(AppSettings::ColoredHelp) - // .arg( - // Arg::with_name("specfile") - // .takes_value(true) - // .required(true) - // .help("enhanced geojson file that specifies a community"), - // ) - // .signer_arg("account with necessary privileges") - // }) - // .runner(|_args: &str, matches: &ArgMatches<'_>| { - // // -----setup - // let spec_file = matches.value_of("specfile").unwrap(); - // let spec = read_community_spec_from_file(spec_file); - // let cid = spec.community_identifier(); - // - // let signer = matches.signer_arg() - // .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - // let signer = ParentchainExtrinsicSigner::new(signer); - // - // let mut api = get_chain_api(matches).await; - // api.set_signer(signer); - // - // - // // ------- create calls for xt's - // let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); - // // only the first meetup location has been registered now. register all others one-by-one - // let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); - // let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); - // - // - // if matches.signer_arg().is_none() { - // // return calls as `OpaqueCall`s to get the same return type in both branches - // (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { - // let sudo_new_community = sudo_call(api.metadata(), new_community_call); - // let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); - // info!("Printing raw sudo calls for js/apps for cid: {}", cid); - // print_raw_call("sudo(new_community)", &sudo_new_community); - // print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - // - // (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) - // - // } else { - // let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - // info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - // let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); - // let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); - // print_raw_call("collective_propose(new_community)", &propose_new_community); - // print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - // - // (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) - // }; - // } - // - // // ---- send xt's to chain - // let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - // set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); - // - // send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()); - // println!("{cid}"); - // - // if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { - // error!("Wrong ceremony phase for registering new locations for {}", cid); - // error!("Aborting without registering additional locations"); - // std::process::exit(exit_code::WRONG_PHASE); - // } - // send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg); - // Ok(()) - // }), - // ) + .add_cmd( + Command::new("new-account") + .description("Imports account into the key store. Either creates a new account or with the supplied seed.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .seed_arg() + }) + .runner(cmd_new_account), + ) + .add_cmd( + Command::new("list-accounts") + .description("lists all accounts in keystore") + .runner(cmd_list_accounts), + ) + .add_cmd( + Command::new("print-metadata") + .description("query node metadata and print it as json to stdout") + .runner(cmd_print_metadata), + ) + .add_cmd( + Command::new("faucet") + .description("send some bootstrapping funds to supplied account(s)") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .fundees_arg() + }) + .runner(cmd_faucet), + ) + .add_cmd( + Command::new("balance") + .description("query on-chain balance for AccountId. If --cid is supplied, returns balance in that community. Otherwise balance of native ERT token") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .account_arg() + .all_flag() + .at_block_arg() + }) + .runner(cmd_balance), + ) + .add_cmd( + Command::new("issuance") + .description("query total issuance for community. must supply --cid") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .at_block_arg() + }) + .runner(cmd_issuance), + ) + .add_cmd( + Command::new("transfer") + .description("transfer funds from one account to another. If --cid is supplied, send that community (amount is fixpoint). Otherwise send native ERT tokens (amount is integer)") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .dryrun_flag() + .arg( + Arg::with_name("from") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("sender's AccountId in ss58check format"), + ) + .arg( + Arg::with_name("to") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("recipient's AccountId in ss58check format"), + ) + .arg( + Arg::with_name("amount") + .takes_value(true) + .required(true) + .value_name("U128") + .help("amount to be transferred"), + ) + }) + .runner(cmd_transfer), + ) + .add_cmd( + Command::new("transfer_all") + .description("transfer all available funds from one account to another for a community specified with --cid.") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .arg( + Arg::with_name("from") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("sender's AccountId in ss58check format"), + ) + .arg( + Arg::with_name("to") + .takes_value(true) + .required(true) + .value_name("SS58") + .help("recipient's AccountId in ss58check format"), + ) + }) + .runner(cmd_transfer_all), + ) + .add_cmd( + Command::new("listen") + .description("listen to on-chain events") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .arg( + Arg::with_name("events") + .short("e") + .long("await-events") + .takes_value(true) + .help("exit after given number of encointer events"), + ) + .arg( + Arg::with_name("blocks") + .short("b") + .long("await-blocks") + .takes_value(true) + .help("exit after given number of blocks"), + ) + }) + .runner(cmd_listen), + ) + .add_cmd( + Command::new("new-community") + .description("Register new community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .arg( + Arg::with_name("specfile") + .takes_value(true) + .required(true) + .help("enhanced geojson file that specifies a community"), + ) + .signer_arg("account with necessary privileges") + }) + .runner(cmd_new_community), + ) .add_cmd( Command::new("add-locations") .description("Register new locations for a community") @@ -917,6 +645,305 @@ async fn main() { .run(); } ////////////////////// +fn cmd_new_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + + // This does not place the key into the keystore if we have a seed, but it does + // place it into the keystore if the seed is none. + let key = store.sr25519_generate_new(SR25519, matches.seed_arg()).unwrap(); + + if let Some(suri) = matches.seed_arg() { + store.insert(SR25519, suri, &key.0).unwrap(); + } + + drop(store); + println!("{}", key.to_ss58check()); + Ok(()) +} +fn cmd_list_accounts(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + info!("sr25519 keys:"); + for pubkey in store.public_keys::().unwrap().into_iter() { + println!("{}", pubkey.to_ss58check()); + } + info!("ed25519 keys:"); + for pubkey in store.public_keys::().unwrap().into_iter() { + println!("{}", pubkey.to_ss58check()); + } + drop(store); + Ok(()) +} +fn cmd_print_metadata(_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; + println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); + Ok(()) + }) + .into() +} +fn cmd_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); + let accounts = matches.fundees_arg().unwrap(); + + let existential_deposit = api.get_existential_deposit().await.unwrap(); + info!("Existential deposit is = {:?}", existential_deposit); + + let mut nonce = api.get_nonce().await.unwrap(); + + let amount = reasonable_native_balance(&api).await; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + for account in accounts.into_iter() { + let to = get_accountid_from_str(account); + let call = compose_call!( + api.metadata(), + "Balances", + "transfer_keep_alive", + ExtrinsicAddress::from(to.clone()), + Compact(amount) + ) + .unwrap(); + let xt: EncointerXt<_> = compose_extrinsic_offline!( + api.clone().signer().unwrap(), + call.clone(), + api.extrinsic_params(nonce) + ); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); + let _blockh = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + nonce += 1; + } + Ok(()) + }) + .into() +} +fn cmd_balance(_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 account = matches.account_arg().unwrap(); + let maybe_at = matches.at_block_arg(); + let accountid = get_accountid_from_str(account); + match matches.cid_arg() { + Some(cid_str) => { + let balance = get_community_balance(&api, cid_str, &accountid, maybe_at).await; + println! {"{balance:?}"}; + }, + None => { + if matches.all_flag() { + let community_balances = get_all_balances(&api, &accountid).await.unwrap(); + let bn = get_block_number(&api, maybe_at).await; + for b in community_balances.iter() { + let dr = get_demurrage_per_block(&api, b.0).await; + println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) + } + } + let balance = if let Some(data) = api.get_account_data(&accountid).await.unwrap() { + data.free + } else { + 0 + }; + println!("{balance}"); + }, + }; + Ok(()) + }) + .into() +} +fn cmd_issuance(_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 maybe_at = matches.at_block_arg(); + let cid_str = matches.cid_arg().expect("please supply argument --cid"); + let issuance = get_community_issuance(&api, cid_str, maybe_at).await; + println! {"{issuance:?}"}; + Ok(()) + }) + .into() +} +fn cmd_transfer(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let arg_from = matches.value_of("from").unwrap(); + let arg_to = matches.value_of("to").unwrap(); + if !matches.dryrun_flag() { + let from = get_pair_from_str(arg_from); + info!("from ss58 is {}", from.public().to_ss58check()); + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + api.set_signer(signer); + } + let to = get_accountid_from_str(arg_to); + info!("to ss58 is {}", to.to_ss58check()); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let tx_hash = match matches.cid_arg() { + Some(cid_str) => { + let cid = verify_cid(&api, cid_str, None).await; + let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) + .expect("amount can be converted to fixpoint"); + + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerBalances", + "transfer", + to.clone(), + cid, + amount + ) + .unwrap(); + if matches.dryrun_flag() { + println!("0x{}", hex::encode(xt.function.encode())); + None + } else { + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + } + }, + None => { + let amount = matches + .value_of("amount") + .unwrap() + .parse::() + .expect("amount can be converted to u128"); + // todo: use keep_alive instead https://github.com/scs/substrate-api-client/issues/747 + let xt = api.balance_transfer_allow_death(to.clone().into(), amount).await.unwrap(); + if matches.dryrun_flag() { + println!("0x{}", hex::encode(xt.function.encode())); + None + } else { + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + } + }, + }; + if let Some(txh) = tx_hash { + info!("[+] Transaction included. Hash: {:?}\n", txh); + let result = api.get_account_data(&to).await.unwrap().unwrap(); + println!("balance for {} is now {}", to, result.free); + } + Ok(()) + }) + .into() +} +fn cmd_transfer_all(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let arg_from = matches.value_of("from").unwrap(); + let arg_to = matches.value_of("to").unwrap(); + let from = get_pair_from_str(arg_from); + let to = get_accountid_from_str(arg_to); + info!("from ss58 is {}", from.public().to_ss58check()); + info!("to ss58 is {}", to.to_ss58check()); + + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + api.set_signer(signer); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let tx_hash = match matches.cid_arg() { + Some(cid_str) => { + let cid = verify_cid(&api, cid_str, None).await; + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerBalances", "transfer_all", to.clone(), cid) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() + }, + None => { + error!("No cid specified"); + std::process::exit(exit_code::NO_CID_SPECIFIED); + }, + }; + info!("[+] Transaction included. Hash: {:?}\n", tx_hash); + let result = api.get_account_data(&to).await.unwrap().unwrap(); + println!("balance for {} is now {}", to, result.free); + Ok(()) + }) + .into() +} +fn cmd_listen(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + listen(matches); + Ok(()) + }) + .into() +} +fn cmd_new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + // -----setup + let spec_file = matches.value_of("specfile").unwrap(); + let spec = read_community_spec_from_file(spec_file); + let cid = spec.community_identifier(); + + let signer = matches.signer_arg() + .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + let signer = ParentchainExtrinsicSigner::new(signer); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + + // ------- create calls for xt's + let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); + // only the first meetup location has been registered now. register all others one-by-one + let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); + let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); + + + if matches.signer_arg().is_none() { + // return calls as `OpaqueCall`s to get the same return type in both branches + (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { + let sudo_new_community = sudo_call(api.metadata(), new_community_call); + let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); + info!("Printing raw sudo calls for js/apps for cid: {}", cid); + print_raw_call("sudo(new_community)", &sudo_new_community); + print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + + (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) + + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); + let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); + print_raw_call("collective_propose(new_community)", &propose_new_community); + print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + + (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) + }; + } + + // ---- send xt's to chain + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + + send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()); + println!("{cid}"); + + if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + error!("Wrong ceremony phase for registering new locations for {}", cid); + error!("Aborting without registering additional locations"); + std::process::exit(exit_code::WRONG_PHASE); + } + send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg); + Ok(()) + + }) + .into() +} fn cmd_add_locations(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { From 12a443fea9678ada5f927d3099256341df9a6feb Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 13:07:27 +0100 Subject: [PATCH 23/41] toml cosmetics --- Cargo.lock | 10 ++++++++ Cargo.toml | 25 +++++++++---------- client/Cargo.toml | 2 +- .../encointer-api-client-extension/Cargo.toml | 4 +-- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b779f260..9aa4124a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9315,6 +9315,7 @@ dependencies = [ [[package]] name = "substrate-api-client" version = "0.17.0" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "ac-compose-macros", "ac-node-api", @@ -9363,6 +9364,7 @@ checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" [[package]] name = "substrate-client-keystore" version = "0.10.0" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "array-bytes 6.2.2", "async-trait", @@ -11112,3 +11114,11 @@ dependencies = [ "libc", "pkg-config", ] + +[[patch.unused]] +name = "substrate-api-client" +version = "0.17.0" + +[[patch.unused]] +name = "substrate-client-keystore" +version = "0.10.0" diff --git a/Cargo.toml b/Cargo.toml index 337ce250..a273dda1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,18 +11,18 @@ members = [ panic = 'unwind' [workspace.dependencies] -parity-scale-codec = { version = "3.6.5", default-features = false, features = ["derive"] } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } -serde = { features = ["derive"], version = "1.0.197" } +async-trait = "0.1.68" clap = { version = "4.5.1", features = ["derive"] } -futures = { version = "0.3.30", features = ["thread-pool"] } -log = "0.4.20" -serde_json = "1.0.114" env_logger = "0.9.0" +futures = { version = "0.3.30", features = ["thread-pool"] } geojson = "0.22.2" hex = "0.4.3" +log = "0.4.20" maybe-async = { version = "0.2.7" } -async-trait = "0.1.68" +parity-scale-codec = { version = "3.6.5", default-features = false, features = ["derive"] } +scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } +serde = { features = ["derive"], version = "1.0.197" } +serde_json = "1.0.114" tokio = { version = "1.33", features = ["rt-multi-thread", "macros", "time"] } # encointer deps @@ -117,15 +117,11 @@ substrate-frame-rpc-system = { version = "30.0.0" } substrate-wasm-builder = "19.0.0" substrate-build-script-utils = "11.0.0" -substrate-api-client = { version = "0.17.0", features = ["jsonrpsee-client"] } -substrate-client-keystore = "0.10.0" - - +substrate-api-client = { version = "0.17.0", features = ["jsonrpsee-client"], git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +substrate-client-keystore = { version = "0.10.0", git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } #only while debugging [patch.crates-io] -ac-node-api = { path = "../../substrate-api-client/node-api" } -ac-primitives = { path = "../../substrate-api-client/primitives" } 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" } @@ -145,6 +141,9 @@ 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" } +# api client +ac-node-api = { path = "../../substrate-api-client/node-api" } +ac-primitives = { path = "../../substrate-api-client/primitives" } substrate-api-client = { path = "../../substrate-api-client" } substrate-client-keystore = { path = "../../substrate-api-client/client-keystore" } diff --git a/client/Cargo.toml b/client/Cargo.toml index f5dc084c..badeb8f4 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -10,13 +10,13 @@ version = "1.5.4" clap = "2.33" clap-nested = "0.4.0" env_logger = { workspace = true } +futures = { workspace = true } geojson = { workspace = true } hex = { workspace = true } log = { workspace = true } parity-scale-codec = { workspace = true } serde_json = { workspace = true } tokio = { workspace = true } -futures = { workspace = true } # local deps encointer-api-client-extension = { path = "./encointer-api-client-extension" } diff --git a/client/encointer-api-client-extension/Cargo.toml b/client/encointer-api-client-extension/Cargo.toml index 02a3d518..9cbce709 100644 --- a/client/encointer-api-client-extension/Cargo.toml +++ b/client/encointer-api-client-extension/Cargo.toml @@ -5,13 +5,13 @@ edition = "2021" [dependencies] async-trait = { workspace = true } -maybe-async = { workspace = true } +futures = { workspace = true } log = { workspace = true } +maybe-async = { workspace = true } parity-scale-codec = { workspace = true } serde = { workspace = true, features = ["std"] } serde_json = { workspace = true } tokio = { workspace = true } -futures = { workspace = true } # encointer deps encointer-ceremonies-assignment = { workspace = true, features = ["std"] } From 780bb5c725d10f545c4d9d2a68bc0e67ea9957fc Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 13:32:51 +0100 Subject: [PATCH 24/41] lift patches --- Cargo.lock | 60 ++++++++++++++++++++++++++------- Cargo.toml | 59 ++++++++++++++++++--------------- client/Cargo.toml | 2 +- client/src/main.rs | 82 ++++++++++++++++++++-------------------------- node/Cargo.toml | 4 +-- runtime/Cargo.toml | 2 +- runtime/src/lib.rs | 2 +- 7 files changed, 123 insertions(+), 88 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9aa4124a..e5e4257c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,6 +26,7 @@ dependencies = [ [[package]] name = "ac-node-api" version = "0.6.0" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "ac-primitives", "bitvec", @@ -53,6 +54,7 @@ dependencies = [ [[package]] name = "ac-primitives" version = "0.9.1" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "frame-system", "impl-serde", @@ -2042,6 +2044,8 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251506c9355c69057c171a1bc06ad89b2666b537840bba7db35a55cc11f0df40" dependencies = [ "encointer-primitives", "frame-support", @@ -2057,6 +2061,8 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c4d938ac122c2b8587762b7f637b2a09bfef9c24f438bc6f086f37b01cd9947" dependencies = [ "encointer-balances-tx-payment-rpc-runtime-api", "encointer-primitives", @@ -2080,6 +2086,8 @@ dependencies = [ [[package]] name = "encointer-balances-tx-payment-rpc-runtime-api" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e86b74f092dcddd4db942896ccf4d4d77656215a9d81e19ca7d746256bc018a" dependencies = [ "encointer-primitives", "frame-support", @@ -2092,6 +2100,8 @@ dependencies = [ [[package]] name = "encointer-ceremonies-assignment" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "251e6d08cb28d5e9c4ef96c049473896f73ab1ca90f87b4b1ed805a0529f0259" dependencies = [ "encointer-primitives", "sp-runtime", @@ -2100,7 +2110,7 @@ dependencies = [ [[package]] name = "encointer-client-notee" -version = "1.5.4" +version = "1.8.0" dependencies = [ "clap 2.34.0", "clap-nested", @@ -2136,6 +2146,8 @@ dependencies = [ [[package]] name = "encointer-meetup-validation" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faad8c1800e6f4bddaa8504e03e0b96e89e1eb4917e4286356b4b5f628d1806e" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -2147,7 +2159,7 @@ dependencies = [ [[package]] name = "encointer-node-notee" -version = "1.5.4" +version = "1.8.0" dependencies = [ "clap 4.5.1", "encointer-balances-tx-payment-rpc", @@ -2204,7 +2216,7 @@ dependencies = [ [[package]] name = "encointer-node-notee-runtime" -version = "1.5.30" +version = "1.8.31" dependencies = [ "encointer-balances-tx-payment", "encointer-balances-tx-payment-rpc-runtime-api", @@ -2262,6 +2274,8 @@ dependencies = [ [[package]] name = "encointer-primitives" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba38a5cbbc7ab654341dd4c6ef3c52b94a15e1eb2c3937384175429443e83d3" dependencies = [ "bs58 0.5.0", "crc", @@ -2281,6 +2295,8 @@ dependencies = [ [[package]] name = "encointer-rpc" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c32d392100f7cb83e895a066cd7f925b1caec238b5ad76e1712a126348a766c" dependencies = [ "jsonrpsee", "jsonrpsee-core", @@ -2335,6 +2351,8 @@ checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" [[package]] name = "ep-core" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7711e015884f38f87267ba1348657b4cf92483ad2685e5d42c7446f08be8ecda" dependencies = [ "array-bytes 6.2.2", "impl-serde", @@ -5191,6 +5209,8 @@ dependencies = [ [[package]] name = "pallet-encointer-balances" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ec62256b1cd42994b7426749e94d58756e0dcc69d3a7fdb09480dc85ad67e62" dependencies = [ "approx", "encointer-primitives", @@ -5209,6 +5229,8 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c9aaf617cd960574b0fca15e6a63e1e94e12635eb775c31a99a7ca59b891eb" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5225,6 +5247,8 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "569c9989fe1d75ed8a13da1739eeb093c0a7a89d9d475716af0a0088e82d9d8c" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5244,6 +5268,8 @@ dependencies = [ [[package]] name = "pallet-encointer-bazaar-rpc-runtime-api" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b175dee52071e95e1cf381e902a9d446e8b63338ccf8fc70027ce65fd6238c" dependencies = [ "encointer-primitives", "frame-support", @@ -5255,6 +5281,8 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729f6823ee810fb9d170f78b7c25ea13591959b97550aa5ff42d00f8dfbeb7b" dependencies = [ "encointer-ceremonies-assignment", "encointer-meetup-validation", @@ -5279,6 +5307,8 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ef64d5a30e547670798c2b4325d380aa7ada374c50bc5816ed5e68d4d04f64" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5298,6 +5328,8 @@ dependencies = [ [[package]] name = "pallet-encointer-ceremonies-rpc-runtime-api" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e062e2c5176a1422ed0d67ab8428e785e685fc6576c550c9841f5bbae12a783f" dependencies = [ "encointer-primitives", "frame-support", @@ -5309,6 +5341,8 @@ dependencies = [ [[package]] name = "pallet-encointer-communities" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9712c7d1284e70962dba1ac2a2d2b36a747ff1cfb334f308a618ce271709c7fe" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5327,6 +5361,8 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a957dfec89f99c91743d443402dbd1b4aa349e0a42df4348d96b4d655feab6" dependencies = [ "encointer-primitives", "encointer-rpc", @@ -5347,6 +5383,8 @@ dependencies = [ [[package]] name = "pallet-encointer-communities-rpc-runtime-api" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d8a2c35e3d03360d5b4396a1c43568537654a22c06cb362f54ccd4281ddc2cb" dependencies = [ "encointer-primitives", "parity-scale-codec", @@ -5357,6 +5395,8 @@ dependencies = [ [[package]] name = "pallet-encointer-democracy" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e887b2e0901227ec3173d2b231c4a385b320eadf04a2182fe2cdb6ba03395d6" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -5380,6 +5420,8 @@ dependencies = [ [[package]] name = "pallet-encointer-faucet" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781009e5cb4895afcbc79db3b79124676fc6544a6ace2b1c62402ac0ef23e957" dependencies = [ "approx", "encointer-primitives", @@ -5400,6 +5442,8 @@ dependencies = [ [[package]] name = "pallet-encointer-reputation-commitments" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d92071eb5f4f0c7084a40291546177887a6f2bd3dc497917376f4f8b83d77e0" dependencies = [ "approx", "encointer-primitives", @@ -5421,6 +5465,8 @@ dependencies = [ [[package]] name = "pallet-encointer-scheduler" version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8b2e414fef4a80f8edf1da5692222a3f8918b3202946e12b5a6faa13f2d7381" dependencies = [ "encointer-primitives", "frame-benchmarking", @@ -11114,11 +11160,3 @@ dependencies = [ "libc", "pkg-config", ] - -[[patch.unused]] -name = "substrate-api-client" -version = "0.17.0" - -[[patch.unused]] -name = "substrate-client-keystore" -version = "0.10.0" diff --git a/Cargo.toml b/Cargo.toml index a273dda1..88ce8e6e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,35 +117,42 @@ substrate-frame-rpc-system = { version = "30.0.0" } substrate-wasm-builder = "19.0.0" substrate-build-script-utils = "11.0.0" -substrate-api-client = { version = "0.17.0", features = ["jsonrpsee-client"], git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } -substrate-client-keystore = { version = "0.10.0", git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +substrate-api-client = { version = "0.17.0", features = ["jsonrpsee-client"] } +substrate-client-keystore = { version = "0.10.0" } #only while debugging [patch.crates-io] -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" } -# api client -ac-node-api = { path = "../../substrate-api-client/node-api" } -ac-primitives = { path = "../../substrate-api-client/primitives" } -substrate-api-client = { path = "../../substrate-api-client" } -substrate-client-keystore = { path = "../../substrate-api-client/client-keystore" } +## api client +# todo: temporary patch until ^0.17.1 is released +ac-node-api = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +ac-compose-macros = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +ac-primitives = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +substrate-api-client = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +substrate-client-keystore = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +#ac-node-api = { path = "../../substrate-api-client/node-api" } +#ac-primitives = { path = "../../substrate-api-client/primitives" } +#substrate-api-client = { path = "../../substrate-api-client" } +#substrate-client-keystore = { path = "../../substrate-api-client/client-keystore" } +## 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" } # [patch."https://github.com/encointer/substrate-fixed"] # substrate-fixed = { path = "../substrate-fixed" } diff --git a/client/Cargo.toml b/client/Cargo.toml index badeb8f4..14bc6d62 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.5.4" +version = "1.8.0" [dependencies] # todo migrate to clap >=3 https://github.com/encointer/encointer-node/issues/107 diff --git a/client/src/main.rs b/client/src/main.rs index 3b72b3f4..596066ab 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -35,11 +35,11 @@ use crate::{ print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, }, }; -use clap::{value_t, AppSettings, Arg, ArgMatches, ErrorKind}; +use clap::{value_t, AppSettings, Arg, ArgMatches}; use clap_nested::{Command, Commander}; use cli_args::{EncointerArgs, EncointerArgsExtractor}; use encointer_api_client_extension::{ - Api, AttestationState, CeremoniesApi, CommunitiesApi, CommunityCurrencyTip, + Api, CeremoniesApi, CommunitiesApi, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, EncointerXt, ExtrinsicAddress, ParentchainExtrinsicSigner, SchedulerApi, ENCOINTER_CEREMONIES, }; @@ -51,9 +51,8 @@ use encointer_primitives::{ balances::{to_U64F64, Demurrage}, bazaar::{Business, BusinessIdentifier, OfferingData}, ceremonies::{ - AttestationIndexType, ClaimOfAttendance, CommunityCeremony, CommunityReputation, - MeetupIndexType, ParticipantIndexType, ProofOfAttendance, Reputation, - ReputationLifetimeType, + ClaimOfAttendance, CommunityCeremony, CommunityReputation, MeetupIndexType, + ParticipantIndexType, ProofOfAttendance, Reputation, ReputationLifetimeType, }, communities::{CidName, CommunityIdentifier}, democracy::{Proposal, ProposalAction, ProposalIdType, ReputationVec, Vote}, @@ -61,7 +60,7 @@ use encointer_primitives::{ fixed::transcendental::exp, scheduler::{CeremonyIndexType, CeremonyPhaseType}, }; -use futures::stream::{self, StreamExt, TryStreamExt}; +use futures::stream; use log::*; use pallet_transaction_payment::FeeDetails; use parity_scale_codec::{Compact, Decode, Encode}; @@ -79,7 +78,7 @@ use substrate_api_client::{ extrinsic::BalancesExtrinsics, rpc::{JsonrpseeClient, Request}, GetAccountInformation, GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, - Result as ApiResult, SubmitAndWatch, SubscribeEvents, XtStatus, + SubmitAndWatch, SubscribeEvents, XtStatus, }; use substrate_client_keystore::{KeystoreExt, LocalKeystore}; @@ -660,7 +659,7 @@ fn cmd_new_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Er println!("{}", key.to_ss58check()); Ok(()) } -fn cmd_list_accounts(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { +fn cmd_list_accounts(_args: &str, _matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); info!("sr25519 keys:"); for pubkey in store.public_keys::().unwrap().into_iter() { @@ -790,7 +789,7 @@ fn cmd_transfer(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) .expect("amount can be converted to fixpoint"); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!( api, @@ -875,7 +874,7 @@ fn cmd_transfer_all(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::E fn cmd_listen(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { - listen(matches); + listen(matches).await; Ok(()) }) .into() @@ -928,9 +927,9 @@ fn cmd_new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:: // ---- send xt's to chain let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()); + send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()).await; println!("{cid}"); if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { @@ -938,7 +937,7 @@ fn cmd_new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:: error!("Aborting without registering additional locations"); std::process::exit(exit_code::WRONG_PHASE); } - send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg); + send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg).await; Ok(()) }) @@ -1102,9 +1101,9 @@ fn cmd_next_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Err }; let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg); + send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg).await; let phase = api.get_current_phase().await.unwrap(); println!("Phase is now: {phase:?}"); @@ -1351,7 +1350,7 @@ fn cmd_upgrade_registration(_args: &str, matches: &ArgMatches<'_>) -> Result<(), api.set_signer(signer); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!(api, "EncointerCeremonies", "upgrade_registration", cid, proof) @@ -1403,7 +1402,7 @@ fn cmd_register_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), api.set_signer(signer); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!(api, "EncointerCeremonies", "register_participant", cid, proof) @@ -1451,7 +1450,7 @@ fn cmd_unregister_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<( api.set_signer(signer); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!(api, "EncointerCeremonies", "unregister_participant", cid, cc) @@ -1548,7 +1547,7 @@ fn cmd_attest_attendees(_args: &str, matches: &ArgMatches<'_>) -> Result<(), cla api.set_signer(signer); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let cid = verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; @@ -1606,7 +1605,7 @@ fn cmd_claim_reward(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::E let tx_payment_cid_arg = matches.tx_payment_cid_arg(); let meetup_index_arg = matches.meetup_index_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; if matches.all_flag() { let mut cindex = get_ceremony_index(&api, None).await; @@ -1631,7 +1630,7 @@ fn cmd_claim_reward(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::E }) .collect(); let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); - send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg); + send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg).await; println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); } else { let meetup_index = meetup_index_arg; @@ -1772,9 +1771,9 @@ fn cmd_set_meetup_time_offset(_args: &str, matches: &ArgMatches<'_>) -> Result<( }; let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt = xt(&api, privileged_call).await; - send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg); + send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg).await; Ok(()) }) .into() @@ -1824,7 +1823,7 @@ fn cmd_purge_community_ceremony(_args: &str, matches: &ArgMatches<'_>) -> Result ); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!(api, "Sudo", "sudo", batch_call).unwrap(); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); @@ -1858,7 +1857,7 @@ fn cmd_create_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:: let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!( api, @@ -1914,7 +1913,7 @@ fn cmd_drip_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Er let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!(api, "EncointerFaucet", "drip", faucet_account, cid, cindex) @@ -1979,9 +1978,10 @@ fn cmd_dissolve_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap }; let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call).await, tx_payment_cid_arg); + send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call).await, tx_payment_cid_arg) + .await; println!("Faucet dissolved: {faucet_account:?}"); Ok(()) @@ -1999,7 +1999,7 @@ fn cmd_close_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::E let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!(api, "EncointerFaucet", "close_faucet", faucet_account.clone()) @@ -2048,13 +2048,14 @@ fn cmd_set_faucet_reserve_amount(_args: &str, matches: &ArgMatches<'_>) -> Resul }; let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; send_and_wait_for_in_block( &api, xt(&api, set_reserve_amount_call).await, tx_payment_cid_arg, - ); + ) + .await; println!("Reserve amount set: {reserve_amount:?}"); Ok(()) @@ -2129,7 +2130,7 @@ fn cmd_submit_set_inactivity_timeout_proposal( api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone()))); let inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!( api, @@ -2214,7 +2215,7 @@ fn cmd_vote(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let reputation_bvec = ReputationVec::>::try_from(reputation_vec); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!( api, "EncointerDemocracy", @@ -2386,17 +2387,6 @@ async fn listen(matches: &ArgMatches<'_>) { } } -/// Extracts api and cid from `matches` and execute the given `closure` with them. -async fn extract_and_execute( - matches: &ArgMatches<'_>, - closure: impl FnOnce(Api, CommunityIdentifier) -> T, -) -> T { - let api = get_chain_api(matches).await; - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - closure(api, cid) -} - async fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { let cids = get_community_identifiers(api, maybe_at).await.expect("no community registered"); let cid = CommunityIdentifier::from_str(cid).unwrap(); @@ -2731,7 +2721,7 @@ async fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> let ipfs_cid = matches.ipfs_cid_arg().expect("ipfs cid needed"); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; let xt: EncointerXt<_> = compose_extrinsic!(api, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid) .unwrap(); @@ -2760,7 +2750,7 @@ async fn endorse_newcomers( let mut nonce = api.get_nonce().await?; let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(api, tx_payment_cid_arg); + set_api_extrisic_params_builder(api, tx_payment_cid_arg).await; for e in endorsees.into_iter() { let endorsee = get_accountid_from_str(e); diff --git a/node/Cargo.toml b/node/Cargo.toml index e8d86117..cd662c2e 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -8,10 +8,10 @@ license = "GPL-3.0" name = "encointer-node-notee" repository = "https://github.com/encointer/encointer-node" # Note the following for the versioning: -# * Align minor version with the runtime. +# * 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.5.4" +version = "1.8.0" [[bin]] name = "encointer-node-notee" diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 2e780ac1..3058be20 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.5.30" +version = "1.8.31" [dependencies] parity-scale-codec = { workspace = true } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 60b6fdce..06d75e88 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -134,7 +134,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: 30, + spec_version: 31, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 5, From af4952762db7ad96d7ac930ba3f1b3bee2c79cb6 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 14:28:26 +0100 Subject: [PATCH 25/41] molularize commands --- Cargo.lock | 3 +- client/src/commands/encointer_bazaar.rs | 74 + client/src/commands/encointer_ceremonies.rs | 688 +++++++ client/src/commands/encointer_communities.rs | 194 ++ client/src/commands/encointer_core.rs | 246 +++ client/src/commands/encointer_democracy.rs | 151 ++ client/src/commands/encointer_faucet.rs | 310 ++++ client/src/commands/frame.rs | 65 + client/src/commands/keystore.rs | 40 + client/src/commands/mod.rs | 8 + client/src/main.rs | 1742 +----------------- 11 files changed, 1845 insertions(+), 1676 deletions(-) create mode 100644 client/src/commands/encointer_bazaar.rs create mode 100644 client/src/commands/encointer_ceremonies.rs create mode 100644 client/src/commands/encointer_communities.rs create mode 100644 client/src/commands/encointer_core.rs create mode 100644 client/src/commands/encointer_democracy.rs create mode 100644 client/src/commands/encointer_faucet.rs create mode 100644 client/src/commands/frame.rs create mode 100644 client/src/commands/keystore.rs create mode 100644 client/src/commands/mod.rs diff --git a/Cargo.lock b/Cargo.lock index e5e4257c..566b03df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,8 +15,7 @@ dependencies = [ [[package]] name = "ac-compose-macros" version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd62974353f0e96a110d08b59b670bf6b3af6095da1d1d410687c456546d302" +source = "git+https://github.com/brenzi/substrate-api-client.git?branch=crates-io-v0.17.0-patch-for-stable#cb238d79dc46a303a2958c0897a6d67b2eb80175" dependencies = [ "ac-primitives", "log", diff --git a/client/src/commands/encointer_bazaar.rs b/client/src/commands/encointer_bazaar.rs new file mode 100644 index 00000000..f0da6c88 --- /dev/null +++ b/client/src/commands/encointer_bazaar.rs @@ -0,0 +1,74 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::utils::keys::get_accountid_from_str; +use crate::{ + get_businesses, get_chain_api, get_offerings, get_offerings_for_business, send_bazaar_xt, + verify_cid, BazaarCalls, +}; +use clap::ArgMatches; +use encointer_api_client_extension::ExtrinsicAddress; + +pub fn create_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).await.unwrap(); + Ok(()) + }) + .into() +} +pub fn update_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).await.unwrap(); + Ok(()) + }) + .into() +} +pub fn create_offering(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + send_bazaar_xt(matches, &BazaarCalls::CreateOffering).await.unwrap(); + Ok(()) + }) + .into() +} +pub fn list_businesses(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let businesses = get_businesses(&api, cid).await.unwrap(); + // only print plain businesses to be able to parse them in python scripts + println!("{businesses:?}"); + Ok(()) + }) + .into() +} +pub fn list_offerings(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let offerings = get_offerings(&api, cid).await.unwrap(); + // only print plain offerings to be able to parse them in python scripts + println!("{offerings:?}"); + Ok(()) + }) + .into() +} + +pub fn list_business_offerings(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let account = matches.account_arg().map(get_accountid_from_str).unwrap(); + let api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let offerings = get_offerings_for_business(&api, cid, account).await.unwrap(); + // only print plain offerings to be able to parse them in python scripts + println!("{offerings:?}"); + Ok(()) + }) + .into() +} diff --git a/client/src/commands/encointer_ceremonies.rs b/client/src/commands/encointer_ceremonies.rs new file mode 100644 index 00000000..c3b096f3 --- /dev/null +++ b/client/src/commands/encointer_ceremonies.rs @@ -0,0 +1,688 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; +use crate::utils::{ + collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, + into_effective_cindex, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +}; +use crate::{ + endorse_newcomers, exit_code, get_attendees_for_community_ceremony, + get_bootstrappers_with_remaining_newbie_tickets, get_ceremony_index, get_chain_api, + get_cid_names, get_reputation, get_reputation_history, get_reputation_lifetime, new_claim_for, + prove_attendance, set_api_extrisic_params_builder, verify_cid, BootstrapperWithTickets, +}; +use clap::ArgMatches; +use encointer_api_client_extension::CeremoniesApi; +use encointer_api_client_extension::SchedulerApi; +use encointer_api_client_extension::{ + EncointerXt, ParentchainExtrinsicSigner, ENCOINTER_CEREMONIES, +}; +use encointer_node_notee_runtime::AccountId; +use encointer_primitives::ceremonies::{MeetupIndexType, ParticipantIndexType, Reputation}; +use encointer_primitives::scheduler::CeremonyPhaseType; +use log::{debug, error, info}; +use parity_scale_codec::Encode; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use sp_keyring::AccountKeyring; +use std::collections::HashMap; +use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; +use substrate_api_client::ac_primitives::SignExtrinsic; +use substrate_api_client::GetStorage; +use substrate_api_client::{SubmitAndWatch, XtStatus}; + +pub fn list_participants(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + println!("listing participants for cid {cid} and ceremony nr {cindex}"); + + let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; + + let registries = + vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; + + let mut num_participants: Vec = vec![0, 0, 0, 0]; + for i in 0..registries.len() { + println!("Querying {}", registries[i]); + + let count: ParticipantIndexType = api + .get_storage_map(ENCOINTER_CEREMONIES, counts[i], (cid, cindex), None) + .await + .unwrap() + .unwrap_or(0); + println!("number of participants assigned: {count}"); + num_participants[i] = count; + for p_index in 1..count + 1 { + let accountid: AccountId = api + .get_storage_double_map( + ENCOINTER_CEREMONIES, + registries[i], + (cid, cindex), + p_index, + None, + ) + .await + .unwrap() + .unwrap(); + println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); + } + } + println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", + num_participants[0..=2].iter().sum::(), + num_participants[3], + num_participants[0..=3].iter().sum::() + ); + Ok(()) + }) + .into() +} +pub fn list_meetups(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + println!("listing meetups for cid {cid} and ceremony nr {cindex}"); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + let mut num_assignees = 0u64; + + for meetup in stats.meetups.iter() { + println!( + "MeetupRegistry[{:?}, {}] location is {:?}, {:?}", + &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon + ); + + println!( + "MeetupRegistry[{:?}, {}] meeting time is {:?}", + &community_ceremony, meetup.index, meetup.time + ); + + if !meetup.registrations.is_empty() { + let num = meetup.registrations.len(); + num_assignees += num as u64; + println!( + "MeetupRegistry[{:?}, {}] participants: {}", + &community_ceremony, meetup.index, num + ); + for (participant, _registration) in meetup.registrations.iter() { + println!(" {participant}"); + } + } else { + println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); + } + } + println!("total number of assignees: {num_assignees}"); + Ok(()) + }) + .into() +} + +pub fn print_ceremony_stats(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + // serialization prints the the account id better than `debug` + println!("{}", serde_json::to_string_pretty(&stats).unwrap()); + Ok(()) + }) + .into() +} +pub fn list_attestees(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex = matches.ceremony_index_arg().map_or_else( + || current_ceremony_index, + |ci| into_effective_cindex(ci, current_ceremony_index), + ); + + let community_ceremony = (cid, cindex); + + let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); + + // serialization prints the the account id better than `debug` + println!("{}", serde_json::to_string_pretty(&stats).unwrap()); + Ok(()) + }) + .into() +} +pub fn list_reputables(_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 is_verbose = matches.verbose_flag(); + let at_block = matches.at_block_arg(); + + let lifetime = get_reputation_lifetime(&api, at_block).await; + let current_ceremony_index = get_ceremony_index(&api, at_block).await; + + + let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); + let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); + + let community_ids = get_cid_names(&api).await.unwrap().into_iter().map(|names| names.cid); + + let mut reputables_csv = Vec::new(); + + println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); + for community_id in community_ids { + println!("Community ID: {community_id:?}"); + let mut reputables: HashMap = HashMap::new(); + for ceremony_index in &ceremony_indices { + let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block).await; + println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); + for attendee in attendees { + reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); + *reputables.entry(attendee.clone()).or_insert(0) += 1; + } + } + println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); + } + if is_verbose { + for reputable in reputables_csv { + println!("{reputable}"); + } + } + Ok(()) + + }) + .into() +} +pub fn upgrade_registration(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + let cindex = get_ceremony_index(&api, None).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering + || current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for registering participant"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut reputation_cindex = cindex; + if current_phase == CeremonyPhaseType::Registering { + reputation_cindex -= 1; + } + let rep = get_reputation(&api, &accountid, cid, reputation_cindex).await; + info!("{} has reputation {:?}", accountid, rep); + let proof = match rep { + Reputation::VerifiedUnlinked => { + prove_attendance(accountid, cid, reputation_cindex, arg_who) + }, + _ => { + error!("No valid reputation in last ceremony."); + std::process::exit(exit_code::INVALID_REPUTATION); + }, + }; + + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + 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, "EncointerCeremonies", "upgrade_registration", cid, proof) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +pub fn register_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + let cindex = get_ceremony_index(&api, None).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let rep = get_reputation(&api, &accountid, cid, cindex - 1).await; + info!("{} has reputation {:?}", accountid, rep); + let proof = match rep { + Reputation::Unverified => None, + Reputation::UnverifiedReputable => None, // this should never be the case during Registering! + Reputation::VerifiedUnlinked => { + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) + }, + Reputation::VerifiedLinked(_) => { + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) + }, + }; + debug!("proof: {:x?}", proof.encode()); + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering + || current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for registering participant"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + 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, "EncointerCeremonies", "register_participant", cid, proof) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +pub fn unregister_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => get_pair_from_str(arg_who), + }; + + let api = get_chain_api(matches).await; + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let cc = match matches.ceremony_index_arg() { + Some(cindex_arg) => { + let current_ceremony_index = get_ceremony_index(&api, None).await; + let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + Some((cid, cindex)) + }, + None => None, + }; + + let current_phase = api.get_current_phase().await.unwrap(); + if !(current_phase == CeremonyPhaseType::Registering + || current_phase == CeremonyPhaseType::Attesting) + { + error!("wrong ceremony phase for unregistering"); + std::process::exit(exit_code::WRONG_PHASE); + } + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer); + + 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, "EncointerCeremonies", "unregister_participant", cid, cc) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // Send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); + Ok(()) + }) + .into() +} +pub fn endorse(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + endorse_newcomers(&mut api, cid, matches).await.unwrap(); + + Ok(()) + }) + .into() +} +pub fn bootstrappers_with_remaining_newbie_tickets( + _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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let bs_with_tickets: Vec = + get_bootstrappers_with_remaining_newbie_tickets(&api, cid).await.unwrap(); + + info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); + + // transform it to simple tuples, which is easier to parse in python + let bt_vec = bs_with_tickets + .into_iter() + .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)) + .collect::>(); + + println!("{bt_vec:?}"); + Ok(()) + }) + .into() +} +pub fn get_proof_of_attendance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let arg_who = matches.account_arg().unwrap(); + let accountid = get_accountid_from_str(arg_who); + let api = get_chain_api(matches).await; + + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); + let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + debug!("Getting proof for ceremony index: {:?}", cindex); + let proof = prove_attendance(accountid, cid, cindex, arg_who); + info!("Proof: {:?}\n", &proof); + println!("0x{}", hex::encode(proof.encode())); + + Ok(()) + }) + .into() +} +pub fn attest_attendees(_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 attestees: Vec<_> = matches + .attestees_arg() + .unwrap() + .into_iter() + .map(get_accountid_from_str) + .collect(); + + let vote = attestees.len() as u32 + 1u32; + + debug!("attestees: {:?}", attestees); + + info!("send attest_attendees by {}", who.public()); + + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); + api.set_signer(signer); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerCeremonies", + "attest_attendees", + cid, + vote, + attestees + ) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + + println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); + Ok(()) + }) + .into() +} +pub fn new_claim(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let arg_who = matches.account_arg().unwrap(); + let claimant = get_pair_from_str(arg_who); + + let n_participants = matches.value_of("vote").unwrap().parse::().unwrap(); + + let claim = new_claim_for(&api, &claimant.into(), cid, n_participants).await; + + println!("{}", hex::encode(claim)); + + Ok(()) + }) + .into() +} +pub fn claim_reward(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let signer = match matches.signer_arg() { + Some(sig) => get_pair_from_str(sig), + None => panic!("please specify --signer."), + }; + let mut api = api; + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); + api.set_signer(signer.clone()); + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let meetup_index_arg = matches.meetup_index_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + if matches.all_flag() { + let mut cindex = get_ceremony_index(&api, None).await; + if api.get_current_phase().await.unwrap() == CeremonyPhaseType::Registering { + cindex -= 1; + } + let meetup_count = api + .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None) + .await + .unwrap() + .unwrap_or(0u64); + let calls: Vec<_> = (1u64..=meetup_count) + .map(|idx| { + compose_call!( + api.metadata(), + ENCOINTER_CEREMONIES, + "claim_rewards", + cid, + Option::::Some(idx) + ) + .unwrap() + }) + .collect(); + let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); + send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg).await; + println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); + } else { + let meetup_index = meetup_index_arg; + let xt: EncointerXt<_> = + compose_extrinsic!(api, ENCOINTER_CEREMONIES, "claim_rewards", cid, meetup_index) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + match meetup_index_arg { + Some(idx) => { + println!( + "Claiming reward for meetup_index {idx}. xt-status: '{:?}'", + report.status + ); + }, + None => { + println!( + "Claiming reward for {}. xt-status: 'ready'", + signer.public_account_id() + ); + }, + } + } + Ok(()) + }) + .into() +} +pub fn reputation(_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 account = matches.account_arg().unwrap(); + let account_id = get_accountid_from_str(account); + if let Some(reputation) = get_reputation_history(&api, &account_id).await { + for rep in reputation.iter() { + println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); + } + } else { + error!("could not fetch reputation over rpc"); + std::process::exit(exit_code::RPC_ERROR); + } + Ok(()) + }) + .into() +} + +pub fn set_meetup_time_offset(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); + api.set_signer(signer); + let time_offset = matches.time_offset_arg().unwrap_or(0); + let call = compose_call!( + api.metadata(), + "EncointerCeremonies", + "set_meetup_time_offset", + time_offset + ) + .unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let privileged_call = if contains_sudo_pallet(api.metadata()) { + let sudo_call = sudo_call(api.metadata(), call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(...)", &sudo_call); + OpaqueCall::from_tuple(&sudo_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_call = collective_propose_call(api.metadata(), threshold, call); + print_raw_call("collective_propose(...)", &propose_call); + OpaqueCall::from_tuple(&propose_call) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + let xt = xt(&api, privileged_call).await; + send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg).await; + Ok(()) + }) + .into() +} + +pub fn purge_community_ceremony(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let sudoer = AccountKeyring::Alice.pair(); + let signer = ParentchainExtrinsicSigner::new(sudoer); + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let current_ceremony_index = get_ceremony_index(&api, None).await; + + let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); + let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); + + let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); + let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); + + if from_cindex > to_cindex { + panic!("'from' <= 'to' ceremony index violated"); + } + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); + + let calls: Vec<_> = (from_cindex..=to_cindex) + .map(|idx| { + compose_call!( + api.metadata(), + "EncointerCeremonies", + "purge_community_ceremony", + (cid, idx) + ) + .unwrap() + }) + .collect(); + let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); + let unsigned_sudo_call = + compose_call!(api.metadata(), "Sudo", "sudo", batch_call.clone()).unwrap(); + info!( + "raw sudo batch call to sign with js/apps {}: 0x{}", + cid, + hex::encode(unsigned_sudo_call.encode()) + ); + + 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, "Sudo", "sudo", batch_call).unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); + info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); + Ok(()) + }) + .into() +} diff --git a/client/src/commands/encointer_communities.rs b/client/src/commands/encointer_communities.rs new file mode 100644 index 00000000..6c55609d --- /dev/null +++ b/client/src/commands/encointer_communities.rs @@ -0,0 +1,194 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::community_spec::CommunitySpec; +use crate::community_spec::{ + add_location_call, new_community_call, read_community_spec_from_file, AddLocationCall, +}; +use crate::utils::keys::get_pair_from_str; +use crate::utils::{ + batch_call, collective_propose_call, contains_sudo_pallet, get_councillors, print_raw_call, + send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +}; +use crate::{exit_code, get_chain_api, get_cid_names, set_api_extrisic_params_builder, verify_cid}; +use clap::ArgMatches; +use encointer_api_client_extension::CommunitiesApi; +use encointer_api_client_extension::ParentchainExtrinsicSigner; +use encointer_api_client_extension::SchedulerApi; +use encointer_primitives::scheduler::CeremonyPhaseType; +use log::{error, info}; +use parity_scale_codec::{Compact, Decode, Encode}; +use sp_application_crypto::Ss58Codec; +use sp_core::Pair; +use sp_keyring::AccountKeyring; +use substrate_api_client::ac_primitives::SignExtrinsic; +use substrate_api_client::GetStorage; + +pub fn new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + // -----setup + let spec_file = matches.value_of("specfile").unwrap(); + let spec = read_community_spec_from_file(spec_file); + let cid = spec.community_identifier(); + + let signer = matches.signer_arg() + .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + let signer = ParentchainExtrinsicSigner::new(signer); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + + // ------- create calls for xt's + let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); + // only the first meetup location has been registered now. register all others one-by-one + let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); + let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); + + + if matches.signer_arg().is_none() { + // return calls as `OpaqueCall`s to get the same return type in both branches + (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { + let sudo_new_community = sudo_call(api.metadata(), new_community_call); + let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); + info!("Printing raw sudo calls for js/apps for cid: {}", cid); + print_raw_call("sudo(new_community)", &sudo_new_community); + print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + + (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) + + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); + let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); + print_raw_call("collective_propose(new_community)", &propose_new_community); + print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + + (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) + }; + } + + // ---- send xt's to chain + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()).await; + println!("{cid}"); + + if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + error!("Wrong ceremony phase for registering new locations for {}", cid); + error!("Aborting without registering additional locations"); + std::process::exit(exit_code::WRONG_PHASE); + } + send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg).await; + Ok(()) + + }) + .into() +} +pub fn add_locations(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + // -----setup + let spec_file = matches.value_of("specfile").unwrap(); + let spec = read_community_spec_from_file(spec_file); + + let mut api = get_chain_api(matches).await; + if !matches.dryrun_flag() { + let signer = matches.signer_arg() + .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); + info!("signer ss58 is {}", signer.public().to_ss58check()); + let signer = ParentchainExtrinsicSigner::new(signer); + api.set_signer(signer); + } + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + + let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; + + let add_location_calls: Vec= spec.locations().into_iter().map(|l| + { + info!("adding location {:?}", l); + add_location_call(api.metadata(), cid, l) + } + ).collect(); + + let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { + [call] => OpaqueCall::from_tuple(call), + _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) + }; + + if matches.signer_arg().is_none() { + // return calls as `OpaqueCall`s to get the same return type in both branches + add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { + let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); + info!("Printing raw sudo calls for js/apps for cid: {}", cid); + print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); + OpaqueCall::from_tuple(&sudo_add_location_batch) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); + let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); + print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); + OpaqueCall::from_tuple(&propose_add_location_batch) + }; + } + + if matches.dryrun_flag() { + println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); + } else { + // ---- send xt's to chain + if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { + error!("Wrong ceremony phase for registering new locations for {}", cid); + error!("Aborting without registering additional locations"); + std::process::exit(exit_code::WRONG_PHASE); + } + send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call).await, tx_payment_cid_arg).await; + } + Ok(()) + + }) + .into() +} +pub fn list_communities(_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 names = get_cid_names(&api).await.unwrap(); + println!("number of communities: {}", names.len()); + for n in names.iter() { + let loc = api.get_locations(n.cid).await.unwrap(); + println!( + "{}: {} locations: {}", + n.cid, + String::from_utf8(n.name.to_vec()).unwrap(), + loc.len() + ); + } + Ok(()) + }) + .into() +} +pub fn list_locations(_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 maybe_at = matches.at_block_arg(); + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), maybe_at) + .await; + println!("listing locations for cid {cid}"); + let loc = api.get_locations(cid).await.unwrap(); + for l in loc.iter() { + println!( + "lat: {} lon: {} (raw lat: {} lon: {})", + l.lat, + l.lon, + i128::decode(&mut l.lat.encode().as_slice()).unwrap(), + i128::decode(&mut l.lon.encode().as_slice()).unwrap() + ); + } + Ok(()) + }) + .into() +} diff --git a/client/src/commands/encointer_core.rs b/client/src/commands/encointer_core.rs new file mode 100644 index 00000000..61359dcd --- /dev/null +++ b/client/src/commands/encointer_core.rs @@ -0,0 +1,246 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; +use crate::utils::{ + collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, print_raw_call, + send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +}; +use crate::{ + apply_demurrage, exit_code, get_all_balances, get_block_number, get_ceremony_index, + get_chain_api, get_community_balance, get_community_issuance, get_demurrage_per_block, listen, + set_api_extrisic_params_builder, verify_cid, +}; +use clap::ArgMatches; +use encointer_api_client_extension::SchedulerApi; +use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; +use encointer_node_notee_runtime::Moment; +use encointer_primitives::balances::BalanceType; +use log::{debug, error, info}; +use parity_scale_codec::{Compact, Decode, Encode}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use sp_keyring::AccountKeyring; +use std::str::FromStr; +use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; +use substrate_api_client::extrinsic::BalancesExtrinsics; +use substrate_api_client::GetAccountInformation; +use substrate_api_client::SubmitAndWatch; +use substrate_api_client::XtStatus; + +pub fn balance(_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 account = matches.account_arg().unwrap(); + let maybe_at = matches.at_block_arg(); + let accountid = get_accountid_from_str(account); + match matches.cid_arg() { + Some(cid_str) => { + let balance = get_community_balance(&api, cid_str, &accountid, maybe_at).await; + println! {"{balance:?}"}; + }, + None => { + if matches.all_flag() { + let community_balances = get_all_balances(&api, &accountid).await.unwrap(); + let bn = get_block_number(&api, maybe_at).await; + for b in community_balances.iter() { + let dr = get_demurrage_per_block(&api, b.0).await; + println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) + } + } + let balance = if let Some(data) = api.get_account_data(&accountid).await.unwrap() { + data.free + } else { + 0 + }; + println!("{balance}"); + }, + }; + Ok(()) + }) + .into() +} +pub fn issuance(_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 maybe_at = matches.at_block_arg(); + let cid_str = matches.cid_arg().expect("please supply argument --cid"); + let issuance = get_community_issuance(&api, cid_str, maybe_at).await; + println! {"{issuance:?}"}; + Ok(()) + }) + .into() +} +pub fn transfer(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let arg_from = matches.value_of("from").unwrap(); + let arg_to = matches.value_of("to").unwrap(); + if !matches.dryrun_flag() { + let from = get_pair_from_str(arg_from); + info!("from ss58 is {}", from.public().to_ss58check()); + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + api.set_signer(signer); + } + let to = get_accountid_from_str(arg_to); + info!("to ss58 is {}", to.to_ss58check()); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let tx_hash = match matches.cid_arg() { + Some(cid_str) => { + let cid = verify_cid(&api, cid_str, None).await; + let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) + .expect("amount can be converted to fixpoint"); + + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = compose_extrinsic!( + api, + "EncointerBalances", + "transfer", + to.clone(), + cid, + amount + ) + .unwrap(); + if matches.dryrun_flag() { + println!("0x{}", hex::encode(xt.function.encode())); + None + } else { + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + } + }, + None => { + let amount = matches + .value_of("amount") + .unwrap() + .parse::() + .expect("amount can be converted to u128"); + // todo: use keep_alive instead https://github.com/scs/substrate-api-client/issues/747 + let xt = api.balance_transfer_allow_death(to.clone().into(), amount).await.unwrap(); + if matches.dryrun_flag() { + println!("0x{}", hex::encode(xt.function.encode())); + None + } else { + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) + } + }, + }; + if let Some(txh) = tx_hash { + info!("[+] Transaction included. Hash: {:?}\n", txh); + let result = api.get_account_data(&to).await.unwrap().unwrap(); + println!("balance for {} is now {}", to, result.free); + } + Ok(()) + }) + .into() +} +pub fn transfer_all(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + let arg_from = matches.value_of("from").unwrap(); + let arg_to = matches.value_of("to").unwrap(); + let from = get_pair_from_str(arg_from); + let to = get_accountid_from_str(arg_to); + info!("from ss58 is {}", from.public().to_ss58check()); + info!("to ss58 is {}", to.to_ss58check()); + + let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); + api.set_signer(signer); + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + let tx_hash = match matches.cid_arg() { + Some(cid_str) => { + let cid = verify_cid(&api, cid_str, None).await; + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + let xt: EncointerXt<_> = + compose_extrinsic!(api, "EncointerBalances", "transfer_all", to.clone(), cid) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() + }, + None => { + error!("No cid specified"); + std::process::exit(exit_code::NO_CID_SPECIFIED); + }, + }; + info!("[+] Transaction included. Hash: {:?}\n", tx_hash); + let result = api.get_account_data(&to).await.unwrap().unwrap(); + println!("balance for {} is now {}", to, result.free); + Ok(()) + }) + .into() +} +pub fn listen_to_events(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + listen(matches).await; + Ok(()) + }) + .into() +} + +pub fn get_phase(_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; + + // >>>> add some debug info as well + let bn = get_block_number(&api, None).await; + debug!("block number: {}", bn); + let cindex = get_ceremony_index(&api, None).await; + info!("ceremony index: {}", cindex); + let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); + debug!("next phase timestamp: {}", tnext); + // <<<< + + let phase = api.get_current_phase().await.unwrap(); + println!("{phase:?}"); + Ok(()) + }) + .into() +} +pub fn next_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(signer); + api.set_signer(signer); + let next_phase_call = + compose_call!(api.metadata(), "EncointerScheduler", "next_phase").unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let next_phase_call = if contains_sudo_pallet(api.metadata()) { + let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(next_phase)", &sudo_next_phase_call); + + OpaqueCall::from_tuple(&sudo_next_phase_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_next_phase = + collective_propose_call(api.metadata(), threshold, next_phase_call); + print_raw_call("collective_propose(next_phase)", &propose_next_phase); + + OpaqueCall::from_tuple(&propose_next_phase) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg).await; + + let phase = api.get_current_phase().await.unwrap(); + println!("Phase is now: {phase:?}"); + Ok(()) + }) + .into() +} diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs new file mode 100644 index 00000000..cfbeadc8 --- /dev/null +++ b/client/src/commands/encointer_democracy.rs @@ -0,0 +1,151 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::utils::ensure_payment; +use crate::utils::keys::get_pair_from_str; +use crate::{get_chain_api, set_api_extrisic_params_builder, verify_cid}; +use clap::ArgMatches; +use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; +use encointer_node_notee_runtime::BlockNumber; +use encointer_primitives::ceremonies::{CeremonyIndexType, CommunityCeremony}; +use encointer_primitives::democracy::ProposalAction; +use encointer_primitives::democracy::{Proposal, ProposalIdType, ReputationVec, Vote}; +use log::error; +use parity_scale_codec::{Compact, Decode, Encode}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use substrate_api_client::ac_compose_macros::compose_extrinsic; +use substrate_api_client::GetStorage; +use substrate_api_client::SubmitAndWatch; +use substrate_api_client::XtStatus; + +pub fn submit_set_inactivity_timeout_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 inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); + 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::SetInactivityTimeout(inactivity_timeout) + ) + .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: Set inactivity timeout to {inactivity_timeout:?}"); + Ok(()) + }) + .into() +} +pub fn list_proposals(_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 at_block = matches.at_block_arg(); + let key_prefix = + api.get_storage_map_key_prefix("EncointerDemocracy", "Proposals").await.unwrap(); + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + 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 = + api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + println!("id: {}", proposal_id); + println!("action: {:?}", proposal.action); + println!("start block: {}", proposal.start); + println!("start cindex: {}", proposal.start_cindex); + println!("state: {:?}", proposal.state); + println!(""); + } + Ok(()) + }) + .into() +} +pub fn vote(_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 proposal_id = matches.proposal_id_arg().unwrap(); + let vote_raw = matches.vote_arg().unwrap(); + let vote = match vote_raw { + "aye" => Vote::Aye, + "nay" => Vote::Nay, + &_ => panic!("invalid vote"), + }; + let reputation_vec: Vec = futures::future::join_all( + matches + .reputation_vec_arg() + .ok_or(clap::Error::with_description( + "missing reputation-vec argument", + clap::ErrorKind::MissingRequiredArgument, + ))? + .into_iter() + .map(|rep| { + let api_local = api.clone(); + async move { + let cc: Vec<_> = rep.split("_").collect(); + ( + verify_cid(&api_local, cc[0], None).await, + cc[1].parse::().unwrap(), + ) + } + }), + ) + .await; + let reputation_bvec = ReputationVec::>::try_from(reputation_vec); + + 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", + "vote", + proposal_id, + vote, + reputation_bvec + ) + .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!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); + Ok(()) + }) + .into() +} + +pub fn update_proposal_state(_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 proposal_id = matches.proposal_id_arg().unwrap(); + 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", "update_proposal_state", proposal_id) + .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 state updated for proposal {proposal_id:?}"); + Ok(()) + }) + .into() +} diff --git a/client/src/commands/encointer_faucet.rs b/client/src/commands/encointer_faucet.rs new file mode 100644 index 00000000..e7eb1786 --- /dev/null +++ b/client/src/commands/encointer_faucet.rs @@ -0,0 +1,310 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; +use crate::utils::{ + collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, print_raw_call, + send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +}; +use crate::{get_chain_api, set_api_extrisic_params_builder, verify_cid}; +use clap::ArgMatches; +use encointer_api_client_extension::ExtrinsicAddress; +use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; +use encointer_node_notee_runtime::{AccountId, Balance}; +use encointer_primitives::faucet::FromStr; +use encointer_primitives::faucet::{Faucet, FaucetNameType, WhiteListType}; +use log::{error, info}; +use parity_scale_codec::{Compact, Decode, Encode}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use sp_keyring::AccountKeyring; +use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; +use substrate_api_client::GetAccountInformation; +use substrate_api_client::GetStorage; +use substrate_api_client::SubmitAndWatch; +use substrate_api_client::XtStatus; + +pub fn create_faucet(_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 faucet_name_raw = matches.faucet_name_arg().unwrap(); + let faucet_balance = matches.faucet_balance_arg().unwrap(); + let drip_amount = matches.faucet_drip_amount_arg().unwrap(); + + let api2 = api.clone(); + let whitelist = futures::future::join_all(matches.whitelist_arg().map(|wl| async move { + let whitelist_vec: Vec<_> = futures::future::join_all(wl.into_iter().map(|c| { + let api_local = api2.clone(); + async move { verify_cid(&api_local, c, None).await } + })) + .await; + WhiteListType::try_from(whitelist_vec).unwrap() + })) + .await; + + let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); + 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, + "EncointerFaucet", + "create_faucet", + faucet_name, + faucet_balance, + whitelist, + drip_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; + + match result { + Ok(report) => { + for event in report.events.unwrap().iter() { + if event.pallet_name() == "EncointerFaucet" + && event.variant_name() == "FaucetCreated" + { + println!( + "{}", + AccountId::decode(&mut event.field_bytes()[0..32].as_ref()) + .unwrap() + .to_ss58check() + ); + } + } + }, + Err(e) => { + println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + }, + }; + + Ok(()) + }) + .into() +} +pub fn drip_faucet(_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 cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + + let cindex = matches.cindex_arg().unwrap(); + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + + 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, "EncointerFaucet", "drip", faucet_account, cid, cindex) + .unwrap(); + + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + + let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; + + match result { + Ok(_report) => { + println!("Faucet dripped to {}", who.public()); + }, + Err(e) => { + println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); + }, + }; + + Ok(()) + }) + .into() +} +pub fn dissolve_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + let signer = ParentchainExtrinsicSigner::new(signer); + + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let dissolve_faucet_call = compose_call!( + api.metadata(), + "EncointerFaucet", + "dissolve_faucet", + faucet_account.clone(), + beneficiary + ) + .unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { + let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); + + OpaqueCall::from_tuple(&dissolve_faucet_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_dissolve_faucet = + collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); + print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); + + OpaqueCall::from_tuple(&propose_dissolve_faucet) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call).await, tx_payment_cid_arg) + .await; + + println!("Faucet dissolved: {faucet_account:?}"); + Ok(()) + }) + .into() +} +pub fn close_faucet(_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))); + + let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); + + 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, "EncointerFaucet", "close_faucet", faucet_account.clone()) + .unwrap(); + + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + + println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); + Ok(()) + }) + .into() +} +pub fn set_faucet_reserve_amount(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + let signer = ParentchainExtrinsicSigner::new(signer); + + let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); + + let mut api = get_chain_api(matches).await; + api.set_signer(signer); + + let set_reserve_amount_call = + compose_call!(api.metadata(), "EncointerFaucet", "set_reserve_amount", reserve_amount) + .unwrap(); + // return calls as `OpaqueCall`s to get the same return type in both branches + let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { + let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); + + OpaqueCall::from_tuple(&set_reserve_amount_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_set_reserve_amount = + collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); + print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); + + OpaqueCall::from_tuple(&propose_set_reserve_amount) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block( + &api, + xt(&api, set_reserve_amount_call).await, + tx_payment_cid_arg, + ) + .await; + + println!("Reserve amount set: {reserve_amount:?}"); + Ok(()) + }) + .into() +} +pub fn list_faucets(_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 is_verbose = matches.verbose_flag(); + let at_block = matches.at_block_arg(); + + let key_prefix = + api.get_storage_map_key_prefix("EncointerFaucet", "Faucets").await.unwrap(); + + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + + for storage_key in storage_keys.iter() { + let key_postfix = storage_key.as_ref(); + let faucet_address = + AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); + let faucet: Faucet = + api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); + + if is_verbose { + println!("address: {}", faucet_address.to_ss58check()); + println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); + println!( + "creator: {}", + AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check() + ); + println!( + "balance: {}", + api.get_account_data(&faucet_address).await.unwrap().unwrap().free + ); + println!("drip amount: {}", faucet.drip_amount); + if let Some(whitelist) = faucet.whitelist { + println!("whitelist:"); + for cid in whitelist.to_vec() { + println!("{}", cid); + } + } else { + println!("whitelist: None"); + } + println!(""); + } else { + println! {"{}", faucet_address}; + } + } + Ok(()) + }) + .into() +} diff --git a/client/src/commands/frame.rs b/client/src/commands/frame.rs new file mode 100644 index 00000000..bda869b4 --- /dev/null +++ b/client/src/commands/frame.rs @@ -0,0 +1,65 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::utils::ensure_payment; +use crate::utils::keys::get_accountid_from_str; +use crate::{get_chain_api, reasonable_native_balance, set_api_extrisic_params_builder}; +use clap::ArgMatches; +use encointer_api_client_extension::ExtrinsicAddress; +use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; +use log::info; +use parity_scale_codec::{Compact, Decode, Encode}; +use sp_keyring::AccountKeyring; +use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic_offline}; +use substrate_api_client::{GetBalance, SubmitAndWatch, XtStatus}; + +pub fn print_metadata(_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; + println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); + Ok(()) + }) + .into() +} + +pub fn faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let mut api = get_chain_api(matches).await; + api.set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); + let accounts = matches.fundees_arg().unwrap(); + + let existential_deposit = api.get_existential_deposit().await.unwrap(); + info!("Existential deposit is = {:?}", existential_deposit); + + let mut nonce = api.get_nonce().await.unwrap(); + + let amount = reasonable_native_balance(&api).await; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + for account in accounts.into_iter() { + let to = get_accountid_from_str(account); + let call = compose_call!( + api.metadata(), + "Balances", + "transfer_keep_alive", + ExtrinsicAddress::from(to.clone()), + Compact(amount) + ) + .unwrap(); + let xt: EncointerXt<_> = compose_extrinsic_offline!( + api.clone().signer().unwrap(), + call.clone(), + api.extrinsic_params(nonce) + ); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); + let _blockh = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + nonce += 1; + } + Ok(()) + }) + .into() +} diff --git a/client/src/commands/keystore.rs b/client/src/commands/keystore.rs new file mode 100644 index 00000000..862f4421 --- /dev/null +++ b/client/src/commands/keystore.rs @@ -0,0 +1,40 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::utils::keys::{KEYSTORE_PATH, SR25519}; +use clap::ArgMatches; +use log::info; +use sp_application_crypto::Ss58Codec; +use sp_application_crypto::{ed25519, sr25519}; +use sp_keystore::Keystore; +use std::path::PathBuf; +use substrate_client_keystore::KeystoreExt; +use substrate_client_keystore::LocalKeystore; + +pub fn new_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + + // This does not place the key into the keystore if we have a seed, but it does + // place it into the keystore if the seed is none. + let key = store.sr25519_generate_new(SR25519, matches.seed_arg()).unwrap(); + + if let Some(suri) = matches.seed_arg() { + store.insert(SR25519, suri, &key.0).unwrap(); + } + + drop(store); + println!("{}", key.to_ss58check()); + Ok(()) +} + +pub fn list_accounts(_args: &str, _matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); + info!("sr25519 keys:"); + for pubkey in store.public_keys::().unwrap().into_iter() { + println!("{}", pubkey.to_ss58check()); + } + info!("ed25519 keys:"); + for pubkey in store.public_keys::().unwrap().into_iter() { + println!("{}", pubkey.to_ss58check()); + } + drop(store); + Ok(()) +} diff --git a/client/src/commands/mod.rs b/client/src/commands/mod.rs new file mode 100644 index 00000000..c09bd3a0 --- /dev/null +++ b/client/src/commands/mod.rs @@ -0,0 +1,8 @@ +pub mod encointer_bazaar; +pub mod encointer_ceremonies; +pub mod encointer_communities; +pub mod encointer_core; +pub mod encointer_democracy; +pub mod encointer_faucet; +pub mod frame; +pub mod keystore; diff --git a/client/src/main.rs b/client/src/main.rs index 596066ab..a8bf0d2f 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -20,6 +20,7 @@ //! mod cli_args; +mod commands; mod community_spec; mod utils; @@ -136,17 +137,17 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .seed_arg() }) - .runner(cmd_new_account), + .runner(commands::keystore::new_account), ) .add_cmd( Command::new("list-accounts") .description("lists all accounts in keystore") - .runner(cmd_list_accounts), + .runner(commands::keystore::list_accounts), ) .add_cmd( Command::new("print-metadata") .description("query node metadata and print it as json to stdout") - .runner(cmd_print_metadata), + .runner(commands::frame::print_metadata), ) .add_cmd( Command::new("faucet") @@ -155,7 +156,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .fundees_arg() }) - .runner(cmd_faucet), + .runner(commands::frame::faucet), ) .add_cmd( Command::new("balance") @@ -166,7 +167,7 @@ async fn main() { .all_flag() .at_block_arg() }) - .runner(cmd_balance), + .runner(commands::encointer_core::balance), ) .add_cmd( Command::new("issuance") @@ -175,7 +176,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .at_block_arg() }) - .runner(cmd_issuance), + .runner(commands::encointer_core::issuance), ) .add_cmd( Command::new("transfer") @@ -205,7 +206,7 @@ async fn main() { .help("amount to be transferred"), ) }) - .runner(cmd_transfer), + .runner(commands::encointer_core::transfer), ) .add_cmd( Command::new("transfer_all") @@ -227,7 +228,7 @@ async fn main() { .help("recipient's AccountId in ss58check format"), ) }) - .runner(cmd_transfer_all), + .runner(commands::encointer_core::transfer_all), ) .add_cmd( Command::new("listen") @@ -249,7 +250,7 @@ async fn main() { .help("exit after given number of blocks"), ) }) - .runner(cmd_listen), + .runner(commands::encointer_core::listen_to_events), ) .add_cmd( Command::new("new-community") @@ -264,7 +265,7 @@ async fn main() { ) .signer_arg("account with necessary privileges") }) - .runner(cmd_new_community), + .runner(commands::encointer_communities::new_community), ) .add_cmd( Command::new("add-locations") @@ -280,12 +281,12 @@ async fn main() { .help("geojson file that specifies locations to add as points"), ) }) - .runner(cmd_add_locations), + .runner(commands::encointer_communities::add_locations), ) .add_cmd( Command::new("list-communities") .description("list all registered communities") - .runner(cmd_list_communities), + .runner(commands::encointer_communities::list_communities), ) .add_cmd( Command::new("list-locations") @@ -294,12 +295,12 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .at_block_arg() }) - .runner(cmd_list_locations), + .runner(commands::encointer_communities::list_locations), ) .add_cmd( Command::new("get-phase") .description("read current ceremony phase from chain") - .runner(cmd_get_phase), + .runner(commands::encointer_core::get_phase), ) .add_cmd( Command::new("next-phase") @@ -308,7 +309,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .signer_arg("account with necessary privileges (sudo or councillor)") }) - .runner(cmd_next_phase), + .runner(commands::encointer_core::next_phase), ) .add_cmd( Command::new("list-participants") @@ -317,7 +318,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(cmd_list_participants), + .runner(commands::encointer_ceremonies::list_participants), ) .add_cmd( Command::new("list-meetups") @@ -326,7 +327,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(cmd_list_meetups), + .runner(commands::encointer_ceremonies::list_meetups), ) .add_cmd( Command::new("print-ceremony-stats") @@ -335,7 +336,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(cmd_print_ceremony_stats), + .runner(commands::encointer_ceremonies::print_ceremony_stats), ) .add_cmd( Command::new("list-attestees") @@ -344,7 +345,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .ceremony_index_arg() }) - .runner(cmd_list_attestees), + .runner(commands::encointer_ceremonies::list_attestees), ) .add_cmd( Command::new("list-reputables") @@ -354,7 +355,7 @@ async fn main() { .at_block_arg() .verbose_flag() }) - .runner(cmd_list_reputables), + .runner(commands::encointer_ceremonies::list_reputables), ) .add_cmd( Command::new("register-participant") @@ -364,7 +365,7 @@ async fn main() { .account_arg() .signer_arg("Account which signs the tx.") }) - .runner(cmd_register_participant), + .runner(commands::encointer_ceremonies::register_participant), ) .add_cmd( Command::new("upgrade-registration") @@ -374,7 +375,7 @@ async fn main() { .account_arg() .signer_arg("Account which signs the tx.") }) - .runner(cmd_upgrade_registration), + .runner(commands::encointer_ceremonies::upgrade_registration), ) .add_cmd( Command::new("unregister-participant") @@ -385,7 +386,7 @@ async fn main() { .signer_arg("Account which signs the tx.") .ceremony_index_arg() }) - .runner(cmd_unregister_participant), + .runner(commands::encointer_ceremonies::unregister_participant), ) .add_cmd( Command::new("endorse-newcomers") @@ -395,7 +396,7 @@ async fn main() { .bootstrapper_arg() .endorsees_arg() }) - .runner(cmd_endorse_newcomers), + .runner(commands::encointer_ceremonies::endorse), ) .add_cmd( Command::new("get-bootstrappers-with-remaining-newbie-tickets") @@ -403,7 +404,7 @@ async fn main() { .options(|app| { app.setting(AppSettings::ColoredHelp) }) - .runner(cmd_get_bootstrappers_with_remaining_newbie_tickets), + .runner(commands::encointer_ceremonies::bootstrappers_with_remaining_newbie_tickets), ) .add_cmd( Command::new("get-proof-of-attendance") @@ -414,7 +415,7 @@ async fn main() { .account_arg() .ceremony_index_arg() }) - .runner(cmd_get_proof_of_attendance), + .runner(commands::encointer_ceremonies::get_proof_of_attendance), ) .add_cmd( Command::new("attest-attendees") @@ -425,7 +426,7 @@ async fn main() { .optional_cid_arg() .attestees_arg() }) - .runner(cmd_attest_attendees), + .runner(commands::encointer_ceremonies::attest_attendees), ) .add_cmd( Command::new("new-claim") @@ -441,7 +442,7 @@ async fn main() { .help("participant's vote on the number of people present at meetup time"), ) }) - .runner(cmd_new_claim), + .runner(commands::encointer_ceremonies::new_claim), ) .add_cmd( Command::new("claim-reward") @@ -452,7 +453,7 @@ async fn main() { .meetup_index_arg() .all_flag() }) - .runner(cmd_claim_reward), + .runner(commands::encointer_ceremonies::claim_reward), ) .add_cmd( Command::new("reputation") @@ -460,7 +461,28 @@ async fn main() { .options(|app| { app.setting(AppSettings::ColoredHelp) .account_arg()}) - .runner(cmd_reputation), + .runner(commands::encointer_ceremonies::reputation), + ) + .add_cmd( + Command::new("purge-community-ceremony") + .description("purge all history within the provided ceremony index range for the specified community") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .from_cindex_arg() + .to_cindex_arg() + + }) + .runner(commands::encointer_ceremonies::purge_community_ceremony), + ) + .add_cmd( + Command::new("set-meetup-time-offset") + .description("signed value to offset the ceremony meetup time relative to solar noon") + .options(|app| { + app.setting(AppSettings::ColoredHelp) + .setting(AppSettings::AllowLeadingHyphen) + .time_offset_arg() + }) + .runner(commands::encointer_ceremonies::set_meetup_time_offset), ) .add_cmd( Command::new("create-business") @@ -470,7 +492,7 @@ async fn main() { .account_arg() .ipfs_cid_arg() }) - .runner(cmd_create_business), + .runner(commands::encointer_bazaar::create_business), ) .add_cmd( Command::new("update-business") @@ -480,7 +502,7 @@ async fn main() { .account_arg() .ipfs_cid_arg() }) - .runner(cmd_update_business), + .runner(commands::encointer_bazaar::update_business), ) .add_cmd( Command::new("create-offering") @@ -490,17 +512,17 @@ async fn main() { .account_arg() .ipfs_cid_arg() }) - .runner(cmd_create_offering), + .runner(commands::encointer_bazaar::create_offering), ) .add_cmd( Command::new("list-businesses") .description("List businesses for a community") - .runner(cmd_list_businesses), + .runner(commands::encointer_bazaar::list_businesses), ) .add_cmd( Command::new("list-offerings") .description("List offerings for a community") - .runner(cmd_list_offerings), + .runner(commands::encointer_bazaar::list_offerings), ) .add_cmd( Command::new("list-business-offerings") @@ -509,28 +531,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .account_arg() }) - .runner(cmd_list_business_offerings), - ) - .add_cmd( - Command::new("purge-community-ceremony") - .description("purge all history within the provided ceremony index range for the specified community") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .from_cindex_arg() - .to_cindex_arg() - - }) - .runner(cmd_purge_community_ceremony), - ) - .add_cmd( - Command::new("set-meetup-time-offset") - .description("signed value to offset the ceremony meetup time relative to solar noon") - .options(|app| { - app.setting(AppSettings::ColoredHelp) - .setting(AppSettings::AllowLeadingHyphen) - .time_offset_arg() - }) - .runner(cmd_set_meetup_time_offset), + .runner(commands::encointer_bazaar::list_business_offerings), ) .add_cmd( Command::new("create-faucet") @@ -543,7 +544,7 @@ async fn main() { .faucet_drip_amount_arg() .whitelist_arg() }) - .runner(cmd_create_faucet), + .runner(commands::encointer_faucet::create_faucet), ) .add_cmd( Command::new("drip-faucet") @@ -554,7 +555,7 @@ async fn main() { .faucet_account_arg() .cindex_arg() }) - .runner(cmd_drip_faucet), + .runner(commands::encointer_faucet::drip_faucet), ) .add_cmd( Command::new("dissolve-faucet") @@ -565,7 +566,7 @@ async fn main() { .faucet_account_arg() .faucet_beneficiary_arg() }) - .runner(cmd_dissolve_faucet), + .runner(commands::encointer_faucet::dissolve_faucet), ) .add_cmd( Command::new("close-faucet") @@ -575,7 +576,7 @@ async fn main() { .account_arg() .faucet_account_arg() }) - .runner(cmd_close_faucet), + .runner(commands::encointer_faucet::close_faucet), ) .add_cmd( Command::new("set-faucet-reserve-amount") @@ -585,7 +586,7 @@ async fn main() { .signer_arg("account with necessary privileges (sudo or councillor)") .faucet_reserve_amount_arg() }) - .runner(cmd_set_faucet_reserve_amount), + .runner(commands::encointer_faucet::set_faucet_reserve_amount), ) .add_cmd( Command::new("list-faucets") @@ -595,7 +596,7 @@ async fn main() { .at_block_arg() .verbose_flag() }) - .runner(cmd_list_faucets) + .runner(commands::encointer_faucet::list_faucets) ) .add_cmd( Command::new("submit-set-inactivity-timeout-proposal") @@ -605,7 +606,7 @@ async fn main() { .account_arg() .inactivity_timeout_arg() }) - .runner(cmd_submit_set_inactivity_timeout_proposal), + .runner(commands::encointer_democracy::submit_set_inactivity_timeout_proposal), ) .add_cmd( Command::new("list-proposals") @@ -614,7 +615,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .at_block_arg() }) - .runner(cmd_list_proposals), + .runner(commands::encointer_democracy::list_proposals), ) .add_cmd( Command::new("vote") @@ -626,7 +627,7 @@ async fn main() { .vote_arg() .reputation_vec_arg() }) - .runner(cmd_vote), + .runner(commands::encointer_democracy::vote), ) .add_cmd( Command::new("update-proposal-state") @@ -634,7 +635,7 @@ async fn main() { .options(|app| { app.setting(AppSettings::ColoredHelp).account_arg().proposal_id_arg() }) - .runner(cmd_update_proposal_state), + .runner(commands::encointer_democracy::update_proposal_state), ) // To handle when no subcommands match .no_cmd(|_args, _matches| { @@ -644,1613 +645,6 @@ async fn main() { .run(); } ////////////////////// -fn cmd_new_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - - // This does not place the key into the keystore if we have a seed, but it does - // place it into the keystore if the seed is none. - let key = store.sr25519_generate_new(SR25519, matches.seed_arg()).unwrap(); - - if let Some(suri) = matches.seed_arg() { - store.insert(SR25519, suri, &key.0).unwrap(); - } - - drop(store); - println!("{}", key.to_ss58check()); - Ok(()) -} -fn cmd_list_accounts(_args: &str, _matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); - info!("sr25519 keys:"); - for pubkey in store.public_keys::().unwrap().into_iter() { - println!("{}", pubkey.to_ss58check()); - } - info!("ed25519 keys:"); - for pubkey in store.public_keys::().unwrap().into_iter() { - println!("{}", pubkey.to_ss58check()); - } - drop(store); - Ok(()) -} -fn cmd_print_metadata(_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; - println!("Metadata:\n {}", api.metadata().pretty_format().unwrap()); - Ok(()) - }) - .into() -} -fn cmd_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let mut api = get_chain_api(matches).await; - api.set_signer(ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair())); - let accounts = matches.fundees_arg().unwrap(); - - let existential_deposit = api.get_existential_deposit().await.unwrap(); - info!("Existential deposit is = {:?}", existential_deposit); - - let mut nonce = api.get_nonce().await.unwrap(); - - let amount = reasonable_native_balance(&api).await; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - for account in accounts.into_iter() { - let to = get_accountid_from_str(account); - let call = compose_call!( - api.metadata(), - "Balances", - "transfer_keep_alive", - ExtrinsicAddress::from(to.clone()), - Compact(amount) - ) - .unwrap(); - let xt: EncointerXt<_> = compose_extrinsic_offline!( - api.clone().signer().unwrap(), - call.clone(), - api.extrinsic_params(nonce) - ); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // send and watch extrinsic until ready - println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); - let _blockh = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - nonce += 1; - } - Ok(()) - }) - .into() -} -fn cmd_balance(_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 account = matches.account_arg().unwrap(); - let maybe_at = matches.at_block_arg(); - let accountid = get_accountid_from_str(account); - match matches.cid_arg() { - Some(cid_str) => { - let balance = get_community_balance(&api, cid_str, &accountid, maybe_at).await; - println! {"{balance:?}"}; - }, - None => { - if matches.all_flag() { - let community_balances = get_all_balances(&api, &accountid).await.unwrap(); - let bn = get_block_number(&api, maybe_at).await; - for b in community_balances.iter() { - let dr = get_demurrage_per_block(&api, b.0).await; - println!("{}: {}", b.0, apply_demurrage(b.1, bn, dr)) - } - } - let balance = if let Some(data) = api.get_account_data(&accountid).await.unwrap() { - data.free - } else { - 0 - }; - println!("{balance}"); - }, - }; - Ok(()) - }) - .into() -} -fn cmd_issuance(_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 maybe_at = matches.at_block_arg(); - let cid_str = matches.cid_arg().expect("please supply argument --cid"); - let issuance = get_community_issuance(&api, cid_str, maybe_at).await; - println! {"{issuance:?}"}; - Ok(()) - }) - .into() -} -fn cmd_transfer(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let mut api = get_chain_api(matches).await; - let arg_from = matches.value_of("from").unwrap(); - let arg_to = matches.value_of("to").unwrap(); - if !matches.dryrun_flag() { - let from = get_pair_from_str(arg_from); - info!("from ss58 is {}", from.public().to_ss58check()); - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - api.set_signer(signer); - } - let to = get_accountid_from_str(arg_to); - info!("to ss58 is {}", to.to_ss58check()); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let tx_hash = match matches.cid_arg() { - Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None).await; - let amount = BalanceType::from_str(matches.value_of("amount").unwrap()) - .expect("amount can be converted to fixpoint"); - - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerBalances", - "transfer", - to.clone(), - cid, - amount - ) - .unwrap(); - if matches.dryrun_flag() { - println!("0x{}", hex::encode(xt.function.encode())); - None - } else { - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) - } - }, - None => { - let amount = matches - .value_of("amount") - .unwrap() - .parse::() - .expect("amount can be converted to u128"); - // todo: use keep_alive instead https://github.com/scs/substrate-api-client/issues/747 - let xt = api.balance_transfer_allow_death(to.clone().into(), amount).await.unwrap(); - if matches.dryrun_flag() { - println!("0x{}", hex::encode(xt.function.encode())); - None - } else { - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - Some(api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap()) - } - }, - }; - if let Some(txh) = tx_hash { - info!("[+] Transaction included. Hash: {:?}\n", txh); - let result = api.get_account_data(&to).await.unwrap().unwrap(); - println!("balance for {} is now {}", to, result.free); - } - Ok(()) - }) - .into() -} -fn cmd_transfer_all(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let mut api = get_chain_api(matches).await; - let arg_from = matches.value_of("from").unwrap(); - let arg_to = matches.value_of("to").unwrap(); - let from = get_pair_from_str(arg_from); - let to = get_accountid_from_str(arg_to); - info!("from ss58 is {}", from.public().to_ss58check()); - info!("to ss58 is {}", to.to_ss58check()); - - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(from)); - api.set_signer(signer); - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let tx_hash = match matches.cid_arg() { - Some(cid_str) => { - let cid = verify_cid(&api, cid_str, None).await; - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - let xt: EncointerXt<_> = - compose_extrinsic!(api, "EncointerBalances", "transfer_all", to.clone(), cid) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap() - }, - None => { - error!("No cid specified"); - std::process::exit(exit_code::NO_CID_SPECIFIED); - }, - }; - info!("[+] Transaction included. Hash: {:?}\n", tx_hash); - let result = api.get_account_data(&to).await.unwrap().unwrap(); - println!("balance for {} is now {}", to, result.free); - Ok(()) - }) - .into() -} -fn cmd_listen(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - listen(matches).await; - Ok(()) - }) - .into() -} -fn cmd_new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - // -----setup - let spec_file = matches.value_of("specfile").unwrap(); - let spec = read_community_spec_from_file(spec_file); - let cid = spec.community_identifier(); - - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - let signer = ParentchainExtrinsicSigner::new(signer); - - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - - // ------- create calls for xt's - let mut new_community_call = OpaqueCall::from_tuple(&new_community_call(&spec, api.metadata())); - // only the first meetup location has been registered now. register all others one-by-one - let add_location_calls = spec.locations().into_iter().skip(1).map(|l| add_location_call(api.metadata(), cid, l)).collect(); - let mut add_location_batch_call = OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls)); - - - if matches.signer_arg().is_none() { - // return calls as `OpaqueCall`s to get the same return type in both branches - (new_community_call, add_location_batch_call) = if contains_sudo_pallet(api.metadata()) { - let sudo_new_community = sudo_call(api.metadata(), new_community_call); - let sudo_add_location_batch = sudo_call(api.metadata(), add_location_batch_call); - info!("Printing raw sudo calls for js/apps for cid: {}", cid); - print_raw_call("sudo(new_community)", &sudo_new_community); - print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - - (OpaqueCall::from_tuple(&sudo_new_community), OpaqueCall::from_tuple(&sudo_add_location_batch)) - - } else { - let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - let propose_new_community = collective_propose_call(api.metadata(), threshold, new_community_call); - let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_batch_call); - print_raw_call("collective_propose(new_community)", &propose_new_community); - print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - - (OpaqueCall::from_tuple(&propose_new_community), OpaqueCall::from_tuple(&propose_add_location_batch)) - }; - } - - // ---- send xt's to chain - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - send_and_wait_for_in_block(&api, xt(&api, new_community_call).await, matches.tx_payment_cid_arg()).await; - println!("{cid}"); - - if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { - error!("Wrong ceremony phase for registering new locations for {}", cid); - error!("Aborting without registering additional locations"); - std::process::exit(exit_code::WRONG_PHASE); - } - send_and_wait_for_in_block(&api, xt(&api, add_location_batch_call).await, tx_payment_cid_arg).await; - Ok(()) - - }) - .into() -} -fn cmd_add_locations(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - // -----setup - let spec_file = matches.value_of("specfile").unwrap(); - let spec = read_community_spec_from_file(spec_file); - - let mut api = get_chain_api(matches).await; - if !matches.dryrun_flag() { - let signer = matches.signer_arg() - .map_or_else(|| AccountKeyring::Alice.pair(), |signer| get_pair_from_str(signer).into()); - info!("signer ss58 is {}", signer.public().to_ss58check()); - let signer = ParentchainExtrinsicSigner::new(signer); - api.set_signer(signer); - } - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - - let cid = verify_cid(&api, matches.cid_arg().unwrap(), None).await; - - let add_location_calls: Vec= spec.locations().into_iter().map(|l| - { - info!("adding location {:?}", l); - add_location_call(api.metadata(), cid, l) - } - ).collect(); - - let mut add_location_maybe_batch_call = match add_location_calls.as_slice() { - [call] => OpaqueCall::from_tuple(call), - _ => OpaqueCall::from_tuple(&batch_call(api.metadata(), add_location_calls.clone())) - }; - - if matches.signer_arg().is_none() { - // return calls as `OpaqueCall`s to get the same return type in both branches - add_location_maybe_batch_call = if contains_sudo_pallet(api.metadata()) { - let sudo_add_location_batch = sudo_call(api.metadata(), add_location_maybe_batch_call); - info!("Printing raw sudo calls for js/apps for cid: {}", cid); - print_raw_call("sudo(utility_batch(add_location))", &sudo_add_location_batch); - OpaqueCall::from_tuple(&sudo_add_location_batch) - } else { - let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps for cid: {}", threshold, cid); - let propose_add_location_batch = collective_propose_call(api.metadata(), threshold, add_location_maybe_batch_call); - print_raw_call("collective_propose(utility_batch(add_location))", &propose_add_location_batch); - OpaqueCall::from_tuple(&propose_add_location_batch) - }; - } - - if matches.dryrun_flag() { - println!("0x{}", hex::encode(add_location_maybe_batch_call.encode())); - } else { - // ---- send xt's to chain - if api.get_current_phase().await.unwrap() != CeremonyPhaseType::Registering { - error!("Wrong ceremony phase for registering new locations for {}", cid); - error!("Aborting without registering additional locations"); - std::process::exit(exit_code::WRONG_PHASE); - } - send_and_wait_for_in_block(&api, xt(&api, add_location_maybe_batch_call).await, tx_payment_cid_arg).await; - } - Ok(()) - - }) - .into() -} -fn cmd_list_communities(_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 names = get_cid_names(&api).await.unwrap(); - println!("number of communities: {}", names.len()); - for n in names.iter() { - let loc = api.get_locations(n.cid).await.unwrap(); - println!( - "{}: {} locations: {}", - n.cid, - String::from_utf8(n.name.to_vec()).unwrap(), - loc.len() - ); - } - Ok(()) - }) - .into() -} -fn cmd_list_locations(_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 maybe_at = matches.at_block_arg(); - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), maybe_at) - .await; - println!("listing locations for cid {cid}"); - let loc = api.get_locations(cid).await.unwrap(); - for l in loc.iter() { - println!( - "lat: {} lon: {} (raw lat: {} lon: {})", - l.lat, - l.lon, - i128::decode(&mut l.lat.encode().as_slice()).unwrap(), - i128::decode(&mut l.lon.encode().as_slice()).unwrap() - ); - } - Ok(()) - }) - .into() -} -fn cmd_get_phase(_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; - - // >>>> add some debug info as well - let bn = get_block_number(&api, None).await; - debug!("block number: {}", bn); - let cindex = get_ceremony_index(&api, None).await; - info!("ceremony index: {}", cindex); - let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); - debug!("next phase timestamp: {}", tnext); - // <<<< - - let phase = api.get_current_phase().await.unwrap(); - println!("{phase:?}"); - Ok(()) - }) - .into() -} -fn cmd_next_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let signer = matches.signer_arg().map_or_else( - || AccountKeyring::Alice.pair(), - |signer| get_pair_from_str(signer).into(), - ); - - let mut api = get_chain_api(matches).await; - let signer = ParentchainExtrinsicSigner::new(signer); - api.set_signer(signer); - let next_phase_call = - compose_call!(api.metadata(), "EncointerScheduler", "next_phase").unwrap(); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let next_phase_call = if contains_sudo_pallet(api.metadata()) { - let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(next_phase)", &sudo_next_phase_call); - - OpaqueCall::from_tuple(&sudo_next_phase_call) - } else { - let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_next_phase = - collective_propose_call(api.metadata(), threshold, next_phase_call); - print_raw_call("collective_propose(next_phase)", &propose_next_phase); - - OpaqueCall::from_tuple(&propose_next_phase) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg).await; - - let phase = api.get_current_phase().await.unwrap(); - println!("Phase is now: {phase:?}"); - Ok(()) - }) - .into() -} -fn cmd_list_participants(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let current_ceremony_index = get_ceremony_index(&api, None).await; - - let cindex = matches.ceremony_index_arg().map_or_else( - || current_ceremony_index, - |ci| into_effective_cindex(ci, current_ceremony_index), - ); - - println!("listing participants for cid {cid} and ceremony nr {cindex}"); - - let counts = vec!["BootstrapperCount", "ReputableCount", "EndorseeCount", "NewbieCount"]; - - let registries = - vec!["BootstrapperRegistry", "ReputableRegistry", "EndorseeRegistry", "NewbieRegistry"]; - - let mut num_participants: Vec = vec![0, 0, 0, 0]; - for i in 0..registries.len() { - println!("Querying {}", registries[i]); - - let count: ParticipantIndexType = api - .get_storage_map(ENCOINTER_CEREMONIES, counts[i], (cid, cindex), None) - .await - .unwrap() - .unwrap_or(0); - println!("number of participants assigned: {count}"); - num_participants[i] = count; - for p_index in 1..count + 1 { - let accountid: AccountId = api - .get_storage_double_map( - ENCOINTER_CEREMONIES, - registries[i], - (cid, cindex), - p_index, - None, - ) - .await - .unwrap() - .unwrap(); - println!("{}[{}, {}] = {}", registries[i], cindex, p_index, accountid); - } - } - println!("total: {} guaranteed seats + {} newbies = {} total participants who would like to attend", - num_participants[0..=2].iter().sum::(), - num_participants[3], - num_participants[0..=3].iter().sum::() - ); - Ok(()) - }) - .into() -} -fn cmd_list_meetups(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let current_ceremony_index = get_ceremony_index(&api, None).await; - - let cindex = matches.ceremony_index_arg().map_or_else( - || current_ceremony_index, - |ci| into_effective_cindex(ci, current_ceremony_index), - ); - - let community_ceremony = (cid, cindex); - - println!("listing meetups for cid {cid} and ceremony nr {cindex}"); - - let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); - - let mut num_assignees = 0u64; - - for meetup in stats.meetups.iter() { - println!( - "MeetupRegistry[{:?}, {}] location is {:?}, {:?}", - &community_ceremony, meetup.index, meetup.location.lat, meetup.location.lon - ); - - println!( - "MeetupRegistry[{:?}, {}] meeting time is {:?}", - &community_ceremony, meetup.index, meetup.time - ); - - if !meetup.registrations.is_empty() { - let num = meetup.registrations.len(); - num_assignees += num as u64; - println!( - "MeetupRegistry[{:?}, {}] participants: {}", - &community_ceremony, meetup.index, num - ); - for (participant, _registration) in meetup.registrations.iter() { - println!(" {participant}"); - } - } else { - println!("MeetupRegistry[{:?}, {}] EMPTY", &community_ceremony, meetup.index); - } - } - println!("total number of assignees: {num_assignees}"); - Ok(()) - }) - .into() -} - -fn cmd_print_ceremony_stats(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let current_ceremony_index = get_ceremony_index(&api, None).await; - - let cindex = matches.ceremony_index_arg().map_or_else( - || current_ceremony_index, - |ci| into_effective_cindex(ci, current_ceremony_index), - ); - - let community_ceremony = (cid, cindex); - - let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); - - // serialization prints the the account id better than `debug` - println!("{}", serde_json::to_string_pretty(&stats).unwrap()); - Ok(()) - }) - .into() -} -fn cmd_list_attestees(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let current_ceremony_index = get_ceremony_index(&api, None).await; - - let cindex = matches.ceremony_index_arg().map_or_else( - || current_ceremony_index, - |ci| into_effective_cindex(ci, current_ceremony_index), - ); - - let community_ceremony = (cid, cindex); - - let stats = api.get_community_ceremony_stats(community_ceremony).await.unwrap(); - - // serialization prints the the account id better than `debug` - println!("{}", serde_json::to_string_pretty(&stats).unwrap()); - Ok(()) - }) - .into() -} -fn cmd_list_reputables(_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 is_verbose = matches.verbose_flag(); - let at_block = matches.at_block_arg(); - - let lifetime = get_reputation_lifetime(&api, at_block).await; - let current_ceremony_index = get_ceremony_index(&api, at_block).await; - - - let first_ceremony_index_of_interest = current_ceremony_index.saturating_sub(lifetime); - let ceremony_indices: Vec = (first_ceremony_index_of_interest..current_ceremony_index).collect(); - - let community_ids = get_cid_names(&api).await.unwrap().into_iter().map(|names| names.cid); - - let mut reputables_csv = Vec::new(); - - println!("Listing the number of attested attendees for each community and ceremony for cycles [{:}:{:}]", ceremony_indices.first().unwrap(), ceremony_indices.last().unwrap()); - for community_id in community_ids { - println!("Community ID: {community_id:?}"); - let mut reputables: HashMap = HashMap::new(); - for ceremony_index in &ceremony_indices { - let (attendees, noshows) = get_attendees_for_community_ceremony(&api, (community_id, *ceremony_index), at_block).await; - println!("Cycle ID {ceremony_index:?}: Total attested attendees: {:} (noshows: {:})", attendees.len(), noshows.len()); - for attendee in attendees { - reputables_csv.push(format!("{community_id:?},{ceremony_index:?},{}", attendee.to_ss58check())); - *reputables.entry(attendee.clone()).or_insert(0) += 1; - } - } - println!("Reputables in {community_id:?} (unique accounts with at least one attendance) {:}", reputables.keys().len()); - } - if is_verbose { - for reputable in reputables_csv { - println!("{reputable}"); - } - } - Ok(()) - - }) - .into() -} -fn cmd_upgrade_registration(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who), - }; - - let api = get_chain_api(matches).await; - let cindex = get_ceremony_index(&api, None).await; - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - - let current_phase = api.get_current_phase().await.unwrap(); - if !(current_phase == CeremonyPhaseType::Registering - || current_phase == CeremonyPhaseType::Attesting) - { - error!("wrong ceremony phase for registering participant"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut reputation_cindex = cindex; - if current_phase == CeremonyPhaseType::Registering { - reputation_cindex -= 1; - } - let rep = get_reputation(&api, &accountid, cid, reputation_cindex).await; - info!("{} has reputation {:?}", accountid, rep); - let proof = match rep { - Reputation::VerifiedUnlinked => { - prove_attendance(accountid, cid, reputation_cindex, arg_who) - }, - _ => { - error!("No valid reputation in last ceremony."); - std::process::exit(exit_code::INVALID_REPUTATION); - }, - }; - - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - 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, "EncointerCeremonies", "upgrade_registration", cid, proof) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - info!("Upgrade registration sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }) - .into() -} -fn cmd_register_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who), - }; - - let api = get_chain_api(matches).await; - let cindex = get_ceremony_index(&api, None).await; - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let rep = get_reputation(&api, &accountid, cid, cindex - 1).await; - info!("{} has reputation {:?}", accountid, rep); - let proof = match rep { - Reputation::Unverified => None, - Reputation::UnverifiedReputable => None, // this should never be the case during Registering! - Reputation::VerifiedUnlinked => { - Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) - }, - Reputation::VerifiedLinked(_) => { - Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) - }, - }; - debug!("proof: {:x?}", proof.encode()); - let current_phase = api.get_current_phase().await.unwrap(); - if !(current_phase == CeremonyPhaseType::Registering - || current_phase == CeremonyPhaseType::Attesting) - { - error!("wrong ceremony phase for registering participant"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - 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, "EncointerCeremonies", "register_participant", cid, proof) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - info!("Registration sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }) - .into() -} -fn cmd_unregister_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let arg_who = matches.account_arg().unwrap(); - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => get_pair_from_str(arg_who), - }; - - let api = get_chain_api(matches).await; - - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - - let cc = match matches.ceremony_index_arg() { - Some(cindex_arg) => { - let current_ceremony_index = get_ceremony_index(&api, None).await; - let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - Some((cid, cindex)) - }, - None => None, - }; - - let current_phase = api.get_current_phase().await.unwrap(); - if !(current_phase == CeremonyPhaseType::Registering - || current_phase == CeremonyPhaseType::Attesting) - { - error!("wrong ceremony phase for unregistering"); - std::process::exit(exit_code::WRONG_PHASE); - } - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer); - - 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, "EncointerCeremonies", "unregister_participant", cid, cc) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // Send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - info!("Unregister Participant sent for {}. status: '{:?}'", arg_who, report.status); - Ok(()) - }) - .into() -} -fn cmd_endorse_newcomers(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let mut api = get_chain_api(matches).await; - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - endorse_newcomers(&mut api, cid, matches).await.unwrap(); - - Ok(()) - }) - .into() -} -fn cmd_get_bootstrappers_with_remaining_newbie_tickets( - _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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let bs_with_tickets: Vec = - get_bootstrappers_with_remaining_newbie_tickets(&api, cid).await.unwrap(); - - info!("burned_bootstrapper_newbie_tickets = {:?}", bs_with_tickets); - - // transform it to simple tuples, which is easier to parse in python - let bt_vec = bs_with_tickets - .into_iter() - .map(|bt| (bt.bootstrapper.to_ss58check(), bt.remaining_newbie_tickets)) - .collect::>(); - - println!("{bt_vec:?}"); - Ok(()) - }) - .into() -} -fn cmd_get_proof_of_attendance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let arg_who = matches.account_arg().unwrap(); - let accountid = get_accountid_from_str(arg_who); - let api = get_chain_api(matches).await; - - let current_ceremony_index = get_ceremony_index(&api, None).await; - - let cindex_arg = matches.ceremony_index_arg().unwrap_or(-1); - let cindex = into_effective_cindex(cindex_arg, current_ceremony_index); - - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - - debug!("Getting proof for ceremony index: {:?}", cindex); - let proof = prove_attendance(accountid, cid, cindex, arg_who); - info!("Proof: {:?}\n", &proof); - println!("0x{}", hex::encode(proof.encode())); - - Ok(()) - }) - .into() -} -fn cmd_attest_attendees(_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 attestees: Vec<_> = matches - .attestees_arg() - .unwrap() - .into_iter() - .map(get_accountid_from_str) - .collect(); - - let vote = attestees.len() as u32 + 1u32; - - debug!("attestees: {:?}", attestees); - - info!("send attest_attendees by {}", who.public()); - - let mut api = get_chain_api(matches).await; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(who.clone())); - api.set_signer(signer); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - - let xt: EncointerXt<_> = compose_extrinsic!( - api, - "EncointerCeremonies", - "attest_attendees", - cid, - vote, - attestees - ) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - - println!("Claims sent by {}. status: '{:?}'", who.public(), report.status); - Ok(()) - }) - .into() -} -fn cmd_new_claim(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let arg_who = matches.account_arg().unwrap(); - let claimant = get_pair_from_str(arg_who); - - let n_participants = matches.value_of("vote").unwrap().parse::().unwrap(); - - let claim = new_claim_for(&api, &claimant.into(), cid, n_participants).await; - - println!("{}", hex::encode(claim)); - - Ok(()) - }) - .into() -} -fn cmd_claim_reward(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - - let signer = match matches.signer_arg() { - Some(sig) => get_pair_from_str(sig), - None => panic!("please specify --signer."), - }; - let mut api = api; - let signer = ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(signer)); - api.set_signer(signer.clone()); - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - let meetup_index_arg = matches.meetup_index_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - if matches.all_flag() { - let mut cindex = get_ceremony_index(&api, None).await; - if api.get_current_phase().await.unwrap() == CeremonyPhaseType::Registering { - cindex -= 1; - } - let meetup_count = api - .get_storage_map("EncointerCeremonies", "MeetupCount", (cid, cindex), None) - .await - .unwrap() - .unwrap_or(0u64); - let calls: Vec<_> = (1u64..=meetup_count) - .map(|idx| { - compose_call!( - api.metadata(), - ENCOINTER_CEREMONIES, - "claim_rewards", - cid, - Option::::Some(idx) - ) - .unwrap() - }) - .collect(); - let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); - send_and_wait_for_in_block(&api, xt(&api, batch_call).await, tx_payment_cid_arg).await; - println!("Claiming reward for all meetup indexes. xt-status: 'ready'"); - } else { - let meetup_index = meetup_index_arg; - let xt: EncointerXt<_> = - compose_extrinsic!(api, ENCOINTER_CEREMONIES, "claim_rewards", cid, meetup_index) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - match meetup_index_arg { - Some(idx) => { - println!( - "Claiming reward for meetup_index {idx}. xt-status: '{:?}'", - report.status - ); - }, - None => { - println!( - "Claiming reward for {}. xt-status: 'ready'", - signer.public_account_id() - ); - }, - } - } - Ok(()) - }) - .into() -} -fn cmd_reputation(_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 account = matches.account_arg().unwrap(); - let account_id = get_accountid_from_str(account); - if let Some(reputation) = get_reputation_history(&api, &account_id).await { - for rep in reputation.iter() { - println!("{}, {}, {:?}", rep.0, rep.1.community_identifier, rep.1.reputation); - } - } else { - error!("could not fetch reputation over rpc"); - std::process::exit(exit_code::RPC_ERROR); - } - Ok(()) - }) - .into() -} -fn cmd_create_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - send_bazaar_xt(matches, &BazaarCalls::CreateBusiness).await.unwrap(); - Ok(()) - }) - .into() -} -fn cmd_update_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - send_bazaar_xt(matches, &BazaarCalls::UpdateBusiness).await.unwrap(); - Ok(()) - }) - .into() -} -fn cmd_create_offering(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - send_bazaar_xt(matches, &BazaarCalls::CreateOffering).await.unwrap(); - Ok(()) - }) - .into() -} -fn cmd_list_businesses(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let businesses = get_businesses(&api, cid).await.unwrap(); - // only print plain businesses to be able to parse them in python scripts - println!("{businesses:?}"); - Ok(()) - }) - .into() -} -fn cmd_list_offerings(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let offerings = get_offerings(&api, cid).await.unwrap(); - // only print plain offerings to be able to parse them in python scripts - println!("{offerings:?}"); - Ok(()) - }) - .into() -} - -fn cmd_list_business_offerings(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let account = matches.account_arg().map(get_accountid_from_str).unwrap(); - let api = get_chain_api(matches).await; - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let offerings = get_offerings_for_business(&api, cid, account).await.unwrap(); - // only print plain offerings to be able to parse them in python scripts - println!("{offerings:?}"); - Ok(()) - }) - .into() -} -fn cmd_set_meetup_time_offset(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let mut api = get_chain_api(matches).await; - let signer = ParentchainExtrinsicSigner::new(AccountKeyring::Alice.pair()); - api.set_signer(signer); - let time_offset = matches.time_offset_arg().unwrap_or(0); - let call = compose_call!( - api.metadata(), - "EncointerCeremonies", - "set_meetup_time_offset", - time_offset - ) - .unwrap(); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let privileged_call = if contains_sudo_pallet(api.metadata()) { - let sudo_call = sudo_call(api.metadata(), call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(...)", &sudo_call); - OpaqueCall::from_tuple(&sudo_call) - } else { - let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_call = collective_propose_call(api.metadata(), threshold, call); - print_raw_call("collective_propose(...)", &propose_call); - OpaqueCall::from_tuple(&propose_call) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - let xt = xt(&api, privileged_call).await; - send_and_wait_for_in_block(&api, xt, tx_payment_cid_arg).await; - Ok(()) - }) - .into() -} - -fn cmd_purge_community_ceremony(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let sudoer = AccountKeyring::Alice.pair(); - let signer = ParentchainExtrinsicSigner::new(sudoer); - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - let current_ceremony_index = get_ceremony_index(&api, None).await; - - let from_cindex_arg = matches.from_cindex_arg().unwrap_or(0); - let to_cindex_arg = matches.to_cindex_arg().unwrap_or(0); - - let from_cindex = into_effective_cindex(from_cindex_arg, current_ceremony_index); - let to_cindex = into_effective_cindex(to_cindex_arg, current_ceremony_index); - - if from_cindex > to_cindex { - panic!("'from' <= 'to' ceremony index violated"); - } - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - println!("purging ceremony index range [{from_cindex} {to_cindex}] for community {cid}"); - - let calls: Vec<_> = (from_cindex..=to_cindex) - .map(|idx| { - compose_call!( - api.metadata(), - "EncointerCeremonies", - "purge_community_ceremony", - (cid, idx) - ) - .unwrap() - }) - .collect(); - let batch_call = compose_call!(api.metadata(), "Utility", "batch", calls).unwrap(); - let unsigned_sudo_call = - compose_call!(api.metadata(), "Sudo", "sudo", batch_call.clone()).unwrap(); - info!( - "raw sudo batch call to sign with js/apps {}: 0x{}", - cid, - hex::encode(unsigned_sudo_call.encode()) - ); - - 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, "Sudo", "sudo", batch_call).unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - let tx_report = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await.unwrap(); - info!("[+] Transaction got included. Block Hash: {:?}\n", tx_report.block_hash.unwrap()); - Ok(()) - }) - .into() -} -fn cmd_create_faucet(_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 faucet_name_raw = matches.faucet_name_arg().unwrap(); - let faucet_balance = matches.faucet_balance_arg().unwrap(); - let drip_amount = matches.faucet_drip_amount_arg().unwrap(); - - let api2 = api.clone(); - let whitelist = futures::future::join_all(matches.whitelist_arg().map(|wl| async move { - let whitelist_vec: Vec<_> = futures::future::join_all(wl.into_iter().map(|c| { - let api_local = api2.clone(); - async move { verify_cid(&api_local, c, None).await } - })) - .await; - WhiteListType::try_from(whitelist_vec).unwrap() - })) - .await; - - let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); - 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, - "EncointerFaucet", - "create_faucet", - faucet_name, - faucet_balance, - whitelist, - drip_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; - - match result { - Ok(report) => { - for event in report.events.unwrap().iter() { - if event.pallet_name() == "EncointerFaucet" - && event.variant_name() == "FaucetCreated" - { - println!( - "{}", - AccountId::decode(&mut event.field_bytes()[0..32].as_ref()) - .unwrap() - .to_ss58check() - ); - } - } - }, - Err(e) => { - println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - }, - }; - - Ok(()) - }) - .into() -} -fn cmd_drip_faucet(_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 cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - - let cindex = matches.cindex_arg().unwrap(); - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - - 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, "EncointerFaucet", "drip", faucet_account, cid, cindex) - .unwrap(); - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - - let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; - - match result { - Ok(_report) => { - println!("Faucet dripped to {}", who.public()); - }, - Err(e) => { - println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); - }, - }; - - Ok(()) - }) - .into() -} -fn cmd_dissolve_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let signer = matches.signer_arg().map_or_else( - || AccountKeyring::Alice.pair(), - |signer| get_pair_from_str(signer).into(), - ); - let signer = ParentchainExtrinsicSigner::new(signer); - - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - let beneficiary = get_accountid_from_str(matches.faucet_beneficiary_arg().unwrap()); - - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - let dissolve_faucet_call = compose_call!( - api.metadata(), - "EncointerFaucet", - "dissolve_faucet", - faucet_account.clone(), - beneficiary - ) - .unwrap(); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let dissolve_faucet_call = if contains_sudo_pallet(api.metadata()) { - let dissolve_faucet_call = sudo_call(api.metadata(), dissolve_faucet_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(dissolve_faucet)", &dissolve_faucet_call); - - OpaqueCall::from_tuple(&dissolve_faucet_call) - } else { - let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_dissolve_faucet = - collective_propose_call(api.metadata(), threshold, dissolve_faucet_call); - print_raw_call("collective_propose(dissolve_faucet)", &propose_dissolve_faucet); - - OpaqueCall::from_tuple(&propose_dissolve_faucet) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - send_and_wait_for_in_block(&api, xt(&api, dissolve_faucet_call).await, tx_payment_cid_arg) - .await; - - println!("Faucet dissolved: {faucet_account:?}"); - Ok(()) - }) - .into() -} -fn cmd_close_faucet(_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))); - - let faucet_account = get_accountid_from_str(matches.faucet_account_arg().unwrap()); - - 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, "EncointerFaucet", "close_faucet", faucet_account.clone()) - .unwrap(); - - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - - println!("Faucet closed: {faucet_account}. status: '{:?}'", report.status); - Ok(()) - }) - .into() -} -fn cmd_set_faucet_reserve_amount(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let signer = matches.signer_arg().map_or_else( - || AccountKeyring::Alice.pair(), - |signer| get_pair_from_str(signer).into(), - ); - let signer = ParentchainExtrinsicSigner::new(signer); - - let reserve_amount = matches.faucet_reserve_amount_arg().unwrap(); - - let mut api = get_chain_api(matches).await; - api.set_signer(signer); - - let set_reserve_amount_call = - compose_call!(api.metadata(), "EncointerFaucet", "set_reserve_amount", reserve_amount) - .unwrap(); - // return calls as `OpaqueCall`s to get the same return type in both branches - let set_reserve_amount_call = if contains_sudo_pallet(api.metadata()) { - let set_reserve_amount_call = sudo_call(api.metadata(), set_reserve_amount_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(set_reserve_amount)", &set_reserve_amount_call); - - OpaqueCall::from_tuple(&set_reserve_amount_call) - } else { - let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_set_reserve_amount = - collective_propose_call(api.metadata(), threshold, set_reserve_amount_call); - print_raw_call("collective_propose(set_reserve_amount)", &propose_set_reserve_amount); - - OpaqueCall::from_tuple(&propose_set_reserve_amount) - }; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; - - send_and_wait_for_in_block( - &api, - xt(&api, set_reserve_amount_call).await, - tx_payment_cid_arg, - ) - .await; - - println!("Reserve amount set: {reserve_amount:?}"); - Ok(()) - }) - .into() -} -fn cmd_list_faucets(_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 is_verbose = matches.verbose_flag(); - let at_block = matches.at_block_arg(); - - let key_prefix = - api.get_storage_map_key_prefix("EncointerFaucet", "Faucets").await.unwrap(); - - let max_keys = 1000; - let storage_keys = api - .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) - .await - .unwrap(); - - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - - for storage_key in storage_keys.iter() { - let key_postfix = storage_key.as_ref(); - let faucet_address = - AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(); - let faucet: Faucet = - api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); - - if is_verbose { - println!("address: {}", faucet_address.to_ss58check()); - println!("name: {}", String::from_utf8(faucet.name.to_vec()).unwrap()); - println!( - "creator: {}", - AccountId::decode(&mut faucet.creator.as_ref()).unwrap().to_ss58check() - ); - println!( - "balance: {}", - api.get_account_data(&faucet_address).await.unwrap().unwrap().free - ); - println!("drip amount: {}", faucet.drip_amount); - if let Some(whitelist) = faucet.whitelist { - println!("whitelist:"); - for cid in whitelist.to_vec() { - println!("{}", cid); - } - } else { - println!("whitelist: None"); - } - println!(""); - } else { - println! {"{}", faucet_address}; - } - } - Ok(()) - }) - .into() -} -fn cmd_submit_set_inactivity_timeout_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 inactivity_timeout = matches.inactivity_timeout_arg().unwrap(); - 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::SetInactivityTimeout(inactivity_timeout) - ) - .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: Set inactivity timeout to {inactivity_timeout:?}"); - Ok(()) - }) - .into() -} -fn cmd_list_proposals(_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 at_block = matches.at_block_arg(); - let key_prefix = - api.get_storage_map_key_prefix("EncointerDemocracy", "Proposals").await.unwrap(); - let max_keys = 1000; - let storage_keys = api - .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) - .await - .unwrap(); - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - 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 = - api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); - println!("id: {}", proposal_id); - println!("action: {:?}", proposal.action); - println!("start block: {}", proposal.start); - println!("start cindex: {}", proposal.start_cindex); - println!("state: {:?}", proposal.state); - println!(""); - } - Ok(()) - }) - .into() -} -fn cmd_vote(_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 proposal_id = matches.proposal_id_arg().unwrap(); - let vote_raw = matches.vote_arg().unwrap(); - let vote = match vote_raw { - "aye" => Vote::Aye, - "nay" => Vote::Nay, - &_ => panic!("invalid vote"), - }; - let reputation_vec: Vec = futures::future::join_all( - matches - .reputation_vec_arg() - .ok_or(clap::Error::with_description( - "missing reputation-vec argument", - clap::ErrorKind::MissingRequiredArgument, - ))? - .into_iter() - .map(|rep| { - let api_local = api.clone(); - async move { - let cc: Vec<_> = rep.split("_").collect(); - ( - verify_cid(&api_local, cc[0], None).await, - cc[1].parse::().unwrap(), - ) - } - }), - ) - .await; - let reputation_bvec = ReputationVec::>::try_from(reputation_vec); - - 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", - "vote", - proposal_id, - vote, - reputation_bvec - ) - .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!("Vote submitted: {vote_raw:?} for proposal {proposal_id:?}"); - Ok(()) - }) - .into() -} -fn cmd_update_proposal_state(_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 proposal_id = matches.proposal_id_arg().unwrap(); - 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", "update_proposal_state", proposal_id) - .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 state updated for proposal {proposal_id:?}"); - Ok(()) - }) - .into() -} async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { let url = format!( "{}:{}", From 56709fee78219e7045d3dc991c8c2e9855d3ecd5 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 14:38:11 +0100 Subject: [PATCH 26/41] cargo fix --- .../src/ceremonies.rs | 2 +- client/src/commands/encointer_bazaar.rs | 2 +- client/src/commands/encointer_ceremonies.rs | 2 +- client/src/commands/encointer_communities.rs | 6 +-- client/src/commands/encointer_core.rs | 4 +- client/src/commands/encointer_democracy.rs | 4 +- client/src/commands/encointer_faucet.rs | 6 +-- client/src/commands/frame.rs | 2 +- client/src/main.rs | 39 ++++++++----------- 9 files changed, 31 insertions(+), 36 deletions(-) diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index 95475bf7..e915185d 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -9,7 +9,7 @@ use encointer_primitives::{ }, communities::Location, }; -use futures::stream::{self, StreamExt, TryStreamExt}; +use futures::stream::{self, StreamExt}; use log::warn; use serde::{Deserialize, Serialize}; use sp_runtime::AccountId32 as AccountId; diff --git a/client/src/commands/encointer_bazaar.rs b/client/src/commands/encointer_bazaar.rs index f0da6c88..46e0a06f 100644 --- a/client/src/commands/encointer_bazaar.rs +++ b/client/src/commands/encointer_bazaar.rs @@ -5,7 +5,7 @@ use crate::{ verify_cid, BazaarCalls, }; use clap::ArgMatches; -use encointer_api_client_extension::ExtrinsicAddress; + pub fn create_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/encointer_ceremonies.rs b/client/src/commands/encointer_ceremonies.rs index c3b096f3..63531174 100644 --- a/client/src/commands/encointer_ceremonies.rs +++ b/client/src/commands/encointer_ceremonies.rs @@ -21,7 +21,7 @@ use encointer_primitives::ceremonies::{MeetupIndexType, ParticipantIndexType, Re use encointer_primitives::scheduler::CeremonyPhaseType; use log::{debug, error, info}; use parity_scale_codec::Encode; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; use std::collections::HashMap; use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; diff --git a/client/src/commands/encointer_communities.rs b/client/src/commands/encointer_communities.rs index 6c55609d..740bfc2a 100644 --- a/client/src/commands/encointer_communities.rs +++ b/client/src/commands/encointer_communities.rs @@ -15,12 +15,12 @@ use encointer_api_client_extension::ParentchainExtrinsicSigner; use encointer_api_client_extension::SchedulerApi; use encointer_primitives::scheduler::CeremonyPhaseType; use log::{error, info}; -use parity_scale_codec::{Compact, Decode, Encode}; +use parity_scale_codec::{Decode, Encode}; use sp_application_crypto::Ss58Codec; use sp_core::Pair; use sp_keyring::AccountKeyring; -use substrate_api_client::ac_primitives::SignExtrinsic; -use substrate_api_client::GetStorage; + + pub fn new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/encointer_core.rs b/client/src/commands/encointer_core.rs index 61359dcd..f2fcd856 100644 --- a/client/src/commands/encointer_core.rs +++ b/client/src/commands/encointer_core.rs @@ -15,8 +15,8 @@ use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::Moment; use encointer_primitives::balances::BalanceType; use log::{debug, error, info}; -use parity_scale_codec::{Compact, Decode, Encode}; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use parity_scale_codec::{Encode}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; use std::str::FromStr; use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index cfbeadc8..33cebe3f 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -9,8 +9,8 @@ use encointer_primitives::ceremonies::{CeremonyIndexType, CommunityCeremony}; use encointer_primitives::democracy::ProposalAction; use encointer_primitives::democracy::{Proposal, ProposalIdType, ReputationVec, Vote}; use log::error; -use parity_scale_codec::{Compact, Decode, Encode}; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{sr25519 as sr25519_core, ConstU32, Pair}; use substrate_api_client::ac_compose_macros::compose_extrinsic; use substrate_api_client::GetStorage; use substrate_api_client::SubmitAndWatch; diff --git a/client/src/commands/encointer_faucet.rs b/client/src/commands/encointer_faucet.rs index e7eb1786..e4f68d82 100644 --- a/client/src/commands/encointer_faucet.rs +++ b/client/src/commands/encointer_faucet.rs @@ -6,14 +6,14 @@ use crate::utils::{ }; use crate::{get_chain_api, set_api_extrisic_params_builder, verify_cid}; use clap::ArgMatches; -use encointer_api_client_extension::ExtrinsicAddress; + use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::{AccountId, Balance}; use encointer_primitives::faucet::FromStr; use encointer_primitives::faucet::{Faucet, FaucetNameType, WhiteListType}; use log::{error, info}; -use parity_scale_codec::{Compact, Decode, Encode}; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; use substrate_api_client::GetAccountInformation; diff --git a/client/src/commands/frame.rs b/client/src/commands/frame.rs index bda869b4..22445a6a 100644 --- a/client/src/commands/frame.rs +++ b/client/src/commands/frame.rs @@ -6,7 +6,7 @@ use clap::ArgMatches; use encointer_api_client_extension::ExtrinsicAddress; use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use log::info; -use parity_scale_codec::{Compact, Decode, Encode}; +use parity_scale_codec::{Compact, Encode}; use sp_keyring::AccountKeyring; use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic_offline}; use substrate_api_client::{GetBalance, SubmitAndWatch, XtStatus}; diff --git a/client/src/main.rs b/client/src/main.rs index a8bf0d2f..8d04580b 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -26,62 +26,57 @@ mod utils; use crate::{ community_spec::{ - add_location_call, new_community_call, read_community_spec_from_file, AddLocationCall, CommunitySpec, }, utils::{ - batch_call, collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, - into_effective_cindex, - keys::{get_accountid_from_str, get_pair_from_str, KEYSTORE_PATH, SR25519}, - print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, + ensure_payment, + keys::{get_accountid_from_str, get_pair_from_str}, }, }; use clap::{value_t, AppSettings, Arg, ArgMatches}; use clap_nested::{Command, Commander}; use cli_args::{EncointerArgs, EncointerArgsExtractor}; use encointer_api_client_extension::{ - Api, CeremoniesApi, CommunitiesApi, CommunityCurrencyTip, - CommunityCurrencyTipExtrinsicParamsBuilder, EncointerXt, ExtrinsicAddress, - ParentchainExtrinsicSigner, SchedulerApi, ENCOINTER_CEREMONIES, + Api, CeremoniesApi, CommunityCurrencyTip, + CommunityCurrencyTipExtrinsicParamsBuilder, EncointerXt, + ParentchainExtrinsicSigner, }; use encointer_node_notee_runtime::{ - AccountId, Balance, BalanceEntry, BalanceType, BlockNumber, Hash, Moment, RuntimeEvent, + AccountId, BalanceEntry, BalanceType, BlockNumber, Hash, Moment, RuntimeEvent, Signature, ONE_DAY, }; use encointer_primitives::{ balances::{to_U64F64, Demurrage}, bazaar::{Business, BusinessIdentifier, OfferingData}, ceremonies::{ - ClaimOfAttendance, CommunityCeremony, CommunityReputation, MeetupIndexType, + ClaimOfAttendance, CommunityCeremony, CommunityReputation, ParticipantIndexType, ProofOfAttendance, Reputation, ReputationLifetimeType, }, communities::{CidName, CommunityIdentifier}, - democracy::{Proposal, ProposalAction, ProposalIdType, ReputationVec, Vote}, - faucet::{Faucet, FaucetNameType, FromStr as FaucetNameFromStr, WhiteListType}, + faucet::{FromStr as FaucetNameFromStr}, fixed::transcendental::exp, - scheduler::{CeremonyIndexType, CeremonyPhaseType}, + scheduler::{CeremonyIndexType}, }; -use futures::stream; + use log::*; use pallet_transaction_payment::FeeDetails; -use parity_scale_codec::{Compact, Decode, Encode}; -use sp_application_crypto::{ed25519, sr25519}; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, ConstU32, Pair}; +use parity_scale_codec::{Decode, Encode}; +use sp_application_crypto::{sr25519}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; use sp_keystore::Keystore; use sp_rpc::number::NumberOrHex; use sp_runtime::MultiSignature; -use std::{collections::HashMap, path::PathBuf, str::FromStr}; +use std::{str::FromStr}; use substrate_api_client::{ - ac_compose_macros::{compose_call, compose_extrinsic, compose_extrinsic_offline, rpc_params}, + ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}, ac_primitives::{Bytes, SignExtrinsic}, api::error::Error as ApiClientError, extrinsic::BalancesExtrinsics, - rpc::{JsonrpseeClient, Request}, - GetAccountInformation, GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, + rpc::{JsonrpseeClient, Request}, GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, SubmitAndWatch, SubscribeEvents, XtStatus, }; -use substrate_client_keystore::{KeystoreExt, LocalKeystore}; + const PREFUNDING_NR_OF_TRANSFER_EXTRINSICS: u128 = 1000; const VERSION: &str = env!("CARGO_PKG_VERSION"); From 6d005b82a608adf907985c7f5927d0ad8a9946e2 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 15:41:46 +0100 Subject: [PATCH 27/41] more cleanup of main. distribute helper fn to modules --- client/src/commands/encointer_bazaar.rs | 90 ++- client/src/commands/encointer_ceremonies.rs | 276 +++++++- client/src/commands/encointer_communities.rs | 30 +- client/src/commands/encointer_core.rs | 306 +++++++-- client/src/commands/encointer_democracy.rs | 7 +- client/src/commands/encointer_faucet.rs | 5 +- client/src/commands/encointer_scheduler.rs | 88 +++ client/src/commands/frame.rs | 35 +- client/src/commands/mod.rs | 1 + client/src/main.rs | 643 +------------------ client/src/utils.rs | 16 +- 11 files changed, 774 insertions(+), 723 deletions(-) create mode 100644 client/src/commands/encointer_scheduler.rs diff --git a/client/src/commands/encointer_bazaar.rs b/client/src/commands/encointer_bazaar.rs index 46e0a06f..8c398b8c 100644 --- a/client/src/commands/encointer_bazaar.rs +++ b/client/src/commands/encointer_bazaar.rs @@ -1,11 +1,19 @@ use crate::cli_args::EncointerArgsExtractor; -use crate::utils::keys::get_accountid_from_str; -use crate::{ - get_businesses, get_chain_api, get_offerings, get_offerings_for_business, send_bazaar_xt, - verify_cid, BazaarCalls, -}; +use crate::commands::encointer_core::set_api_extrisic_params_builder; +use crate::commands::encointer_core::verify_cid; +use crate::utils::ensure_payment; +use crate::utils::get_chain_api; +use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; use clap::ArgMatches; - +use encointer_api_client_extension::{Api, EncointerXt, ParentchainExtrinsicSigner}; +use encointer_node_notee_runtime::AccountId; +use encointer_primitives::bazaar::{Business, BusinessIdentifier, OfferingData}; +use encointer_primitives::communities::CommunityIdentifier; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; +use substrate_api_client::ac_compose_macros::{compose_extrinsic, rpc_params}; +use substrate_api_client::rpc::Request; +use substrate_api_client::{SubmitAndWatch, XtStatus}; pub fn create_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); @@ -72,3 +80,73 @@ pub fn list_business_offerings(_args: &str, matches: &ArgMatches<'_>) -> Result< }) .into() } + +#[derive(Clone, Copy, PartialEq, Eq)] +enum BazaarCalls { + CreateBusiness, + UpdateBusiness, + CreateOffering, +} + +impl ToString for BazaarCalls { + fn to_string(&self) -> String { + match self { + BazaarCalls::CreateBusiness => "create_business".to_string(), + BazaarCalls::UpdateBusiness => "update_business".to_string(), + BazaarCalls::CreateOffering => "create_offering".to_string(), + } + } +} + +async fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result<(), ()> { + let business_owner = 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( + business_owner.clone(), + ))); + let cid = + verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; + let ipfs_cid = matches.ipfs_cid_arg().expect("ipfs cid needed"); + + 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, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid) + .unwrap(); + ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; + // send and watch extrinsic until ready + let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); + println!( + "{} for {}. xt-status: '{:?}'", + bazaar_call.to_string(), + business_owner.public(), + report.status + ); + Ok(()) +} +async fn get_businesses(api: &Api, cid: CommunityIdentifier) -> Option>> { + api.client() + .request("encointer_bazaarGetBusinesses", rpc_params![cid]) + .await + .expect("Could not find any businesses...") +} + +async fn get_offerings(api: &Api, cid: CommunityIdentifier) -> Option> { + api.client() + .request("encointer_bazaarGetOfferings", rpc_params![cid]) + .await + .expect("Could not find any business offerings...") +} + +async fn get_offerings_for_business( + api: &Api, + cid: CommunityIdentifier, + account_id: AccountId, +) -> Option> { + let b_id = BusinessIdentifier::new(cid, account_id); + api.client() + .request("encointer_bazaarGetOfferingsForBusiness", rpc_params![b_id]) + .await + .expect("Could not find any business offerings...") +} diff --git a/client/src/commands/encointer_ceremonies.rs b/client/src/commands/encointer_ceremonies.rs index 63531174..f9ea03cf 100644 --- a/client/src/commands/encointer_ceremonies.rs +++ b/client/src/commands/encointer_ceremonies.rs @@ -1,31 +1,38 @@ use crate::cli_args::EncointerArgsExtractor; +use crate::commands::encointer_communities::get_cid_names; +use crate::commands::encointer_core::set_api_extrisic_params_builder; +use crate::commands::encointer_core::verify_cid; +use crate::commands::encointer_scheduler::get_ceremony_index; +use crate::exit_code; +use crate::utils::get_chain_api; use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; use crate::utils::{ collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, into_effective_cindex, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, }; -use crate::{ - endorse_newcomers, exit_code, get_attendees_for_community_ceremony, - get_bootstrappers_with_remaining_newbie_tickets, get_ceremony_index, get_chain_api, - get_cid_names, get_reputation, get_reputation_history, get_reputation_lifetime, new_claim_for, - prove_attendance, set_api_extrisic_params_builder, verify_cid, BootstrapperWithTickets, -}; use clap::ArgMatches; -use encointer_api_client_extension::CeremoniesApi; -use encointer_api_client_extension::SchedulerApi; +use encointer_api_client_extension::{Api, CeremoniesApi}; +use encointer_api_client_extension::{ApiClientError, SchedulerApi}; use encointer_api_client_extension::{ EncointerXt, ParentchainExtrinsicSigner, ENCOINTER_CEREMONIES, }; -use encointer_node_notee_runtime::AccountId; -use encointer_primitives::ceremonies::{MeetupIndexType, ParticipantIndexType, Reputation}; +use encointer_node_notee_runtime::{AccountId, Hash, Moment, Signature, ONE_DAY}; +use encointer_primitives::ceremonies::{ + CeremonyIndexType, ClaimOfAttendance, CommunityCeremony, CommunityReputation, MeetupIndexType, + ParticipantIndexType, ProofOfAttendance, Reputation, ReputationLifetimeType, +}; +use encointer_primitives::communities::CommunityIdentifier; use encointer_primitives::scheduler::CeremonyPhaseType; use log::{debug, error, info}; -use parity_scale_codec::Encode; +use parity_scale_codec::{Decode, Encode}; +use sp_application_crypto::sr25519; use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; +use sp_runtime::MultiSignature; use std::collections::HashMap; -use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; -use substrate_api_client::ac_primitives::SignExtrinsic; +use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}; +use substrate_api_client::ac_primitives::{Bytes, SignExtrinsic}; +use substrate_api_client::rpc::Request; use substrate_api_client::GetStorage; use substrate_api_client::{SubmitAndWatch, XtStatus}; @@ -686,3 +693,246 @@ pub fn purge_community_ceremony(_args: &str, matches: &ArgMatches<'_>) -> Result }) .into() } + +fn prove_attendance( + prover: AccountId, + cid: CommunityIdentifier, + cindex: CeremonyIndexType, + attendee_str: &str, +) -> ProofOfAttendance { + let msg = (prover.clone(), cindex); + let attendee = get_pair_from_str(attendee_str); + let attendeeid = get_accountid_from_str(attendee_str); + debug!("generating proof of attendance for {} and cindex: {}", prover, cindex); + debug!("signature payload is {:x?}", msg.encode()); + ProofOfAttendance { + prover_public: prover, + community_identifier: cid, + ceremony_index: cindex, + attendee_public: attendeeid, + attendee_signature: Signature::from(sr25519_core::Signature::from( + attendee.sign(&msg.encode()), + )), + } +} + +async fn get_reputation( + api: &Api, + prover: &AccountId, + cid: CommunityIdentifier, + cindex: CeremonyIndexType, +) -> Reputation { + api.get_storage_double_map( + "EncointerCeremonies", + "ParticipantReputation", + (cid, cindex), + prover.clone(), + None, + ) + .await + .unwrap() + .unwrap_or(Reputation::Unverified) +} + +async fn get_reputation_history( + api: &Api, + account_id: &AccountId, +) -> Option> { + api.client() + .request("encointer_getReputations", rpc_params![account_id]) + .await + .expect("Could not query reputation history...") +} + +async fn get_attestee_count(api: &Api, key: CommunityCeremony) -> ParticipantIndexType { + api.get_storage_map("EncointerCeremonies", "AttestationCount", key, None) + .await + .unwrap() + .unwrap_or(0) +} + +async fn get_attendees_for_community_ceremony( + api: &Api, + community_ceremony: CommunityCeremony, + at_block: Option, +) -> (Vec, Vec) { + let key_prefix = api + .get_storage_double_map_key_prefix( + "EncointerCeremonies", + "ParticipantReputation", + community_ceremony, + ) + .await + .unwrap(); + let max_keys = 1000; + let storage_keys = api + .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) + .await + .unwrap(); + + if storage_keys.len() == max_keys as usize { + error!("results can be wrong because max keys reached for query") + } + let mut attendees = Vec::new(); + let mut noshows = Vec::new(); + for storage_key in storage_keys.iter() { + match api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap() { + Reputation::VerifiedUnlinked | Reputation::VerifiedLinked(_) => { + let key_postfix = storage_key.as_ref(); + attendees.push( + AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), + ); + }, + Reputation::UnverifiedReputable | Reputation::Unverified => { + let key_postfix = storage_key.as_ref(); + noshows.push( + AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), + ); + }, + } + } + (attendees, noshows) +} + +async fn get_reputation_lifetime(api: &Api, at_block: Option) -> ReputationLifetimeType { + api.get_storage("EncointerCeremonies", "ReputationLifetime", at_block) + .await + .unwrap() + .unwrap_or(5) +} + +async fn get_participant_attestation_index( + api: &Api, + key: CommunityCeremony, + accountid: &AccountId, +) -> Option { + api.get_storage_double_map("EncointerCeremonies", "AttestationIndex", key, accountid, None) + .await + .unwrap() +} + +async fn new_claim_for( + api: &Api, + claimant: &sr25519::Pair, + cid: CommunityIdentifier, + n_participants: u32, +) -> Vec { + let cindex = get_ceremony_index(api, None).await; + let mindex = api + .get_meetup_index(&(cid, cindex), &claimant.public().into()) + .await + .unwrap() + .expect("participant must be assigned to meetup to generate a claim"); + + // implicitly assume that participant meet at the right place at the right time + let mloc = api.get_meetup_location(&(cid, cindex), mindex).await.unwrap().unwrap(); + let mtime = api.get_meetup_time(mloc, ONE_DAY).await.unwrap(); + + info!( + "creating claim for {} at loc {} (lat: {} lon: {}) at time {}, cindex {}", + claimant.public().to_ss58check(), + mindex, + mloc.lat, + mloc.lon, + mtime, + cindex + ); + let claim: ClaimOfAttendance = + ClaimOfAttendance::new_unsigned( + claimant.public().into(), + cindex, + cid, + mindex, + mloc, + mtime, + n_participants, + ) + .sign(claimant); + claim.encode() +} + +async fn endorse_newcomers( + api: &mut Api, + cid: CommunityIdentifier, + matches: &ArgMatches<'_>, +) -> Result<(), ApiClientError> { + let bootstrapper = matches.bootstrapper_arg().map(get_pair_from_str).unwrap(); + let endorsees = matches.endorsees_arg().expect("Please supply at least one endorsee"); + + api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(bootstrapper))); + + let mut nonce = api.get_nonce().await?; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(api, tx_payment_cid_arg).await; + + for e in endorsees.into_iter() { + let endorsee = get_accountid_from_str(e); + + let call = + compose_call!(api.metadata(), "EncointerCeremonies", "endorse_newcomer", cid, endorsee) + .unwrap(); + + let encoded_xt: Bytes = api.compose_extrinsic_offline(call, nonce).encode().into(); + ensure_payment(api, &encoded_xt, tx_payment_cid_arg).await; + let _tx_report = api + .submit_and_watch_opaque_extrinsic_until(&encoded_xt, XtStatus::Ready) + .await + .unwrap(); + + nonce += 1; + } + + Ok(()) +} + +/// Helper type, which is only needed to print the information nicely. +#[derive(Debug)] +struct BootstrapperWithTickets { + bootstrapper: AccountId, + remaining_newbie_tickets: u8, +} + +async fn get_bootstrappers_with_remaining_newbie_tickets( + api: &Api, + cid: CommunityIdentifier, +) -> Result, ApiClientError> { + let total_newbie_tickets: u8 = api + .get_storage("EncointerCeremonies", "EndorsementTicketsPerBootstrapper", None) + .await + .unwrap() + .unwrap(); + + // prepare closure to make below call more readable. + let ticket_query = |bs| async move { + let remaining_tickets = total_newbie_tickets + - api + .get_storage_double_map( + "EncointerCeremonies", + "BurnedBootstrapperNewbieTickets", + cid, + bs, + None, + ) + .await? + .unwrap_or(0u8); + + Ok::<_, ApiClientError>(remaining_tickets) + }; + + let bootstrappers: Vec = api + .get_storage_map("EncointerCommunities", "Bootstrappers", cid, None) + .await? + .expect("No bootstrappers found, does the community exist?"); + + let mut bs_with_tickets: Vec = Vec::with_capacity(bootstrappers.len()); + + for bs in bootstrappers.into_iter() { + bs_with_tickets.push(BootstrapperWithTickets { + bootstrapper: bs.clone(), + remaining_newbie_tickets: ticket_query(bs).await?, + }); + } + + Ok(bs_with_tickets) +} diff --git a/client/src/commands/encointer_communities.rs b/client/src/commands/encointer_communities.rs index 740bfc2a..81322cad 100644 --- a/client/src/commands/encointer_communities.rs +++ b/client/src/commands/encointer_communities.rs @@ -1,26 +1,32 @@ use crate::cli_args::EncointerArgsExtractor; +use crate::commands::encointer_core::set_api_extrisic_params_builder; +use crate::commands::encointer_core::verify_cid; use crate::community_spec::CommunitySpec; use crate::community_spec::{ add_location_call, new_community_call, read_community_spec_from_file, AddLocationCall, }; +use crate::exit_code; +use crate::utils::get_chain_api; use crate::utils::keys::get_pair_from_str; use crate::utils::{ batch_call, collective_propose_call, contains_sudo_pallet, get_councillors, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, }; -use crate::{exit_code, get_chain_api, get_cid_names, set_api_extrisic_params_builder, verify_cid}; use clap::ArgMatches; -use encointer_api_client_extension::CommunitiesApi; use encointer_api_client_extension::ParentchainExtrinsicSigner; use encointer_api_client_extension::SchedulerApi; +use encointer_api_client_extension::{Api, CommunitiesApi}; +use encointer_node_notee_runtime::Hash; +use encointer_primitives::communities::{CidName, CommunityIdentifier}; use encointer_primitives::scheduler::CeremonyPhaseType; use log::{error, info}; use parity_scale_codec::{Decode, Encode}; use sp_application_crypto::Ss58Codec; use sp_core::Pair; use sp_keyring::AccountKeyring; - - +use substrate_api_client::ac_compose_macros::rpc_params; +use substrate_api_client::rpc::Request; +use substrate_api_client::GetStorage; pub fn new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); @@ -192,3 +198,19 @@ pub fn list_locations(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap: }) .into() } + +pub async fn get_community_identifiers( + api: &Api, + maybe_at: Option, +) -> Option> { + api.get_storage("EncointerCommunities", "CommunityIdentifiers", maybe_at) + .await + .unwrap() +} + +/// This rpc needs to have offchain indexing enabled in the node. +pub async fn get_cid_names(api: &Api) -> Option> { + api.client().request("encointer_getAllCommunities", rpc_params![]).await.expect( + "No communities returned. Are you running the node with `--enable-offchain-indexing true`?", + ) +} diff --git a/client/src/commands/encointer_core.rs b/client/src/commands/encointer_core.rs index f2fcd856..c8969136 100644 --- a/client/src/commands/encointer_core.rs +++ b/client/src/commands/encointer_core.rs @@ -1,29 +1,38 @@ use crate::cli_args::EncointerArgsExtractor; +use crate::commands::encointer_communities::get_community_identifiers; +use crate::commands::frame::get_block_number; +use crate::exit_code; +use crate::utils::get_chain_api; use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; use crate::utils::{ collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, }; -use crate::{ - apply_demurrage, exit_code, get_all_balances, get_block_number, get_ceremony_index, - get_chain_api, get_community_balance, get_community_issuance, get_demurrage_per_block, listen, - set_api_extrisic_params_builder, verify_cid, +use clap::{value_t, ArgMatches}; +use encointer_api_client_extension::{ + Api, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, SchedulerApi, }; -use clap::ArgMatches; -use encointer_api_client_extension::SchedulerApi; use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; -use encointer_node_notee_runtime::Moment; -use encointer_primitives::balances::BalanceType; +use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash, Moment, RuntimeEvent}; +use encointer_primitives::balances::{to_U64F64, BalanceEntry, BalanceType, Demurrage}; +use encointer_primitives::ceremonies::CeremonyIndexType; +use encointer_primitives::communities::CommunityIdentifier; +use encointer_primitives::fixed::transcendental::exp; use log::{debug, error, info}; -use parity_scale_codec::{Encode}; +use pallet_transaction_payment::FeeDetails; +use parity_scale_codec::Encode; use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; +use sp_rpc::number::NumberOrHex; use std::str::FromStr; -use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; +use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}; +use substrate_api_client::ac_primitives::Bytes; use substrate_api_client::extrinsic::BalancesExtrinsics; -use substrate_api_client::GetAccountInformation; +use substrate_api_client::rpc::Request; +use substrate_api_client::GetStorage; use substrate_api_client::SubmitAndWatch; use substrate_api_client::XtStatus; +use substrate_api_client::{GetAccountInformation, SubscribeEvents}; pub fn balance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); @@ -182,65 +191,230 @@ pub fn listen_to_events(_args: &str, matches: &ArgMatches<'_>) -> Result<(), cla .into() } -pub fn get_phase(_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; +pub async fn get_community_balance( + api: &Api, + cid_str: &str, + account_id: &AccountId, + maybe_at: Option, +) -> BalanceType { + let cid = verify_cid(api, cid_str, maybe_at).await; + let bn = get_block_number(api, maybe_at).await; + let dr = get_demurrage_per_block(api, cid).await; - // >>>> add some debug info as well - let bn = get_block_number(&api, None).await; - debug!("block number: {}", bn); - let cindex = get_ceremony_index(&api, None).await; - info!("ceremony index: {}", cindex); - let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); - debug!("next phase timestamp: {}", tnext); - // <<<< - - let phase = api.get_current_phase().await.unwrap(); - println!("{phase:?}"); - Ok(()) - }) - .into() + if let Some(entry) = api + .get_storage_double_map("EncointerBalances", "Balance", cid, account_id, maybe_at) + .await + .unwrap() + { + apply_demurrage(entry, bn, dr) + } else { + BalanceType::from_num(0) + } } -pub fn next_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { - let rt = tokio::runtime::Runtime::new().unwrap(); - rt.block_on(async { - let signer = matches.signer_arg().map_or_else( - || AccountKeyring::Alice.pair(), - |signer| get_pair_from_str(signer).into(), - ); - let mut api = get_chain_api(matches).await; - let signer = ParentchainExtrinsicSigner::new(signer); - api.set_signer(signer); - let next_phase_call = - compose_call!(api.metadata(), "EncointerScheduler", "next_phase").unwrap(); - - // return calls as `OpaqueCall`s to get the same return type in both branches - let next_phase_call = if contains_sudo_pallet(api.metadata()) { - let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); - info!("Printing raw sudo call for js/apps:"); - print_raw_call("sudo(next_phase)", &sudo_next_phase_call); - - OpaqueCall::from_tuple(&sudo_next_phase_call) - } else { - let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; - info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); - let propose_next_phase = - collective_propose_call(api.metadata(), threshold, next_phase_call); - print_raw_call("collective_propose(next_phase)", &propose_next_phase); - - OpaqueCall::from_tuple(&propose_next_phase) - }; +pub async fn get_community_issuance( + api: &Api, + cid_str: &str, + maybe_at: Option, +) -> BalanceType { + let cid = verify_cid(api, cid_str, maybe_at).await; + let bn = get_block_number(api, maybe_at).await; + let dr = get_demurrage_per_block(api, cid).await; - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + if let Some(entry) = api + .get_storage_map("EncointerBalances", "TotalIssuance", cid, maybe_at) + .await + .unwrap() + { + apply_demurrage(entry, bn, dr) + } else { + BalanceType::from_num(0) + } +} - send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg).await; +async fn get_demurrage_per_block(api: &Api, cid: CommunityIdentifier) -> Demurrage { + let d: Option = api + .get_storage_map("EncointerBalances", "DemurragePerBlock", cid, None) + .await + .unwrap(); - let phase = api.get_current_phase().await.unwrap(); - println!("Phase is now: {phase:?}"); - Ok(()) - }) - .into() + match d { + Some(d) => { + debug!("Fetched community specific demurrage per block {:?}", &d); + d + }, + None => { + let d = api.get_constant("EncointerBalances", "DefaultDemurrage").await.unwrap(); + debug!("Fetched default demurrage per block {:?}", d); + d + }, + } +} + +async fn get_all_balances( + api: &Api, + account_id: &AccountId, +) -> Option)>> { + api.client() + .request("encointer_getAllBalances", rpc_params![account_id]) + .await + .expect("Could not query all balances...") +} + +pub async fn get_asset_fee_details( + api: &Api, + cid_str: &str, + encoded_xt: &Bytes, +) -> Option> { + let cid = verify_cid(api, cid_str, None).await; + + api.client() + .request("encointer_queryAssetFeeDetails", rpc_params![cid, encoded_xt]) + .await + .expect("Could not query asset fee details") +} +pub fn apply_demurrage( + entry: BalanceEntry, + current_block: BlockNumber, + demurrage_per_block: Demurrage, +) -> BalanceType { + let elapsed_time_block_number = current_block.checked_sub(entry.last_update).unwrap(); + let elapsed_time_u32: u32 = elapsed_time_block_number; + let elapsed_time = Demurrage::from_num(elapsed_time_u32); + let exponent = -demurrage_per_block * elapsed_time; + debug!( + "demurrage per block {}, current_block {}, last {}, elapsed_blocks {}", + demurrage_per_block, current_block, entry.last_update, elapsed_time + ); + let exp_result = exp(exponent).unwrap(); + entry.principal.checked_mul(to_U64F64(exp_result).unwrap()).unwrap() +} + +pub async fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { + let cids = get_community_identifiers(api, maybe_at).await.expect("no community registered"); + let cid = CommunityIdentifier::from_str(cid).unwrap(); + if !cids.contains(&cid) { + panic!("cid {cid} does not exist on chain"); + } + cid +} + +async fn listen(matches: &ArgMatches<'_>) { + let api = get_chain_api(matches).await; + debug!("Subscribing to events"); + let mut subscription = api.subscribe_events().await.unwrap(); + let mut count = 0u32; + let mut blocks = 0u32; + loop { + if matches.is_present("events") + && count >= value_t!(matches.value_of("events"), u32).unwrap() + { + return; + }; + if matches.is_present("blocks") + && blocks > value_t!(matches.value_of("blocks"), u32).unwrap() + { + return; + }; + let event_results = subscription.next_events::().await.unwrap(); + blocks += 1; + match event_results { + Ok(evts) => { + for evr in evts { + debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event); + match &evr.event { + RuntimeEvent::EncointerCeremonies(ee) => { + count += 1; + info!(">>>>>>>>>> ceremony event: {:?}", ee); + match &ee { + pallet_encointer_ceremonies::Event::ParticipantRegistered( + cid, + participant_type, + accountid, + ) => { + println!( + "Participant registered as {participant_type:?}, for cid: {cid:?}, account: {accountid}, " + ); + }, + _ => println!("Unsupported EncointerCommunities event"), + } + }, + RuntimeEvent::EncointerScheduler(ee) => { + count += 1; + info!(">>>>>>>>>> scheduler event: {:?}", ee); + match &ee { + pallet_encointer_scheduler::Event::PhaseChangedTo(phase) => { + println!("Phase changed to: {phase:?}"); + }, + pallet_encointer_scheduler::Event::CeremonySchedulePushedByOneDay => { + println!("Ceremony schedule was pushed by one day"); + }, + } + }, + RuntimeEvent::EncointerCommunities(ee) => { + count += 1; + info!(">>>>>>>>>> community event: {:?}", ee); + match &ee { + pallet_encointer_communities::Event::CommunityRegistered(cid) => { + println!("Community registered: cid: {cid:?}"); + }, + pallet_encointer_communities::Event::MetadataUpdated(cid) => { + println!("Community metadata updated cid: {cid:?}"); + }, + pallet_encointer_communities::Event::NominalIncomeUpdated( + cid, + income, + ) => { + println!( + "Community metadata updated cid: {cid:?}, value: {income:?}" + ); + }, + pallet_encointer_communities::Event::DemurrageUpdated( + cid, + demurrage, + ) => { + println!( + "Community metadata updated cid: {cid:?}, value: {demurrage:?}" + ); + }, + _ => println!("Unsupported EncointerCommunities event"), + } + }, + RuntimeEvent::EncointerBalances(ee) => { + count += 1; + println!(">>>>>>>>>> encointer balances event: {ee:?}"); + }, + RuntimeEvent::EncointerBazaar(ee) => { + count += 1; + println!(">>>>>>>>>> encointer bazaar event: {ee:?}"); + }, + RuntimeEvent::System(ee) => match ee { + frame_system::Event::ExtrinsicFailed { + dispatch_error: _, + dispatch_info: _, + } => { + error!("ExtrinsicFailed: {ee:?}"); + }, + frame_system::Event::ExtrinsicSuccess { dispatch_info } => { + println!("ExtrinsicSuccess: {dispatch_info:?}"); + }, + _ => debug!("ignoring unsupported system Event"), + }, + _ => debug!("ignoring unsupported module event: {:?}", evr.event), + } + } + }, + Err(_) => error!("couldn't decode event record list"), + } + } +} + +pub async fn set_api_extrisic_params_builder(api: &mut Api, tx_payment_cid_arg: Option<&str>) { + let mut tx_params = CommunityCurrencyTipExtrinsicParamsBuilder::new().tip(0); + if let Some(tx_payment_cid) = tx_payment_cid_arg { + tx_params = tx_params.tip( + CommunityCurrencyTip::new(0).of_community(verify_cid(api, tx_payment_cid, None).await), + ); + } + let _ = &api.set_additional_params(tx_params); } diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index 33cebe3f..4e78e4e1 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -1,7 +1,10 @@ use crate::cli_args::EncointerArgsExtractor; +use crate::commands::encointer_core::set_api_extrisic_params_builder; +use crate::commands::encointer_core::verify_cid; +use crate::commands::encointer_scheduler::get_ceremony_index; use crate::utils::ensure_payment; +use crate::utils::get_chain_api; use crate::utils::keys::get_pair_from_str; -use crate::{get_chain_api, set_api_extrisic_params_builder, verify_cid}; use clap::ArgMatches; use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::BlockNumber; @@ -10,7 +13,7 @@ use encointer_primitives::democracy::ProposalAction; use encointer_primitives::democracy::{Proposal, ProposalIdType, ReputationVec, Vote}; use log::error; use parity_scale_codec::{Decode, Encode}; -use sp_core::{sr25519 as sr25519_core, ConstU32, Pair}; +use sp_core::{sr25519 as sr25519_core, ConstU32}; use substrate_api_client::ac_compose_macros::compose_extrinsic; use substrate_api_client::GetStorage; use substrate_api_client::SubmitAndWatch; diff --git a/client/src/commands/encointer_faucet.rs b/client/src/commands/encointer_faucet.rs index e4f68d82..6c161552 100644 --- a/client/src/commands/encointer_faucet.rs +++ b/client/src/commands/encointer_faucet.rs @@ -1,12 +1,13 @@ use crate::cli_args::EncointerArgsExtractor; +use crate::commands::encointer_core::set_api_extrisic_params_builder; +use crate::commands::encointer_core::verify_cid; +use crate::utils::get_chain_api; use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; use crate::utils::{ collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, }; -use crate::{get_chain_api, set_api_extrisic_params_builder, verify_cid}; use clap::ArgMatches; - use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::{AccountId, Balance}; use encointer_primitives::faucet::FromStr; diff --git a/client/src/commands/encointer_scheduler.rs b/client/src/commands/encointer_scheduler.rs new file mode 100644 index 00000000..f71d49ee --- /dev/null +++ b/client/src/commands/encointer_scheduler.rs @@ -0,0 +1,88 @@ +use crate::cli_args::EncointerArgsExtractor; +use crate::commands::encointer_core::set_api_extrisic_params_builder; +use crate::commands::frame::get_block_number; +use crate::utils::keys::get_pair_from_str; +use crate::utils::{ + collective_propose_call, contains_sudo_pallet, get_chain_api, get_councillors, print_raw_call, + send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +}; +use clap::ArgMatches; +use encointer_api_client_extension::SchedulerApi; +use encointer_api_client_extension::{Api, ParentchainExtrinsicSigner}; +use encointer_node_notee_runtime::{Hash, Moment}; +use encointer_primitives::ceremonies::CeremonyIndexType; +use log::{debug, info}; +use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; +use sp_keyring::AccountKeyring; +use substrate_api_client::ac_compose_macros::compose_call; +use substrate_api_client::GetStorage; + +pub fn get_phase(_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; + + // >>>> add some debug info as well + let bn = get_block_number(&api, None).await; + debug!("block number: {}", bn); + let cindex = get_ceremony_index(&api, None).await; + info!("ceremony index: {}", cindex); + let tnext: Moment = api.get_next_phase_timestamp().await.unwrap(); + debug!("next phase timestamp: {}", tnext); + // <<<< + + let phase = api.get_current_phase().await.unwrap(); + println!("{phase:?}"); + Ok(()) + }) + .into() +} +pub fn next_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { + let rt = tokio::runtime::Runtime::new().unwrap(); + rt.block_on(async { + let signer = matches.signer_arg().map_or_else( + || AccountKeyring::Alice.pair(), + |signer| get_pair_from_str(signer).into(), + ); + + let mut api = get_chain_api(matches).await; + let signer = ParentchainExtrinsicSigner::new(signer); + api.set_signer(signer); + let next_phase_call = + compose_call!(api.metadata(), "EncointerScheduler", "next_phase").unwrap(); + + // return calls as `OpaqueCall`s to get the same return type in both branches + let next_phase_call = if contains_sudo_pallet(api.metadata()) { + let sudo_next_phase_call = sudo_call(api.metadata(), next_phase_call); + info!("Printing raw sudo call for js/apps:"); + print_raw_call("sudo(next_phase)", &sudo_next_phase_call); + + OpaqueCall::from_tuple(&sudo_next_phase_call) + } else { + let threshold = (get_councillors(&api).await.unwrap().len() / 2 + 1) as u32; + info!("Printing raw collective propose calls with threshold {} for js/apps", threshold); + let propose_next_phase = + collective_propose_call(api.metadata(), threshold, next_phase_call); + print_raw_call("collective_propose(next_phase)", &propose_next_phase); + + OpaqueCall::from_tuple(&propose_next_phase) + }; + + let tx_payment_cid_arg = matches.tx_payment_cid_arg(); + set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await; + + send_and_wait_for_in_block(&api, xt(&api, next_phase_call).await, tx_payment_cid_arg).await; + + let phase = api.get_current_phase().await.unwrap(); + println!("Phase is now: {phase:?}"); + Ok(()) + }) + .into() +} + +pub async fn get_ceremony_index(api: &Api, at_block: Option) -> CeremonyIndexType { + api.get_storage("EncointerScheduler", "CurrentCeremonyIndex", at_block) + .await + .unwrap() + .unwrap() +} diff --git a/client/src/commands/frame.rs b/client/src/commands/frame.rs index 22445a6a..1898668f 100644 --- a/client/src/commands/frame.rs +++ b/client/src/commands/frame.rs @@ -1,15 +1,20 @@ use crate::cli_args::EncointerArgsExtractor; +use crate::commands::encointer_core::set_api_extrisic_params_builder; use crate::utils::ensure_payment; +use crate::utils::get_chain_api; use crate::utils::keys::get_accountid_from_str; -use crate::{get_chain_api, reasonable_native_balance, set_api_extrisic_params_builder}; +use crate::PREFUNDING_NR_OF_TRANSFER_EXTRINSICS; use clap::ArgMatches; -use encointer_api_client_extension::ExtrinsicAddress; +use encointer_api_client_extension::{Api, ExtrinsicAddress}; use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; -use log::info; +use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash}; +use log::{debug, info}; use parity_scale_codec::{Compact, Encode}; use sp_keyring::AccountKeyring; use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic_offline}; -use substrate_api_client::{GetBalance, SubmitAndWatch, XtStatus}; +use substrate_api_client::extrinsic::BalancesExtrinsics; +use substrate_api_client::GetChainInfo; +use substrate_api_client::{GetBalance, GetTransactionPayment, SubmitAndWatch, XtStatus}; pub fn print_metadata(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); @@ -63,3 +68,25 @@ pub fn faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> }) .into() } + +pub async fn get_block_number(api: &Api, maybe_at: Option) -> BlockNumber { + let hdr = api.get_header(maybe_at).await.unwrap().unwrap(); + debug!("decoded: {:?}", hdr); + //let hdr: Header= Decode::decode(&mut .as_bytes()).unwrap(); + hdr.number +} + +async fn reasonable_native_balance(api: &Api) -> u128 { + let alice: AccountId = AccountKeyring::Alice.into(); + let xt = api.balance_transfer_allow_death(alice.into(), 9999).await.unwrap(); + let fee = api + .get_fee_details(&xt.encode().into(), None) + .await + .unwrap() + .unwrap() + .inclusion_fee + .unwrap() + .base_fee; + let ed = api.get_existential_deposit().await.unwrap(); + ed + fee * PREFUNDING_NR_OF_TRANSFER_EXTRINSICS +} diff --git a/client/src/commands/mod.rs b/client/src/commands/mod.rs index c09bd3a0..97197276 100644 --- a/client/src/commands/mod.rs +++ b/client/src/commands/mod.rs @@ -4,5 +4,6 @@ pub mod encointer_communities; pub mod encointer_core; pub mod encointer_democracy; pub mod encointer_faucet; +pub mod encointer_scheduler; pub mod frame; pub mod keystore; diff --git a/client/src/main.rs b/client/src/main.rs index 8d04580b..67302e15 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -24,60 +24,52 @@ mod commands; mod community_spec; mod utils; -use crate::{ - community_spec::{ - CommunitySpec, - }, - utils::{ - ensure_payment, - keys::{get_accountid_from_str, get_pair_from_str}, - }, +use crate::utils::{ + ensure_payment, + keys::{get_accountid_from_str, get_pair_from_str}, }; use clap::{value_t, AppSettings, Arg, ArgMatches}; use clap_nested::{Command, Commander}; use cli_args::{EncointerArgs, EncointerArgsExtractor}; use encointer_api_client_extension::{ - Api, CeremoniesApi, CommunityCurrencyTip, - CommunityCurrencyTipExtrinsicParamsBuilder, EncointerXt, - ParentchainExtrinsicSigner, + Api, CeremoniesApi, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, + EncointerXt, ParentchainExtrinsicSigner, }; use encointer_node_notee_runtime::{ - AccountId, BalanceEntry, BalanceType, BlockNumber, Hash, Moment, RuntimeEvent, - Signature, ONE_DAY, + AccountId, BalanceEntry, BalanceType, BlockNumber, Hash, Moment, RuntimeEvent, Signature, + ONE_DAY, }; use encointer_primitives::{ balances::{to_U64F64, Demurrage}, bazaar::{Business, BusinessIdentifier, OfferingData}, ceremonies::{ - ClaimOfAttendance, CommunityCeremony, CommunityReputation, - ParticipantIndexType, ProofOfAttendance, Reputation, ReputationLifetimeType, + ClaimOfAttendance, CommunityCeremony, CommunityReputation, ParticipantIndexType, + ProofOfAttendance, Reputation, ReputationLifetimeType, }, communities::{CidName, CommunityIdentifier}, - faucet::{FromStr as FaucetNameFromStr}, fixed::transcendental::exp, - scheduler::{CeremonyIndexType}, + scheduler::CeremonyIndexType, }; use log::*; use pallet_transaction_payment::FeeDetails; use parity_scale_codec::{Decode, Encode}; -use sp_application_crypto::{sr25519}; +use sp_application_crypto::sr25519; use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; -use sp_keystore::Keystore; use sp_rpc::number::NumberOrHex; use sp_runtime::MultiSignature; -use std::{str::FromStr}; +use std::str::FromStr; use substrate_api_client::{ ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}, - ac_primitives::{Bytes, SignExtrinsic}, + ac_primitives::Bytes, api::error::Error as ApiClientError, extrinsic::BalancesExtrinsics, - rpc::{JsonrpseeClient, Request}, GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, - SubmitAndWatch, SubscribeEvents, XtStatus, + rpc::{JsonrpseeClient, Request}, + GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, SubmitAndWatch, SubscribeEvents, + XtStatus, }; - const PREFUNDING_NR_OF_TRANSFER_EXTRINSICS: u128 = 1000; const VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -295,7 +287,7 @@ async fn main() { .add_cmd( Command::new("get-phase") .description("read current ceremony phase from chain") - .runner(commands::encointer_core::get_phase), + .runner(commands::encointer_scheduler::get_phase), ) .add_cmd( Command::new("next-phase") @@ -304,7 +296,7 @@ async fn main() { app.setting(AppSettings::ColoredHelp) .signer_arg("account with necessary privileges (sudo or councillor)") }) - .runner(commands::encointer_core::next_phase), + .runner(commands::encointer_scheduler::next_phase), ) .add_cmd( Command::new("list-participants") @@ -639,602 +631,3 @@ async fn main() { }) .run(); } -////////////////////// -async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { - let url = format!( - "{}:{}", - matches.value_of("node-url").unwrap(), - matches.value_of("node-port").unwrap() - ); - debug!("connecting to {}", url); - let client = JsonrpseeClient::new(&url).await.expect("node URL is incorrect"); - Api::new(client).await.unwrap() -} - -async fn reasonable_native_balance(api: &Api) -> u128 { - let alice: AccountId = AccountKeyring::Alice.into(); - let xt = api.balance_transfer_allow_death(alice.into(), 9999).await.unwrap(); - let fee = api - .get_fee_details(&xt.encode().into(), None) - .await - .unwrap() - .unwrap() - .inclusion_fee - .unwrap() - .base_fee; - let ed = api.get_existential_deposit().await.unwrap(); - ed + fee * PREFUNDING_NR_OF_TRANSFER_EXTRINSICS -} - -async fn listen(matches: &ArgMatches<'_>) { - let api = get_chain_api(matches).await; - debug!("Subscribing to events"); - let mut subscription = api.subscribe_events().await.unwrap(); - let mut count = 0u32; - let mut blocks = 0u32; - loop { - if matches.is_present("events") - && count >= value_t!(matches.value_of("events"), u32).unwrap() - { - return; - }; - if matches.is_present("blocks") - && blocks > value_t!(matches.value_of("blocks"), u32).unwrap() - { - return; - }; - let event_results = subscription.next_events::().await.unwrap(); - blocks += 1; - match event_results { - Ok(evts) => { - for evr in evts { - debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event); - match &evr.event { - RuntimeEvent::EncointerCeremonies(ee) => { - count += 1; - info!(">>>>>>>>>> ceremony event: {:?}", ee); - match &ee { - pallet_encointer_ceremonies::Event::ParticipantRegistered( - cid, - participant_type, - accountid, - ) => { - println!( - "Participant registered as {participant_type:?}, for cid: {cid:?}, account: {accountid}, " - ); - }, - _ => println!("Unsupported EncointerCommunities event"), - } - }, - RuntimeEvent::EncointerScheduler(ee) => { - count += 1; - info!(">>>>>>>>>> scheduler event: {:?}", ee); - match &ee { - pallet_encointer_scheduler::Event::PhaseChangedTo(phase) => { - println!("Phase changed to: {phase:?}"); - }, - pallet_encointer_scheduler::Event::CeremonySchedulePushedByOneDay => { - println!("Ceremony schedule was pushed by one day"); - }, - } - }, - RuntimeEvent::EncointerCommunities(ee) => { - count += 1; - info!(">>>>>>>>>> community event: {:?}", ee); - match &ee { - pallet_encointer_communities::Event::CommunityRegistered(cid) => { - println!("Community registered: cid: {cid:?}"); - }, - pallet_encointer_communities::Event::MetadataUpdated(cid) => { - println!("Community metadata updated cid: {cid:?}"); - }, - pallet_encointer_communities::Event::NominalIncomeUpdated( - cid, - income, - ) => { - println!( - "Community metadata updated cid: {cid:?}, value: {income:?}" - ); - }, - pallet_encointer_communities::Event::DemurrageUpdated( - cid, - demurrage, - ) => { - println!( - "Community metadata updated cid: {cid:?}, value: {demurrage:?}" - ); - }, - _ => println!("Unsupported EncointerCommunities event"), - } - }, - RuntimeEvent::EncointerBalances(ee) => { - count += 1; - println!(">>>>>>>>>> encointer balances event: {ee:?}"); - }, - RuntimeEvent::EncointerBazaar(ee) => { - count += 1; - println!(">>>>>>>>>> encointer bazaar event: {ee:?}"); - }, - RuntimeEvent::System(ee) => match ee { - frame_system::Event::ExtrinsicFailed { - dispatch_error: _, - dispatch_info: _, - } => { - error!("ExtrinsicFailed: {ee:?}"); - }, - frame_system::Event::ExtrinsicSuccess { dispatch_info } => { - println!("ExtrinsicSuccess: {dispatch_info:?}"); - }, - _ => debug!("ignoring unsupported system Event"), - }, - _ => debug!("ignoring unsupported module event: {:?}", evr.event), - } - } - }, - Err(_) => error!("couldn't decode event record list"), - } - } -} - -async fn verify_cid(api: &Api, cid: &str, maybe_at: Option) -> CommunityIdentifier { - let cids = get_community_identifiers(api, maybe_at).await.expect("no community registered"); - let cid = CommunityIdentifier::from_str(cid).unwrap(); - if !cids.contains(&cid) { - panic!("cid {cid} does not exist on chain"); - } - cid -} - -async fn get_block_number(api: &Api, maybe_at: Option) -> BlockNumber { - let hdr = api.get_header(maybe_at).await.unwrap().unwrap(); - debug!("decoded: {:?}", hdr); - //let hdr: Header= Decode::decode(&mut .as_bytes()).unwrap(); - hdr.number -} - -pub async fn get_community_balance( - api: &Api, - cid_str: &str, - account_id: &AccountId, - maybe_at: Option, -) -> BalanceType { - let cid = verify_cid(api, cid_str, maybe_at).await; - let bn = get_block_number(api, maybe_at).await; - let dr = get_demurrage_per_block(api, cid).await; - - if let Some(entry) = api - .get_storage_double_map("EncointerBalances", "Balance", cid, account_id, maybe_at) - .await - .unwrap() - { - apply_demurrage(entry, bn, dr) - } else { - BalanceType::from_num(0) - } -} - -pub async fn get_community_issuance( - api: &Api, - cid_str: &str, - maybe_at: Option, -) -> BalanceType { - let cid = verify_cid(api, cid_str, maybe_at).await; - let bn = get_block_number(api, maybe_at).await; - let dr = get_demurrage_per_block(api, cid).await; - - if let Some(entry) = api - .get_storage_map("EncointerBalances", "TotalIssuance", cid, maybe_at) - .await - .unwrap() - { - apply_demurrage(entry, bn, dr) - } else { - BalanceType::from_num(0) - } -} - -async fn get_demurrage_per_block(api: &Api, cid: CommunityIdentifier) -> Demurrage { - let d: Option = api - .get_storage_map("EncointerBalances", "DemurragePerBlock", cid, None) - .await - .unwrap(); - - match d { - Some(d) => { - debug!("Fetched community specific demurrage per block {:?}", &d); - d - }, - None => { - let d = api.get_constant("EncointerBalances", "DefaultDemurrage").await.unwrap(); - debug!("Fetched default demurrage per block {:?}", d); - d - }, - } -} - -async fn get_ceremony_index(api: &Api, at_block: Option) -> CeremonyIndexType { - api.get_storage("EncointerScheduler", "CurrentCeremonyIndex", at_block) - .await - .unwrap() - .unwrap() -} - -async fn get_attestee_count(api: &Api, key: CommunityCeremony) -> ParticipantIndexType { - api.get_storage_map("EncointerCeremonies", "AttestationCount", key, None) - .await - .unwrap() - .unwrap_or(0) -} - -async fn get_attendees_for_community_ceremony( - api: &Api, - community_ceremony: CommunityCeremony, - at_block: Option, -) -> (Vec, Vec) { - let key_prefix = api - .get_storage_double_map_key_prefix( - "EncointerCeremonies", - "ParticipantReputation", - community_ceremony, - ) - .await - .unwrap(); - let max_keys = 1000; - let storage_keys = api - .get_storage_keys_paged(Some(key_prefix), max_keys, None, at_block) - .await - .unwrap(); - - if storage_keys.len() == max_keys as usize { - error!("results can be wrong because max keys reached for query") - } - let mut attendees = Vec::new(); - let mut noshows = Vec::new(); - for storage_key in storage_keys.iter() { - match api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap() { - Reputation::VerifiedUnlinked | Reputation::VerifiedLinked(_) => { - let key_postfix = storage_key.as_ref(); - attendees.push( - AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), - ); - }, - Reputation::UnverifiedReputable | Reputation::Unverified => { - let key_postfix = storage_key.as_ref(); - noshows.push( - AccountId::decode(&mut key_postfix[key_postfix.len() - 32..].as_ref()).unwrap(), - ); - }, - } - } - (attendees, noshows) -} - -async fn get_reputation_lifetime(api: &Api, at_block: Option) -> ReputationLifetimeType { - api.get_storage("EncointerCeremonies", "ReputationLifetime", at_block) - .await - .unwrap() - .unwrap_or(5) -} - -async fn get_participant_attestation_index( - api: &Api, - key: CommunityCeremony, - accountid: &AccountId, -) -> Option { - api.get_storage_double_map("EncointerCeremonies", "AttestationIndex", key, accountid, None) - .await - .unwrap() -} - -async fn new_claim_for( - api: &Api, - claimant: &sr25519::Pair, - cid: CommunityIdentifier, - n_participants: u32, -) -> Vec { - let cindex = get_ceremony_index(api, None).await; - let mindex = api - .get_meetup_index(&(cid, cindex), &claimant.public().into()) - .await - .unwrap() - .expect("participant must be assigned to meetup to generate a claim"); - - // implicitly assume that participant meet at the right place at the right time - let mloc = api.get_meetup_location(&(cid, cindex), mindex).await.unwrap().unwrap(); - let mtime = api.get_meetup_time(mloc, ONE_DAY).await.unwrap(); - - info!( - "creating claim for {} at loc {} (lat: {} lon: {}) at time {}, cindex {}", - claimant.public().to_ss58check(), - mindex, - mloc.lat, - mloc.lon, - mtime, - cindex - ); - let claim: ClaimOfAttendance = - ClaimOfAttendance::new_unsigned( - claimant.public().into(), - cindex, - cid, - mindex, - mloc, - mtime, - n_participants, - ) - .sign(claimant); - claim.encode() -} - -async fn get_community_identifiers( - api: &Api, - maybe_at: Option, -) -> Option> { - api.get_storage("EncointerCommunities", "CommunityIdentifiers", maybe_at) - .await - .unwrap() -} - -/// This rpc needs to have offchain indexing enabled in the node. -async fn get_cid_names(api: &Api) -> Option> { - api.client().request("encointer_getAllCommunities", rpc_params![]).await.expect( - "No communities returned. Are you running the node with `--enable-offchain-indexing true`?", - ) -} - -async fn get_businesses(api: &Api, cid: CommunityIdentifier) -> Option>> { - api.client() - .request("encointer_bazaarGetBusinesses", rpc_params![cid]) - .await - .expect("Could not find any businesses...") -} - -async fn get_offerings(api: &Api, cid: CommunityIdentifier) -> Option> { - api.client() - .request("encointer_bazaarGetOfferings", rpc_params![cid]) - .await - .expect("Could not find any business offerings...") -} - -async fn get_offerings_for_business( - api: &Api, - cid: CommunityIdentifier, - account_id: AccountId, -) -> Option> { - let b_id = BusinessIdentifier::new(cid, account_id); - api.client() - .request("encointer_bazaarGetOfferingsForBusiness", rpc_params![b_id]) - .await - .expect("Could not find any business offerings...") -} - -async fn get_reputation_history( - api: &Api, - account_id: &AccountId, -) -> Option> { - api.client() - .request("encointer_getReputations", rpc_params![account_id]) - .await - .expect("Could not query reputation history...") -} - -async fn get_all_balances( - api: &Api, - account_id: &AccountId, -) -> Option)>> { - api.client() - .request("encointer_getAllBalances", rpc_params![account_id]) - .await - .expect("Could not query all balances...") -} - -async fn get_asset_fee_details( - api: &Api, - cid_str: &str, - encoded_xt: &Bytes, -) -> Option> { - let cid = verify_cid(api, cid_str, None).await; - - api.client() - .request("encointer_queryAssetFeeDetails", rpc_params![cid, encoded_xt]) - .await - .expect("Could not query asset fee details") -} - -fn prove_attendance( - prover: AccountId, - cid: CommunityIdentifier, - cindex: CeremonyIndexType, - attendee_str: &str, -) -> ProofOfAttendance { - let msg = (prover.clone(), cindex); - let attendee = get_pair_from_str(attendee_str); - let attendeeid = get_accountid_from_str(attendee_str); - debug!("generating proof of attendance for {} and cindex: {}", prover, cindex); - debug!("signature payload is {:x?}", msg.encode()); - ProofOfAttendance { - prover_public: prover, - community_identifier: cid, - ceremony_index: cindex, - attendee_public: attendeeid, - attendee_signature: Signature::from(sr25519_core::Signature::from( - attendee.sign(&msg.encode()), - )), - } -} - -async fn get_reputation( - api: &Api, - prover: &AccountId, - cid: CommunityIdentifier, - cindex: CeremonyIndexType, -) -> Reputation { - api.get_storage_double_map( - "EncointerCeremonies", - "ParticipantReputation", - (cid, cindex), - prover.clone(), - None, - ) - .await - .unwrap() - .unwrap_or(Reputation::Unverified) -} - -fn apply_demurrage( - entry: BalanceEntry, - current_block: BlockNumber, - demurrage_per_block: Demurrage, -) -> BalanceType { - let elapsed_time_block_number = current_block.checked_sub(entry.last_update).unwrap(); - let elapsed_time_u32: u32 = elapsed_time_block_number; - let elapsed_time = Demurrage::from_num(elapsed_time_u32); - let exponent = -demurrage_per_block * elapsed_time; - debug!( - "demurrage per block {}, current_block {}, last {}, elapsed_blocks {}", - demurrage_per_block, current_block, entry.last_update, elapsed_time - ); - let exp_result = exp(exponent).unwrap(); - entry.principal.checked_mul(to_U64F64(exp_result).unwrap()).unwrap() -} - -async fn send_bazaar_xt(matches: &ArgMatches<'_>, bazaar_call: &BazaarCalls) -> Result<(), ()> { - let business_owner = 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( - business_owner.clone(), - ))); - let cid = - verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; - let ipfs_cid = matches.ipfs_cid_arg().expect("ipfs cid needed"); - - 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, "EncointerBazaar", &bazaar_call.to_string(), cid, ipfs_cid) - .unwrap(); - ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; - // send and watch extrinsic until ready - let report = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); - println!( - "{} for {}. xt-status: '{:?}'", - bazaar_call.to_string(), - business_owner.public(), - report.status - ); - Ok(()) -} - -async fn endorse_newcomers( - api: &mut Api, - cid: CommunityIdentifier, - matches: &ArgMatches<'_>, -) -> Result<(), ApiClientError> { - let bootstrapper = matches.bootstrapper_arg().map(get_pair_from_str).unwrap(); - let endorsees = matches.endorsees_arg().expect("Please supply at least one endorsee"); - - api.set_signer(ParentchainExtrinsicSigner::new(sr25519_core::Pair::from(bootstrapper))); - - let mut nonce = api.get_nonce().await?; - - let tx_payment_cid_arg = matches.tx_payment_cid_arg(); - set_api_extrisic_params_builder(api, tx_payment_cid_arg).await; - - for e in endorsees.into_iter() { - let endorsee = get_accountid_from_str(e); - - let call = - compose_call!(api.metadata(), "EncointerCeremonies", "endorse_newcomer", cid, endorsee) - .unwrap(); - - let encoded_xt: Bytes = api.compose_extrinsic_offline(call, nonce).encode().into(); - ensure_payment(api, &encoded_xt, tx_payment_cid_arg).await; - let _tx_report = api - .submit_and_watch_opaque_extrinsic_until(&encoded_xt, XtStatus::Ready) - .await - .unwrap(); - - nonce += 1; - } - - Ok(()) -} - -/// Helper type, which is only needed to print the information nicely. -#[derive(Debug)] -struct BootstrapperWithTickets { - bootstrapper: AccountId, - remaining_newbie_tickets: u8, -} - -async fn get_bootstrappers_with_remaining_newbie_tickets( - api: &Api, - cid: CommunityIdentifier, -) -> Result, ApiClientError> { - let total_newbie_tickets: u8 = api - .get_storage("EncointerCeremonies", "EndorsementTicketsPerBootstrapper", None) - .await - .unwrap() - .unwrap(); - - // prepare closure to make below call more readable. - let ticket_query = |bs| async move { - let remaining_tickets = total_newbie_tickets - - api - .get_storage_double_map( - "EncointerCeremonies", - "BurnedBootstrapperNewbieTickets", - cid, - bs, - None, - ) - .await? - .unwrap_or(0u8); - - Ok::<_, ApiClientError>(remaining_tickets) - }; - - let bootstrappers: Vec = api - .get_storage_map("EncointerCommunities", "Bootstrappers", cid, None) - .await? - .expect("No bootstrappers found, does the community exist?"); - - let mut bs_with_tickets: Vec = Vec::with_capacity(bootstrappers.len()); - - for bs in bootstrappers.into_iter() { - bs_with_tickets.push(BootstrapperWithTickets { - bootstrapper: bs.clone(), - remaining_newbie_tickets: ticket_query(bs).await?, - }); - } - - Ok(bs_with_tickets) -} - -#[derive(Clone, Copy, PartialEq, Eq)] -enum BazaarCalls { - CreateBusiness, - UpdateBusiness, - CreateOffering, -} - -impl ToString for BazaarCalls { - fn to_string(&self) -> String { - match self { - BazaarCalls::CreateBusiness => "create_business".to_string(), - BazaarCalls::UpdateBusiness => "update_business".to_string(), - BazaarCalls::CreateOffering => "create_offering".to_string(), - } - } -} - -async fn set_api_extrisic_params_builder(api: &mut Api, tx_payment_cid_arg: Option<&str>) { - let mut tx_params = CommunityCurrencyTipExtrinsicParamsBuilder::new().tip(0); - if let Some(tx_payment_cid) = tx_payment_cid_arg { - tx_params = tx_params.tip( - CommunityCurrencyTip::new(0).of_community(verify_cid(api, tx_payment_cid, None).await), - ); - } - let _ = &api.set_additional_params(tx_params); -} diff --git a/client/src/utils.rs b/client/src/utils.rs index 6d914d95..d4b4986f 100644 --- a/client/src/utils.rs +++ b/client/src/utils.rs @@ -1,4 +1,6 @@ -use crate::{exit_code, get_asset_fee_details, get_community_balance, BalanceType}; +use crate::commands::encointer_core::{get_asset_fee_details, get_community_balance}; +use crate::{exit_code, BalanceType}; +use clap::ArgMatches; use encointer_api_client_extension::{Api, EncointerXt}; use encointer_node_notee_runtime::AccountId; use encointer_primitives::{balances::EncointerBalanceConverter, scheduler::CeremonyIndexType}; @@ -6,6 +8,7 @@ use log::{debug, error, info}; use parity_scale_codec::{Compact, Encode}; use sp_core::H256; use sp_runtime::traits::Convert; +use substrate_api_client::rpc::JsonrpseeClient; use substrate_api_client::{ ac_compose_macros::compose_call, ac_node_api::Metadata, @@ -14,6 +17,17 @@ use substrate_api_client::{ GetAccountInformation, GetBalance, GetTransactionPayment, Result, SubmitAndWatch, XtStatus, }; +pub async fn get_chain_api(matches: &ArgMatches<'_>) -> Api { + let url = format!( + "{}:{}", + matches.value_of("node-url").unwrap(), + matches.value_of("node-port").unwrap() + ); + debug!("connecting to {}", url); + let client = JsonrpseeClient::new(&url).await.expect("node URL is incorrect"); + Api::new(client).await.unwrap() +} + /// Creates a signed extrinsic from a call /// /// Panics if no signer is set. From 2d52472957944d6d10e7b548d7fd754af0920d8b Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 15:44:08 +0100 Subject: [PATCH 28/41] cargo fix --- client/src/commands/encointer_bazaar.rs | 4 +- client/src/commands/encointer_core.rs | 13 +++-- client/src/commands/encointer_democracy.rs | 2 +- client/src/commands/encointer_scheduler.rs | 2 +- client/src/main.rs | 55 ++++++---------------- 5 files changed, 25 insertions(+), 51 deletions(-) diff --git a/client/src/commands/encointer_bazaar.rs b/client/src/commands/encointer_bazaar.rs index 8c398b8c..cc07812b 100644 --- a/client/src/commands/encointer_bazaar.rs +++ b/client/src/commands/encointer_bazaar.rs @@ -9,8 +9,8 @@ use encointer_api_client_extension::{Api, EncointerXt, ParentchainExtrinsicSigne use encointer_node_notee_runtime::AccountId; use encointer_primitives::bazaar::{Business, BusinessIdentifier, OfferingData}; use encointer_primitives::communities::CommunityIdentifier; -use parity_scale_codec::{Decode, Encode}; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; +use parity_scale_codec::{Encode}; +use sp_core::{sr25519 as sr25519_core, Pair}; use substrate_api_client::ac_compose_macros::{compose_extrinsic, rpc_params}; use substrate_api_client::rpc::Request; use substrate_api_client::{SubmitAndWatch, XtStatus}; diff --git a/client/src/commands/encointer_core.rs b/client/src/commands/encointer_core.rs index c8969136..a7857cac 100644 --- a/client/src/commands/encointer_core.rs +++ b/client/src/commands/encointer_core.rs @@ -5,27 +5,26 @@ use crate::exit_code; use crate::utils::get_chain_api; use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; use crate::utils::{ - collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, print_raw_call, - send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, + ensure_payment, }; use clap::{value_t, ArgMatches}; use encointer_api_client_extension::{ - Api, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, SchedulerApi, + Api, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, }; use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; -use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash, Moment, RuntimeEvent}; +use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash, RuntimeEvent}; use encointer_primitives::balances::{to_U64F64, BalanceEntry, BalanceType, Demurrage}; -use encointer_primitives::ceremonies::CeremonyIndexType; + use encointer_primitives::communities::CommunityIdentifier; use encointer_primitives::fixed::transcendental::exp; use log::{debug, error, info}; use pallet_transaction_payment::FeeDetails; use parity_scale_codec::Encode; use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; -use sp_keyring::AccountKeyring; + use sp_rpc::number::NumberOrHex; use std::str::FromStr; -use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}; +use substrate_api_client::ac_compose_macros::{compose_extrinsic, rpc_params}; use substrate_api_client::ac_primitives::Bytes; use substrate_api_client::extrinsic::BalancesExtrinsics; use substrate_api_client::rpc::Request; diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index 4e78e4e1..b76ba912 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -1,7 +1,7 @@ use crate::cli_args::EncointerArgsExtractor; use crate::commands::encointer_core::set_api_extrisic_params_builder; use crate::commands::encointer_core::verify_cid; -use crate::commands::encointer_scheduler::get_ceremony_index; + use crate::utils::ensure_payment; use crate::utils::get_chain_api; use crate::utils::keys::get_pair_from_str; diff --git a/client/src/commands/encointer_scheduler.rs b/client/src/commands/encointer_scheduler.rs index f71d49ee..56b2df91 100644 --- a/client/src/commands/encointer_scheduler.rs +++ b/client/src/commands/encointer_scheduler.rs @@ -12,7 +12,7 @@ use encointer_api_client_extension::{Api, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::{Hash, Moment}; use encointer_primitives::ceremonies::CeremonyIndexType; use log::{debug, info}; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; + use sp_keyring::AccountKeyring; use substrate_api_client::ac_compose_macros::compose_call; use substrate_api_client::GetStorage; diff --git a/client/src/main.rs b/client/src/main.rs index 67302e15..b2b30083 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -24,51 +24,26 @@ mod commands; mod community_spec; mod utils; -use crate::utils::{ - ensure_payment, - keys::{get_accountid_from_str, get_pair_from_str}, -}; -use clap::{value_t, AppSettings, Arg, ArgMatches}; + +use clap::{AppSettings, Arg}; use clap_nested::{Command, Commander}; use cli_args::{EncointerArgs, EncointerArgsExtractor}; -use encointer_api_client_extension::{ - Api, CeremoniesApi, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, - EncointerXt, ParentchainExtrinsicSigner, -}; + use encointer_node_notee_runtime::{ - AccountId, BalanceEntry, BalanceType, BlockNumber, Hash, Moment, RuntimeEvent, Signature, - ONE_DAY, -}; -use encointer_primitives::{ - balances::{to_U64F64, Demurrage}, - bazaar::{Business, BusinessIdentifier, OfferingData}, - ceremonies::{ - ClaimOfAttendance, CommunityCeremony, CommunityReputation, ParticipantIndexType, - ProofOfAttendance, Reputation, ReputationLifetimeType, - }, - communities::{CidName, CommunityIdentifier}, - fixed::transcendental::exp, - scheduler::CeremonyIndexType, + BalanceType, }; -use log::*; -use pallet_transaction_payment::FeeDetails; -use parity_scale_codec::{Decode, Encode}; -use sp_application_crypto::sr25519; -use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; -use sp_keyring::AccountKeyring; -use sp_rpc::number::NumberOrHex; -use sp_runtime::MultiSignature; -use std::str::FromStr; -use substrate_api_client::{ - ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}, - ac_primitives::Bytes, - api::error::Error as ApiClientError, - extrinsic::BalancesExtrinsics, - rpc::{JsonrpseeClient, Request}, - GetBalance, GetChainInfo, GetStorage, GetTransactionPayment, SubmitAndWatch, SubscribeEvents, - XtStatus, -}; + + + + + + + + + + + const PREFUNDING_NR_OF_TRANSFER_EXTRINSICS: u128 = 1000; const VERSION: &str = env!("CARGO_PKG_VERSION"); From 930a18f5726a9c34e499787d673443d1adb430c2 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 15:53:51 +0100 Subject: [PATCH 29/41] fmt +nightly --- client/src/commands/encointer_bazaar.rs | 30 +++--- client/src/commands/encointer_ceremonies.rs | 102 ++++++++++--------- client/src/commands/encointer_communities.rs | 42 ++++---- client/src/commands/encointer_core.rs | 38 ++++--- client/src/commands/encointer_democracy.rs | 25 +++-- client/src/commands/encointer_faucet.rs | 29 +++--- client/src/commands/encointer_scheduler.rs | 21 ++-- client/src/commands/frame.rs | 26 ++--- client/src/commands/keystore.rs | 12 +-- client/src/main.rs | 17 +--- client/src/utils.rs | 8 +- 11 files changed, 171 insertions(+), 179 deletions(-) diff --git a/client/src/commands/encointer_bazaar.rs b/client/src/commands/encointer_bazaar.rs index cc07812b..c4568fa7 100644 --- a/client/src/commands/encointer_bazaar.rs +++ b/client/src/commands/encointer_bazaar.rs @@ -1,19 +1,25 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_core::set_api_extrisic_params_builder; -use crate::commands::encointer_core::verify_cid; -use crate::utils::ensure_payment; -use crate::utils::get_chain_api; -use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, + utils::{ + ensure_payment, get_chain_api, + keys::{get_accountid_from_str, get_pair_from_str}, + }, +}; use clap::ArgMatches; use encointer_api_client_extension::{Api, EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::AccountId; -use encointer_primitives::bazaar::{Business, BusinessIdentifier, OfferingData}; -use encointer_primitives::communities::CommunityIdentifier; -use parity_scale_codec::{Encode}; +use encointer_primitives::{ + bazaar::{Business, BusinessIdentifier, OfferingData}, + communities::CommunityIdentifier, +}; +use parity_scale_codec::Encode; use sp_core::{sr25519 as sr25519_core, Pair}; -use substrate_api_client::ac_compose_macros::{compose_extrinsic, rpc_params}; -use substrate_api_client::rpc::Request; -use substrate_api_client::{SubmitAndWatch, XtStatus}; +use substrate_api_client::{ + ac_compose_macros::{compose_extrinsic, rpc_params}, + rpc::Request, + SubmitAndWatch, XtStatus, +}; pub fn create_business(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/encointer_ceremonies.rs b/client/src/commands/encointer_ceremonies.rs index f9ea03cf..d468ffbf 100644 --- a/client/src/commands/encointer_ceremonies.rs +++ b/client/src/commands/encointer_ceremonies.rs @@ -1,28 +1,33 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_communities::get_cid_names; -use crate::commands::encointer_core::set_api_extrisic_params_builder; -use crate::commands::encointer_core::verify_cid; -use crate::commands::encointer_scheduler::get_ceremony_index; -use crate::exit_code; -use crate::utils::get_chain_api; -use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; -use crate::utils::{ - collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, - into_effective_cindex, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +use crate::{ + cli_args::EncointerArgsExtractor, + commands::{ + encointer_communities::get_cid_names, + encointer_core::{set_api_extrisic_params_builder, verify_cid}, + encointer_scheduler::get_ceremony_index, + }, + exit_code, + utils::{ + collective_propose_call, contains_sudo_pallet, ensure_payment, get_chain_api, + get_councillors, into_effective_cindex, + keys::{get_accountid_from_str, get_pair_from_str}, + print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, + }, }; use clap::ArgMatches; -use encointer_api_client_extension::{Api, CeremoniesApi}; -use encointer_api_client_extension::{ApiClientError, SchedulerApi}; use encointer_api_client_extension::{ - EncointerXt, ParentchainExtrinsicSigner, ENCOINTER_CEREMONIES, + Api, ApiClientError, CeremoniesApi, EncointerXt, ParentchainExtrinsicSigner, SchedulerApi, + ENCOINTER_CEREMONIES, }; use encointer_node_notee_runtime::{AccountId, Hash, Moment, Signature, ONE_DAY}; -use encointer_primitives::ceremonies::{ - CeremonyIndexType, ClaimOfAttendance, CommunityCeremony, CommunityReputation, MeetupIndexType, - ParticipantIndexType, ProofOfAttendance, Reputation, ReputationLifetimeType, +use encointer_primitives::{ + ceremonies::{ + CeremonyIndexType, ClaimOfAttendance, CommunityCeremony, CommunityReputation, + MeetupIndexType, ParticipantIndexType, ProofOfAttendance, Reputation, + ReputationLifetimeType, + }, + communities::CommunityIdentifier, + scheduler::CeremonyPhaseType, }; -use encointer_primitives::communities::CommunityIdentifier; -use encointer_primitives::scheduler::CeremonyPhaseType; use log::{debug, error, info}; use parity_scale_codec::{Decode, Encode}; use sp_application_crypto::sr25519; @@ -30,11 +35,12 @@ use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; use sp_runtime::MultiSignature; use std::collections::HashMap; -use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}; -use substrate_api_client::ac_primitives::{Bytes, SignExtrinsic}; -use substrate_api_client::rpc::Request; -use substrate_api_client::GetStorage; -use substrate_api_client::{SubmitAndWatch, XtStatus}; +use substrate_api_client::{ + ac_compose_macros::{compose_call, compose_extrinsic, rpc_params}, + ac_primitives::{Bytes, SignExtrinsic}, + rpc::Request, + GetStorage, SubmitAndWatch, XtStatus, +}; pub fn list_participants(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); @@ -248,8 +254,8 @@ pub fn upgrade_registration(_args: &str, matches: &ArgMatches<'_>) -> Result<(), verify_cid(&api, matches.cid_arg().expect("please supply argument --cid"), None).await; let current_phase = api.get_current_phase().await.unwrap(); - if !(current_phase == CeremonyPhaseType::Registering - || current_phase == CeremonyPhaseType::Attesting) + if !(current_phase == CeremonyPhaseType::Registering || + current_phase == CeremonyPhaseType::Attesting) { error!("wrong ceremony phase for registering participant"); std::process::exit(exit_code::WRONG_PHASE); @@ -261,9 +267,8 @@ pub fn upgrade_registration(_args: &str, matches: &ArgMatches<'_>) -> Result<(), let rep = get_reputation(&api, &accountid, cid, reputation_cindex).await; info!("{} has reputation {:?}", accountid, rep); let proof = match rep { - Reputation::VerifiedUnlinked => { - prove_attendance(accountid, cid, reputation_cindex, arg_who) - }, + Reputation::VerifiedUnlinked => + prove_attendance(accountid, cid, reputation_cindex, arg_who), _ => { error!("No valid reputation in last ceremony."); std::process::exit(exit_code::INVALID_REPUTATION); @@ -307,17 +312,15 @@ pub fn register_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<(), let proof = match rep { Reputation::Unverified => None, Reputation::UnverifiedReputable => None, // this should never be the case during Registering! - Reputation::VerifiedUnlinked => { - Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) - }, - Reputation::VerifiedLinked(_) => { - Some(prove_attendance(accountid, cid, cindex - 1, arg_who)) - }, + Reputation::VerifiedUnlinked => + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), + Reputation::VerifiedLinked(_) => + Some(prove_attendance(accountid, cid, cindex - 1, arg_who)), }; debug!("proof: {:x?}", proof.encode()); let current_phase = api.get_current_phase().await.unwrap(); - if !(current_phase == CeremonyPhaseType::Registering - || current_phase == CeremonyPhaseType::Attesting) + if !(current_phase == CeremonyPhaseType::Registering || + current_phase == CeremonyPhaseType::Attesting) { error!("wrong ceremony phase for registering participant"); std::process::exit(exit_code::WRONG_PHASE); @@ -364,8 +367,8 @@ pub fn unregister_participant(_args: &str, matches: &ArgMatches<'_>) -> Result<( }; let current_phase = api.get_current_phase().await.unwrap(); - if !(current_phase == CeremonyPhaseType::Registering - || current_phase == CeremonyPhaseType::Attesting) + if !(current_phase == CeremonyPhaseType::Registering || + current_phase == CeremonyPhaseType::Attesting) { error!("wrong ceremony phase for unregistering"); std::process::exit(exit_code::WRONG_PHASE); @@ -905,17 +908,16 @@ async fn get_bootstrappers_with_remaining_newbie_tickets( // prepare closure to make below call more readable. let ticket_query = |bs| async move { - let remaining_tickets = total_newbie_tickets - - api - .get_storage_double_map( - "EncointerCeremonies", - "BurnedBootstrapperNewbieTickets", - cid, - bs, - None, - ) - .await? - .unwrap_or(0u8); + let remaining_tickets = total_newbie_tickets - + api.get_storage_double_map( + "EncointerCeremonies", + "BurnedBootstrapperNewbieTickets", + cid, + bs, + None, + ) + .await? + .unwrap_or(0u8); Ok::<_, ApiClientError>(remaining_tickets) }; diff --git a/client/src/commands/encointer_communities.rs b/client/src/commands/encointer_communities.rs index 81322cad..ccf3b84e 100644 --- a/client/src/commands/encointer_communities.rs +++ b/client/src/commands/encointer_communities.rs @@ -1,32 +1,32 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_core::set_api_extrisic_params_builder; -use crate::commands::encointer_core::verify_cid; -use crate::community_spec::CommunitySpec; -use crate::community_spec::{ - add_location_call, new_community_call, read_community_spec_from_file, AddLocationCall, -}; -use crate::exit_code; -use crate::utils::get_chain_api; -use crate::utils::keys::get_pair_from_str; -use crate::utils::{ - batch_call, collective_propose_call, contains_sudo_pallet, get_councillors, print_raw_call, - send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, + community_spec::{ + add_location_call, new_community_call, read_community_spec_from_file, AddLocationCall, + CommunitySpec, + }, + exit_code, + utils::{ + batch_call, collective_propose_call, contains_sudo_pallet, get_chain_api, get_councillors, + keys::get_pair_from_str, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, + OpaqueCall, + }, }; use clap::ArgMatches; -use encointer_api_client_extension::ParentchainExtrinsicSigner; -use encointer_api_client_extension::SchedulerApi; -use encointer_api_client_extension::{Api, CommunitiesApi}; +use encointer_api_client_extension::{ + Api, CommunitiesApi, ParentchainExtrinsicSigner, SchedulerApi, +}; use encointer_node_notee_runtime::Hash; -use encointer_primitives::communities::{CidName, CommunityIdentifier}; -use encointer_primitives::scheduler::CeremonyPhaseType; +use encointer_primitives::{ + communities::{CidName, CommunityIdentifier}, + scheduler::CeremonyPhaseType, +}; use log::{error, info}; use parity_scale_codec::{Decode, Encode}; use sp_application_crypto::Ss58Codec; use sp_core::Pair; use sp_keyring::AccountKeyring; -use substrate_api_client::ac_compose_macros::rpc_params; -use substrate_api_client::rpc::Request; -use substrate_api_client::GetStorage; +use substrate_api_client::{ac_compose_macros::rpc_params, rpc::Request, GetStorage}; pub fn new_community(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/encointer_core.rs b/client/src/commands/encointer_core.rs index a7857cac..5fab33e5 100644 --- a/client/src/commands/encointer_core.rs +++ b/client/src/commands/encointer_core.rs @@ -1,22 +1,21 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_communities::get_community_identifiers; -use crate::commands::frame::get_block_number; -use crate::exit_code; -use crate::utils::get_chain_api; -use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; -use crate::utils::{ - ensure_payment, +use crate::{ + cli_args::EncointerArgsExtractor, + commands::{encointer_communities::get_community_identifiers, frame::get_block_number}, + exit_code, + utils::{ + ensure_payment, get_chain_api, + keys::{get_accountid_from_str, get_pair_from_str}, + }, }; use clap::{value_t, ArgMatches}; use encointer_api_client_extension::{ - Api, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, + Api, CommunityCurrencyTip, CommunityCurrencyTipExtrinsicParamsBuilder, EncointerXt, + ParentchainExtrinsicSigner, }; -use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash, RuntimeEvent}; use encointer_primitives::balances::{to_U64F64, BalanceEntry, BalanceType, Demurrage}; -use encointer_primitives::communities::CommunityIdentifier; -use encointer_primitives::fixed::transcendental::exp; +use encointer_primitives::{communities::CommunityIdentifier, fixed::transcendental::exp}; use log::{debug, error, info}; use pallet_transaction_payment::FeeDetails; use parity_scale_codec::Encode; @@ -24,14 +23,13 @@ use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_rpc::number::NumberOrHex; use std::str::FromStr; -use substrate_api_client::ac_compose_macros::{compose_extrinsic, rpc_params}; -use substrate_api_client::ac_primitives::Bytes; -use substrate_api_client::extrinsic::BalancesExtrinsics; -use substrate_api_client::rpc::Request; -use substrate_api_client::GetStorage; -use substrate_api_client::SubmitAndWatch; -use substrate_api_client::XtStatus; -use substrate_api_client::{GetAccountInformation, SubscribeEvents}; +use substrate_api_client::{ + ac_compose_macros::{compose_extrinsic, rpc_params}, + ac_primitives::Bytes, + extrinsic::BalancesExtrinsics, + rpc::Request, + GetAccountInformation, GetStorage, SubmitAndWatch, SubscribeEvents, XtStatus, +}; pub fn balance(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index b76ba912..2bc71656 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -1,23 +1,22 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_core::set_api_extrisic_params_builder; -use crate::commands::encointer_core::verify_cid; +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, +}; -use crate::utils::ensure_payment; -use crate::utils::get_chain_api; -use crate::utils::keys::get_pair_from_str; +use crate::utils::{ensure_payment, get_chain_api, keys::get_pair_from_str}; use clap::ArgMatches; use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::BlockNumber; -use encointer_primitives::ceremonies::{CeremonyIndexType, CommunityCeremony}; -use encointer_primitives::democracy::ProposalAction; -use encointer_primitives::democracy::{Proposal, ProposalIdType, ReputationVec, Vote}; +use encointer_primitives::{ + ceremonies::{CeremonyIndexType, CommunityCeremony}, + democracy::{Proposal, ProposalAction, ProposalIdType, ReputationVec, Vote}, +}; use log::error; use parity_scale_codec::{Decode, Encode}; use sp_core::{sr25519 as sr25519_core, ConstU32}; -use substrate_api_client::ac_compose_macros::compose_extrinsic; -use substrate_api_client::GetStorage; -use substrate_api_client::SubmitAndWatch; -use substrate_api_client::XtStatus; +use substrate_api_client::{ + ac_compose_macros::compose_extrinsic, GetStorage, SubmitAndWatch, XtStatus, +}; pub fn submit_set_inactivity_timeout_proposal( _args: &str, diff --git a/client/src/commands/encointer_faucet.rs b/client/src/commands/encointer_faucet.rs index 6c161552..bd560d46 100644 --- a/client/src/commands/encointer_faucet.rs +++ b/client/src/commands/encointer_faucet.rs @@ -1,26 +1,25 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_core::set_api_extrisic_params_builder; -use crate::commands::encointer_core::verify_cid; -use crate::utils::get_chain_api; -use crate::utils::keys::{get_accountid_from_str, get_pair_from_str}; -use crate::utils::{ - collective_propose_call, contains_sudo_pallet, ensure_payment, get_councillors, print_raw_call, - send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::{set_api_extrisic_params_builder, verify_cid}, + utils::{ + collective_propose_call, contains_sudo_pallet, ensure_payment, get_chain_api, + get_councillors, + keys::{get_accountid_from_str, get_pair_from_str}, + print_raw_call, send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, + }, }; use clap::ArgMatches; use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; use encointer_node_notee_runtime::{AccountId, Balance}; -use encointer_primitives::faucet::FromStr; -use encointer_primitives::faucet::{Faucet, FaucetNameType, WhiteListType}; +use encointer_primitives::faucet::{Faucet, FaucetNameType, FromStr, WhiteListType}; use log::{error, info}; use parity_scale_codec::{Decode, Encode}; use sp_core::{crypto::Ss58Codec, sr25519 as sr25519_core, Pair}; use sp_keyring::AccountKeyring; -use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic}; -use substrate_api_client::GetAccountInformation; -use substrate_api_client::GetStorage; -use substrate_api_client::SubmitAndWatch; -use substrate_api_client::XtStatus; +use substrate_api_client::{ + ac_compose_macros::{compose_call, compose_extrinsic}, + GetAccountInformation, GetStorage, SubmitAndWatch, XtStatus, +}; pub fn create_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/encointer_scheduler.rs b/client/src/commands/encointer_scheduler.rs index 56b2df91..a6570b35 100644 --- a/client/src/commands/encointer_scheduler.rs +++ b/client/src/commands/encointer_scheduler.rs @@ -1,21 +1,20 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_core::set_api_extrisic_params_builder; -use crate::commands::frame::get_block_number; -use crate::utils::keys::get_pair_from_str; -use crate::utils::{ - collective_propose_call, contains_sudo_pallet, get_chain_api, get_councillors, print_raw_call, - send_and_wait_for_in_block, sudo_call, xt, OpaqueCall, +use crate::{ + cli_args::EncointerArgsExtractor, + commands::{encointer_core::set_api_extrisic_params_builder, frame::get_block_number}, + utils::{ + collective_propose_call, contains_sudo_pallet, get_chain_api, get_councillors, + keys::get_pair_from_str, print_raw_call, send_and_wait_for_in_block, sudo_call, xt, + OpaqueCall, + }, }; use clap::ArgMatches; -use encointer_api_client_extension::SchedulerApi; -use encointer_api_client_extension::{Api, ParentchainExtrinsicSigner}; +use encointer_api_client_extension::{Api, ParentchainExtrinsicSigner, SchedulerApi}; use encointer_node_notee_runtime::{Hash, Moment}; use encointer_primitives::ceremonies::CeremonyIndexType; use log::{debug, info}; use sp_keyring::AccountKeyring; -use substrate_api_client::ac_compose_macros::compose_call; -use substrate_api_client::GetStorage; +use substrate_api_client::{ac_compose_macros::compose_call, GetStorage}; pub fn get_phase(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/frame.rs b/client/src/commands/frame.rs index 1898668f..b9f212de 100644 --- a/client/src/commands/frame.rs +++ b/client/src/commands/frame.rs @@ -1,20 +1,22 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::commands::encointer_core::set_api_extrisic_params_builder; -use crate::utils::ensure_payment; -use crate::utils::get_chain_api; -use crate::utils::keys::get_accountid_from_str; -use crate::PREFUNDING_NR_OF_TRANSFER_EXTRINSICS; +use crate::{ + cli_args::EncointerArgsExtractor, + commands::encointer_core::set_api_extrisic_params_builder, + utils::{ensure_payment, get_chain_api, keys::get_accountid_from_str}, + PREFUNDING_NR_OF_TRANSFER_EXTRINSICS, +}; use clap::ArgMatches; -use encointer_api_client_extension::{Api, ExtrinsicAddress}; -use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; +use encointer_api_client_extension::{ + Api, EncointerXt, ExtrinsicAddress, ParentchainExtrinsicSigner, +}; use encointer_node_notee_runtime::{AccountId, BlockNumber, Hash}; use log::{debug, info}; use parity_scale_codec::{Compact, Encode}; use sp_keyring::AccountKeyring; -use substrate_api_client::ac_compose_macros::{compose_call, compose_extrinsic_offline}; -use substrate_api_client::extrinsic::BalancesExtrinsics; -use substrate_api_client::GetChainInfo; -use substrate_api_client::{GetBalance, GetTransactionPayment, SubmitAndWatch, XtStatus}; +use substrate_api_client::{ + ac_compose_macros::{compose_call, compose_extrinsic_offline}, + extrinsic::BalancesExtrinsics, + GetBalance, GetChainInfo, GetTransactionPayment, SubmitAndWatch, XtStatus, +}; pub fn print_metadata(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let rt = tokio::runtime::Runtime::new().unwrap(); diff --git a/client/src/commands/keystore.rs b/client/src/commands/keystore.rs index 862f4421..ca3ccce8 100644 --- a/client/src/commands/keystore.rs +++ b/client/src/commands/keystore.rs @@ -1,13 +1,13 @@ -use crate::cli_args::EncointerArgsExtractor; -use crate::utils::keys::{KEYSTORE_PATH, SR25519}; +use crate::{ + cli_args::EncointerArgsExtractor, + utils::keys::{KEYSTORE_PATH, SR25519}, +}; use clap::ArgMatches; use log::info; -use sp_application_crypto::Ss58Codec; -use sp_application_crypto::{ed25519, sr25519}; +use sp_application_crypto::{ed25519, sr25519, Ss58Codec}; use sp_keystore::Keystore; use std::path::PathBuf; -use substrate_client_keystore::KeystoreExt; -use substrate_client_keystore::LocalKeystore; +use substrate_client_keystore::{KeystoreExt, LocalKeystore}; pub fn new_account(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { let store = LocalKeystore::open(PathBuf::from(&KEYSTORE_PATH), None).unwrap(); diff --git a/client/src/main.rs b/client/src/main.rs index b2b30083..79531967 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -24,26 +24,11 @@ mod commands; mod community_spec; mod utils; - use clap::{AppSettings, Arg}; use clap_nested::{Command, Commander}; use cli_args::{EncointerArgs, EncointerArgsExtractor}; -use encointer_node_notee_runtime::{ - BalanceType, -}; - - - - - - - - - - - - +use encointer_node_notee_runtime::BalanceType; const PREFUNDING_NR_OF_TRANSFER_EXTRINSICS: u128 = 1000; const VERSION: &str = env!("CARGO_PKG_VERSION"); diff --git a/client/src/utils.rs b/client/src/utils.rs index d4b4986f..855ab76b 100644 --- a/client/src/utils.rs +++ b/client/src/utils.rs @@ -1,5 +1,7 @@ -use crate::commands::encointer_core::{get_asset_fee_details, get_community_balance}; -use crate::{exit_code, BalanceType}; +use crate::{ + commands::encointer_core::{get_asset_fee_details, get_community_balance}, + exit_code, BalanceType, +}; use clap::ArgMatches; use encointer_api_client_extension::{Api, EncointerXt}; use encointer_node_notee_runtime::AccountId; @@ -8,12 +10,12 @@ use log::{debug, error, info}; use parity_scale_codec::{Compact, Encode}; use sp_core::H256; use sp_runtime::traits::Convert; -use substrate_api_client::rpc::JsonrpseeClient; use substrate_api_client::{ ac_compose_macros::compose_call, ac_node_api::Metadata, ac_primitives::Bytes, api::{error::Error as ApiClientError, rpc_api::state::GetStorage}, + rpc::JsonrpseeClient, GetAccountInformation, GetBalance, GetTransactionPayment, Result, SubmitAndWatch, XtStatus, }; From 7f75c6c086322ab76101f38d1740dece6e881321 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 15:59:18 +0100 Subject: [PATCH 30/41] cleanup remaining warnings --- Cargo.toml | 2 +- .../encointer-api-client-extension/src/lib.rs | 1 - client/src/commands/encointer_ceremonies.rs | 17 ----------------- client/src/main.rs | 2 +- 4 files changed, 2 insertions(+), 20 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 88ce8e6e..dcce534c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -124,8 +124,8 @@ substrate-client-keystore = { version = "0.10.0" } [patch.crates-io] ## api client # todo: temporary patch until ^0.17.1 is released -ac-node-api = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } ac-compose-macros = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } +ac-node-api = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } ac-primitives = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } substrate-api-client = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } substrate-client-keystore = { git = "https://github.com/brenzi/substrate-api-client.git", branch = "crates-io-v0.17.0-patch-for-stable" } diff --git a/client/encointer-api-client-extension/src/lib.rs b/client/encointer-api-client-extension/src/lib.rs index 2acbf7ce..1cb4b657 100644 --- a/client/encointer-api-client-extension/src/lib.rs +++ b/client/encointer-api-client-extension/src/lib.rs @@ -1,4 +1,3 @@ -use extrinsic_params::CommunityCurrencyTipExtrinsicParams; use substrate_api_client::{ ac_primitives::{AssetRuntimeConfig, Config, ExtrinsicSigner, WithExtrinsicParams}, rpc::JsonrpseeClient, diff --git a/client/src/commands/encointer_ceremonies.rs b/client/src/commands/encointer_ceremonies.rs index d468ffbf..749f54f9 100644 --- a/client/src/commands/encointer_ceremonies.rs +++ b/client/src/commands/encointer_ceremonies.rs @@ -747,13 +747,6 @@ async fn get_reputation_history( .expect("Could not query reputation history...") } -async fn get_attestee_count(api: &Api, key: CommunityCeremony) -> ParticipantIndexType { - api.get_storage_map("EncointerCeremonies", "AttestationCount", key, None) - .await - .unwrap() - .unwrap_or(0) -} - async fn get_attendees_for_community_ceremony( api: &Api, community_ceremony: CommunityCeremony, @@ -804,16 +797,6 @@ async fn get_reputation_lifetime(api: &Api, at_block: Option) -> Reputatio .unwrap_or(5) } -async fn get_participant_attestation_index( - api: &Api, - key: CommunityCeremony, - accountid: &AccountId, -) -> Option { - api.get_storage_double_map("EncointerCeremonies", "AttestationIndex", key, accountid, None) - .await - .unwrap() -} - async fn new_claim_for( api: &Api, claimant: &sr25519::Pair, diff --git a/client/src/main.rs b/client/src/main.rs index 79531967..2099cf13 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -26,7 +26,7 @@ mod utils; use clap::{AppSettings, Arg}; use clap_nested::{Command, Commander}; -use cli_args::{EncointerArgs, EncointerArgsExtractor}; +use cli_args::EncointerArgs; use encointer_node_notee_runtime::BalanceType; From bf16511a5a182597ca5f961af96be227efe0d60c Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 16:01:55 +0100 Subject: [PATCH 31/41] CI with nightly fmt --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f588257c..53713263 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -209,7 +209,7 @@ jobs: os: [ ubuntu-latest ] rust: [ stable ] rust-target: [ x86_64-unknown-linux-gnu ] - check: [ fmt --all -- --check, clippy -p encointer-client-notee ] + check: [ +nightly fmt --all -- --check, clippy -p encointer-client-notee ] env: RUST_BACKTRACE: full RUSTV: ${{ matrix.rust }} From f9cc01c749ee679325a82d364e50d6c534a737f7 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 16:09:17 +0100 Subject: [PATCH 32/41] fix CI --- .github/workflows/ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53713263..18efb86b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,7 +215,15 @@ jobs: RUSTV: ${{ matrix.rust }} TARGET: ${{ matrix.rust-target }} steps: - - uses: actions/checkout@v3 + - name: Install nightly toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + components: rustfmt + + - name: Checkout + uses: actions/checkout@v3 - name: Install protoc run: sudo apt-get install protobuf-compiler From e631bcb0eccc65a7b3332d51e617080c47bd7c94 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 16:14:19 +0100 Subject: [PATCH 33/41] fmt --- .../src/ceremonies.rs | 31 +++++++++---------- client/src/commands/encointer_core.rs | 17 +++++----- client/src/commands/encointer_faucet.rs | 9 +++--- client/src/utils.rs | 7 ++--- node/src/chain_spec.rs | 6 ++-- node/src/command.rs | 12 +++---- runtime/src/lib.rs | 20 ++++++------ 7 files changed, 48 insertions(+), 54 deletions(-) diff --git a/client/encointer-api-client-extension/src/ceremonies.rs b/client/encointer-api-client-extension/src/ceremonies.rs index e915185d..64e9a7b3 100644 --- a/client/encointer-api-client-extension/src/ceremonies.rs +++ b/client/encointer-api-client-extension/src/ceremonies.rs @@ -198,13 +198,13 @@ impl CeremoniesApi for Api { }; if let Some(p_index) = index_query("BootstrapperIndex").await? { - return Ok(Registration::new(p_index, RegistrationType::Bootstrapper)); + return Ok(Registration::new(p_index, RegistrationType::Bootstrapper)) } else if let Some(p_index) = index_query("ReputableIndex").await? { - return Ok(Registration::new(p_index, RegistrationType::Reputable)); + return Ok(Registration::new(p_index, RegistrationType::Reputable)) } else if let Some(p_index) = index_query("EndorseeIndex").await? { - return Ok(Registration::new(p_index, RegistrationType::Endorsee)); + return Ok(Registration::new(p_index, RegistrationType::Endorsee)) } else if let Some(p_index) = index_query("NewbieIndex").await? { - return Ok(Registration::new(p_index, RegistrationType::Newbie)); + return Ok(Registration::new(p_index, RegistrationType::Newbie)) } Err(ApiClientError::Other( @@ -231,7 +231,7 @@ impl CeremoniesApi for Api { if meetup_count == 0 { warn!("Meetup Count is 0."); - return Ok(None); + return Ok(None) } let assignments = self.get_assignments(community_ceremony).await?; @@ -251,19 +251,16 @@ impl CeremoniesApi for Api { // Finally get the meetup index match registration.registration_type { - RegistrationType::Bootstrapper => { - Ok(meetup_index_fn(registration.index - 1, assignments.bootstrappers_reputables)) - }, + RegistrationType::Bootstrapper => + Ok(meetup_index_fn(registration.index - 1, assignments.bootstrappers_reputables)), RegistrationType::Reputable => Ok(meetup_index_fn( registration.index - 1 + bootstrapper_count().await?, assignments.bootstrappers_reputables, )), - RegistrationType::Endorsee => { - Ok(meetup_index_fn(registration.index - 1, assignments.endorsees)) - }, - RegistrationType::Newbie => { - Ok(meetup_index_fn(registration.index - 1, assignments.newbies)) - }, + RegistrationType::Endorsee => + Ok(meetup_index_fn(registration.index - 1, assignments.endorsees)), + RegistrationType::Newbie => + Ok(meetup_index_fn(registration.index - 1, assignments.newbies)), } } @@ -292,7 +289,7 @@ impl CeremoniesApi for Api { "Invalid meetup index > meetup count: {meetup_index_zero_based}, {meetup_count}" ) .into(), - )); + )) } let params = self.get_assignments(community_ceremony).await?; @@ -433,11 +430,11 @@ async fn get_bootstrapper_or_reputable( assigned: &AssignmentCount, ) -> Result> { if p_index < assigned.bootstrappers { - return api.get_bootstrapper(community_ceremony, &(p_index + 1)).await; + return api.get_bootstrapper(community_ceremony, &(p_index + 1)).await } else if p_index < assigned.bootstrappers + assigned.reputables { return api .get_reputable(community_ceremony, &(p_index - assigned.bootstrappers + 1)) - .await; + .await } Ok(None) diff --git a/client/src/commands/encointer_core.rs b/client/src/commands/encointer_core.rs index 5fab33e5..594bcf6c 100644 --- a/client/src/commands/encointer_core.rs +++ b/client/src/commands/encointer_core.rs @@ -303,20 +303,20 @@ async fn listen(matches: &ArgMatches<'_>) { let mut count = 0u32; let mut blocks = 0u32; loop { - if matches.is_present("events") - && count >= value_t!(matches.value_of("events"), u32).unwrap() + if matches.is_present("events") && + count >= value_t!(matches.value_of("events"), u32).unwrap() { - return; + return }; - if matches.is_present("blocks") - && blocks > value_t!(matches.value_of("blocks"), u32).unwrap() + if matches.is_present("blocks") && + blocks > value_t!(matches.value_of("blocks"), u32).unwrap() { - return; + return }; let event_results = subscription.next_events::().await.unwrap(); blocks += 1; match event_results { - Ok(evts) => { + Ok(evts) => for evr in evts { debug!("decoded: phase {:?} event {:?}", evr.phase, evr.event); match &evr.event { @@ -399,8 +399,7 @@ async fn listen(matches: &ArgMatches<'_>) { }, _ => debug!("ignoring unsupported module event: {:?}", evr.event), } - } - }, + }, Err(_) => error!("couldn't decode event record list"), } } diff --git a/client/src/commands/encointer_faucet.rs b/client/src/commands/encointer_faucet.rs index bd560d46..33f0e039 100644 --- a/client/src/commands/encointer_faucet.rs +++ b/client/src/commands/encointer_faucet.rs @@ -64,10 +64,10 @@ pub fn create_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:: let result = api.submit_and_watch_extrinsic_until(xt, XtStatus::InBlock).await; match result { - Ok(report) => { + Ok(report) => for event in report.events.unwrap().iter() { - if event.pallet_name() == "EncointerFaucet" - && event.variant_name() == "FaucetCreated" + if event.pallet_name() == "EncointerFaucet" && + event.variant_name() == "FaucetCreated" { println!( "{}", @@ -76,8 +76,7 @@ pub fn create_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:: .to_ss58check() ); } - } - }, + }, Err(e) => { println!("[+] Couldn't execute the extrinsic due to {:?}\n", e); }, diff --git a/client/src/utils.rs b/client/src/utils.rs index 855ab76b..0e2cd052 100644 --- a/client/src/utils.rs +++ b/client/src/utils.rs @@ -220,10 +220,9 @@ pub mod keys { pub fn get_accountid_from_str(account: &str) -> AccountId { debug!("getting AccountId from -{}-", account); match &account[..2] { - "//" => { + "//" => AccountPublic::from(sr25519::Pair::from_string(account, None).unwrap().public()) - .into_account() - }, + .into_account(), _ => AccountPublic::from(sr25519::Public::from_ss58check(account).unwrap()) .into_account(), } @@ -238,7 +237,7 @@ pub mod keys { _ => { if sr25519::Public::from_ss58check(account).is_err() { // could be mnemonic phrase - return sr25519::AppPair::from_string_with_seed(account, None).unwrap().0; + return sr25519::AppPair::from_string_with_seed(account, None).unwrap().0 } debug!("fetching from keystore at {}", &KEYSTORE_PATH); // open store without password protection diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 8e11db46..f1cd2a89 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -1,6 +1,6 @@ -use encointer_node_notee_runtime::BalanceType; -use encointer_node_notee_runtime::CeremonyPhaseType; -use encointer_node_notee_runtime::{AccountId, RuntimeGenesisConfig, Signature, WASM_BINARY}; +use encointer_node_notee_runtime::{ + AccountId, BalanceType, CeremonyPhaseType, RuntimeGenesisConfig, Signature, WASM_BINARY, +}; use sc_service::{ChainType, Properties}; use sp_consensus_aura::sr25519::AuthorityId as AuraId; use sp_consensus_grandpa::AuthorityId as GrandpaId; diff --git a/node/src/command.rs b/node/src/command.rs index 7287c2f9..a727b994 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -59,9 +59,8 @@ impl SubstrateCli for Cli { Ok(match id { "dev" => Box::new(chain_spec::development_config()?), "" | "local" => Box::new(chain_spec::local_testnet_config()?), - path => { - Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?) - }, + path => + Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), }) } } @@ -135,7 +134,7 @@ pub fn run() -> sc_cli::Result<()> { "Runtime benchmarking wasn't enabled when building the node. \ You can enable it with `--features runtime-benchmarks`." .into(), - ); + ) } cmd.run::, ()>(config) @@ -184,9 +183,8 @@ pub fn run() -> sc_cli::Result<()> { cmd.run(client, inherent_benchmark_data()?, Vec::new(), &ext_factory) }, - BenchmarkCmd::Machine(cmd) => { - cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()) - }, + BenchmarkCmd::Machine(cmd) => + cmd.run(&config, SUBSTRATE_REFERENCE_HARDWARE.clone()), } }) }, diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 06d75e88..dbb25016 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -6,9 +6,9 @@ #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); -use frame_support::derive_impl; -use frame_support::traits::{ - tokens::ConversionToAssetBalance, ConstU128, EqualPrivilegeOnly, InstanceFilter, +use frame_support::{ + derive_impl, + traits::{tokens::ConversionToAssetBalance, ConstU128, EqualPrivilegeOnly, InstanceFilter}, }; use pallet_grandpa::{ fg_primitives, AuthorityId as GrandpaId, AuthorityList as GrandpaAuthorityList, @@ -67,8 +67,10 @@ pub use encointer_primitives::{ communities::{CommunityIdentifier, Location}, scheduler::CeremonyPhaseType, }; -use frame_support::traits::tokens::{ConversionFromAssetBalance, PayFromAccount}; -use frame_support::traits::ConstBool; +use frame_support::traits::{ + tokens::{ConversionFromAssetBalance, PayFromAccount}, + ConstBool, +}; use frame_system::{EnsureRoot, EnsureSigned}; use sp_runtime::traits::IdentityLookup; @@ -208,9 +210,9 @@ impl InstanceFilter for ProxyType { ProxyType::NonTransfer => matches!(c, RuntimeCall::EncointerBazaar(..)), ProxyType::BazaarEdit => matches!( c, - RuntimeCall::EncointerBazaar(EncointerBazaarCall::create_offering { .. }) - | RuntimeCall::EncointerBazaar(EncointerBazaarCall::update_offering { .. }) - | RuntimeCall::EncointerBazaar(EncointerBazaarCall::delete_offering { .. }) + RuntimeCall::EncointerBazaar(EncointerBazaarCall::create_offering { .. }) | + RuntimeCall::EncointerBazaar(EncointerBazaarCall::update_offering { .. }) | + RuntimeCall::EncointerBazaar(EncointerBazaarCall::delete_offering { .. }) ), } } @@ -476,7 +478,7 @@ pub struct NoConversion; impl ConversionFromAssetBalance for NoConversion { type Error = (); fn from_asset_balance(balance: Balance, _asset_id: ()) -> Result { - return Ok(balance); + return Ok(balance) } #[cfg(feature = "runtime-benchmarks")] fn ensure_successful(_: ()) {} From ebcb7d0913b6c5bb5aba8d842a49686d727d98b8 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 17:06:05 +0100 Subject: [PATCH 34/41] fix extra feature builds --- Cargo.lock | 1 + Cargo.toml | 2 +- node/src/command.rs | 11 ++--------- runtime/Cargo.toml | 1 + runtime/src/lib.rs | 3 ++- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 566b03df..2e08000e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2265,6 +2265,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", + "sp-storage", "sp-transaction-pool", "sp-version", "substrate-wasm-builder", diff --git a/Cargo.toml b/Cargo.toml index dcce534c..e7d06362 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,12 +108,12 @@ sp-runtime = { default-features = false, version = "33.0.0" } sp-session = { version = "29.0.0", default-features = false } sp-staking = { version = "28.0.0", default-features = false } sp-std = { default-features = false, version = "14.0.0" } +sp-storage = { default-features = false, version = "20.0.0" } sp-timestamp = { version = "28.0.0" } sp-transaction-pool = { version = "28.0.0", default-features = false } sp-version = { version = "31.0.0", default-features = false } substrate-frame-rpc-system = { version = "30.0.0" } - substrate-wasm-builder = "19.0.0" substrate-build-script-utils = "11.0.0" diff --git a/node/src/command.rs b/node/src/command.rs index a727b994..470af2ad 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -27,9 +27,6 @@ use sc_cli::SubstrateCli; use sc_service::PartialComponents; use sp_keyring::Sr25519Keyring; -#[cfg(feature = "try-runtime")] -use try_runtime_cli::block_building_info::timestamp_with_aura_info; - impl SubstrateCli for Cli { fn impl_name() -> String { "Encointer Node noTEE".into() @@ -188,12 +185,8 @@ pub fn run() -> sc_cli::Result<()> { } }) }, - #[cfg(feature = "try-runtime")] - Some(Subcommand::TryRuntime) => Err(try_runtime_cli::DEPRECATION_NOTICE.into()), - #[cfg(not(feature = "try-runtime"))] - Some(Subcommand::TryRuntime) => Err("TryRuntime wasn't enabled when building the node. \ - You can enable it with `--features try-runtime`." - .into()), + Some(Subcommand::TryRuntime) => + Err("TryRuntime is deprecated. use standalone cli instead".into()), Some(Subcommand::ChainInfo(cmd)) => { let runner = cli.create_runner(cmd)?; runner.sync_run(|config| cmd.run::(&config)) diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 3058be20..8679f851 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -56,6 +56,7 @@ sp-runtime = { workspace = true } sp-session = { workspace = true } sp-staking = { workspace = true } sp-std = { workspace = true } +sp-storage = { workspace = true } sp-transaction-pool = { workspace = true } sp-version = { workspace = true } diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index dbb25016..a72e586e 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -877,7 +877,8 @@ impl_runtime_apis! { fn dispatch_benchmark( config: frame_benchmarking::BenchmarkConfig ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch, TrackedStorageKey}; + use frame_benchmarking::{baseline, Benchmarking, BenchmarkBatch}; + use sp_storage::TrackedStorageKey; use frame_system_benchmarking::Pallet as SystemBench; use baseline::Pallet as BaselineBench; From bbb627a4582e66995aa3e2d48d567417e26ba9d0 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Tue, 5 Mar 2024 17:19:23 +0100 Subject: [PATCH 35/41] fix node impl got genesis --- Cargo.lock | 1 + Cargo.toml | 1 + client/src/main.rs | 3 +-- runtime/Cargo.toml | 2 ++ runtime/src/lib.rs | 12 +++++++++++- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e08000e..cef94b71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2259,6 +2259,7 @@ dependencies = [ "sp-block-builder", "sp-consensus-aura", "sp-core", + "sp-genesis-builder", "sp-inherents", "sp-offchain", "sp-runtime", diff --git a/Cargo.toml b/Cargo.toml index e7d06362..f8340de2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,6 +98,7 @@ sp-consensus = { version = "0.34.0" } sp-consensus-aura = { version = "0.34.0", default-features = false } sp-consensus-grandpa = { version = "15.0.0" } sp-core = { default-features = false, version = "30.0.0" } +sp-genesis-builder = { default-features = false, version = "0.9.0" } sp-inherents = { default-features = false, version = "28.0.0" } sp-io = { default-features = false, version = "32.0.0" } sp-keyring = "33.0.0" diff --git a/client/src/main.rs b/client/src/main.rs index 2099cf13..5a54137b 100644 --- a/client/src/main.rs +++ b/client/src/main.rs @@ -41,8 +41,7 @@ mod exit_code { pub const NO_CID_SPECIFIED: i32 = 70; } -#[tokio::main] -async fn main() { +fn main() { env_logger::init(); Commander::new() diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 8679f851..475f59be 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -50,6 +50,7 @@ sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } sp-core = { workspace = true } +sp-genesis-builder = { workspace = true } sp-inherents = { workspace = true } sp-offchain = { workspace = true } sp-runtime = { workspace = true } @@ -115,6 +116,7 @@ std = [ "sp-block-builder/std", "sp-consensus-aura/std", "sp-core/std", + "sp-genesis-builder/std", "sp-inherents/std", "sp-offchain/std", "sp-runtime/std", diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index a72e586e..755256a8 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -5,9 +5,9 @@ // Make the WASM binary available. #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); - use frame_support::{ derive_impl, + genesis_builder_helper::{build_config, create_default_config}, traits::{tokens::ConversionToAssetBalance, ConstU128, EqualPrivilegeOnly, InstanceFilter}, }; use pallet_grandpa::{ @@ -710,6 +710,16 @@ impl_runtime_apis! { } } + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn create_default_config() -> Vec { + create_default_config::() + } + + fn build_config(config: Vec) -> sp_genesis_builder::Result { + build_config::(config) + } + } + impl sp_session::SessionKeys for Runtime { fn generate_session_keys(seed: Option>) -> Vec { opaque::SessionKeys::generate(seed) From 133c70f81ce2680bd628797b5a9960aea0f00e7c Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 6 Mar 2024 09:45:04 +0100 Subject: [PATCH 36/41] fix broken faucet whitelist arg --- client/bootstrap_demo_community.py | 3 ++- client/src/commands/encointer_faucet.rs | 9 +++++---- client/src/commands/frame.rs | 2 +- client/test-data/test-locations-mediterranean.json | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/client/bootstrap_demo_community.py b/client/bootstrap_demo_community.py index 89aa8d53..828ff416 100755 --- a/client/bootstrap_demo_community.py +++ b/client/bootstrap_demo_community.py @@ -111,7 +111,7 @@ def register_participants_and_perform_meetup(client, cid, accounts): def faucet(client, cid, accounts): # charlie has no genesis funds - print('Faucet is dripping...') + print('native (Alice)Faucet is dripping...') client.faucet(accounts, is_faucet=True) blocks_to_wait = 3 @@ -261,6 +261,7 @@ def balance(x): def test_faucet(client, cid): + print("Testing the EncointerFaucet") client.set_faucet_reserve_amount("//Alice", balance(3000)) client.await_block(2) balance_bob = client.balance("//Bob") diff --git a/client/src/commands/encointer_faucet.rs b/client/src/commands/encointer_faucet.rs index 33f0e039..bdd93456 100644 --- a/client/src/commands/encointer_faucet.rs +++ b/client/src/commands/encointer_faucet.rs @@ -34,15 +34,16 @@ pub fn create_faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap:: let drip_amount = matches.faucet_drip_amount_arg().unwrap(); let api2 = api.clone(); - let whitelist = futures::future::join_all(matches.whitelist_arg().map(|wl| async move { + let whitelist = if let Some(wl) = matches.whitelist_arg() { let whitelist_vec: Vec<_> = futures::future::join_all(wl.into_iter().map(|c| { let api_local = api2.clone(); async move { verify_cid(&api_local, c, None).await } })) .await; - WhiteListType::try_from(whitelist_vec).unwrap() - })) - .await; + Some(WhiteListType::try_from(whitelist_vec).unwrap()) + } else { + None + }; let faucet_name = FaucetNameType::from_str(faucet_name_raw).unwrap(); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); diff --git a/client/src/commands/frame.rs b/client/src/commands/frame.rs index b9f212de..2e11619f 100644 --- a/client/src/commands/frame.rs +++ b/client/src/commands/frame.rs @@ -62,7 +62,7 @@ pub fn faucet(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> ); ensure_payment(&api, &xt.encode().into(), tx_payment_cid_arg).await; // send and watch extrinsic until ready - println!("Faucet drips {amount} to {to} (Alice's nonce={nonce})"); + println!("Alice-Faucet drips {amount} to {to} (Alice's nonce={nonce})"); let _blockh = api.submit_and_watch_extrinsic_until(xt, XtStatus::Ready).await.unwrap(); nonce += 1; } diff --git a/client/test-data/test-locations-mediterranean.json b/client/test-data/test-locations-mediterranean.json index 4404d823..e1884119 100644 --- a/client/test-data/test-locations-mediterranean.json +++ b/client/test-data/test-locations-mediterranean.json @@ -4,7 +4,7 @@ "meta": { "name": "Mediterranea", "symbol": "MTA", - "assets": "QmP2fzfikh7VqTu8pvzd2G2vAd4eK7EaazXTEgqGN6AWoD", + "assets": "QmaRYgDkmmsza2A1zyxy7H7fFE3bELPA535KvCHzEf2kee", "announcementSigner": null, "rules": "loCo" }, From f49197a27b688258fe784837bdc93c7d37a1e6f5 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 6 Mar 2024 09:55:16 +0100 Subject: [PATCH 37/41] fix CI test validation for VerifiedLinked(_) --- client/bootstrap_demo_community.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/bootstrap_demo_community.py b/client/bootstrap_demo_community.py index 828ff416..97fcea58 100755 --- a/client/bootstrap_demo_community.py +++ b/client/bootstrap_demo_community.py @@ -149,7 +149,7 @@ def test_reputation_caching(client, cid, account): # check if the reputation cache was updated rep = client.reputation(account1) print(rep) - if ('1', ' sqm1v79dF6b', 'VerifiedLinked') not in rep or ('2', ' sqm1v79dF6b', 'VerifiedLinked') not in rep or ('3', ' sqm1v79dF6b', 'VerifiedUnlinked') not in rep: + if ('1', ' sqm1v79dF6b', 'VerifiedLinked(2)') not in rep or ('2', ' sqm1v79dF6b', 'VerifiedLinked(3)') not in rep or ('3', ' sqm1v79dF6b', 'VerifiedUnlinked') not in rep: print("wrong reputation") exit(1) From 7c55d55083e4bd503165ba50cf2ed3c6cae9d646 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 6 Mar 2024 11:37:28 +0100 Subject: [PATCH 38/41] fix reputation checks --- client/bootstrap_demo_community.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/bootstrap_demo_community.py b/client/bootstrap_demo_community.py index 97fcea58..cd531a9c 100755 --- a/client/bootstrap_demo_community.py +++ b/client/bootstrap_demo_community.py @@ -164,7 +164,7 @@ def test_reputation_caching(client, cid, account): rep = client.reputation(account1) print(rep) # after the registration the second reputation should now be linked - if ('3', ' sqm1v79dF6b', 'VerifiedLinked') not in rep: + if ('3', ' sqm1v79dF6b', 'VerifiedLinked(4)') not in rep: print("reputation not linked") exit(1) @@ -213,7 +213,7 @@ def test_unregister_and_upgrade_registration(client, cid): check_participant_count(client, cid, "Newbie", 0) check_participant_count(client, cid, "Reputable", 1) - check_reputation(client, cid, newbie, 6, "VerifiedLinked") + check_reputation(client, cid, newbie, 6, "VerifiedLinked(7)") client.unregister_participant(newbie, cid, cindex=6) client.await_block(3) From a0b0a08faee035f89a800a59da7651da7239716a Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 6 Mar 2024 11:57:48 +0100 Subject: [PATCH 39/41] some toml cosmetics --- Cargo.toml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f8340de2..48248912 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,28 +50,28 @@ pallet-encointer-scheduler = { default-features = false, version = "7.0.0" } # substrate deps frame-benchmarking = { default-features = false, version = "30.0.0" } frame-benchmarking-cli = { version = "34.0.0" } -frame-executive = { version = "30.0.0", default-features = false } +frame-executive = { default-features = false, version = "30.0.0" } frame-support = { default-features = false, version = "30.0.0" } frame-system = { default-features = false, version = "30.0.0" } -frame-system-benchmarking = { version = "30.0.0", default-features = false } -frame-system-rpc-runtime-api = { version = "28.0.0", default-features = false } -frame-try-runtime = { version = "0.36.0", default-features = false } +frame-system-benchmarking = { default-features = false, version = "30.0.0" } +frame-system-rpc-runtime-api = { default-features = false, version = "28.0.0" } +frame-try-runtime = { default-features = false, version = "0.36.0" } hex-literal = { version = "0.4.1" } jsonrpsee = { version = "0.22.0", features = ["server"] } pallet-asset-tx-payment = { default-features = false, version = "30.0.0" } -pallet-aura = { version = "29.0.0", default-features = false } +pallet-aura = { default-features = false, version = "29.0.0" } pallet-balances = { default-features = false, version = "30.0.0" } -pallet-grandpa = { version = "30.0.0", default-features = false } -pallet-insecure-randomness-collective-flip = { version = "18.0.0", default-features = false } -pallet-proxy = { version = "30.0.0", default-features = false } -pallet-scheduler = { version = "31.0.0", default-features = false } -pallet-sudo = { version = "30.0.0", default-features = false } +pallet-grandpa = { default-features = false, version = "30.0.0" } +pallet-insecure-randomness-collective-flip = { default-features = false, version = "18.0.0" } +pallet-proxy = { default-features = false, version = "30.0.0" } +pallet-scheduler = { default-features = false, version = "31.0.0" } +pallet-sudo = { default-features = false, version = "30.0.0" } pallet-timestamp = { default-features = false, version = "29.0.0" } pallet-transaction-payment = { default-features = false, version = "30.0.0" } pallet-transaction-payment-rpc = { version = "32.0.0" } -pallet-transaction-payment-rpc-runtime-api = { version = "30.0.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { default-features = false, version = "30.0.0" } pallet-treasury = { default-features = false, version = "29.0.0" } -pallet-utility = { version = "30.0.0", default-features = false } +pallet-utility = { default-features = false, version = "30.0.0" } sc-basic-authorship = { version = "0.36.0" } sc-chain-spec = "29.0.0" sc-cli = { version = "0.38.0" } @@ -92,10 +92,10 @@ sc-transaction-pool-api = { version = "30.0.0" } sp-api = { default-features = false, version = "28.0.0" } sp-application-crypto = { default-features = false, version = "32.0.0" } sp-arithmetic = { default-features = false, version = "25.0.0" } -sp-block-builder = { version = "28.0.0", default-features = false } +sp-block-builder = { default-features = false, version = "28.0.0" } sp-blockchain = "30.0.0" sp-consensus = { version = "0.34.0" } -sp-consensus-aura = { version = "0.34.0", default-features = false } +sp-consensus-aura = { default-features = false, version = "0.34.0" } sp-consensus-grandpa = { version = "15.0.0" } sp-core = { default-features = false, version = "30.0.0" } sp-genesis-builder = { default-features = false, version = "0.9.0" } @@ -103,16 +103,16 @@ sp-inherents = { default-features = false, version = "28.0.0" } sp-io = { default-features = false, version = "32.0.0" } sp-keyring = "33.0.0" sp-keystore = "0.36.0" -sp-offchain = { version = "28.0.0", default-features = false } +sp-offchain = { default-features = false, version = "28.0.0" } sp-rpc = "28.0.0" sp-runtime = { default-features = false, version = "33.0.0" } -sp-session = { version = "29.0.0", default-features = false } -sp-staking = { version = "28.0.0", default-features = false } +sp-session = { default-features = false, version = "29.0.0" } +sp-staking = { default-features = false, version = "28.0.0" } sp-std = { default-features = false, version = "14.0.0" } sp-storage = { default-features = false, version = "20.0.0" } sp-timestamp = { version = "28.0.0" } -sp-transaction-pool = { version = "28.0.0", default-features = false } -sp-version = { version = "31.0.0", default-features = false } +sp-transaction-pool = { default-features = false, version = "28.0.0" } +sp-version = { default-features = false, version = "31.0.0" } substrate-frame-rpc-system = { version = "30.0.0" } substrate-wasm-builder = "19.0.0" From 0715528aab8c42f2f0ac1be7c48d79daa31c327c Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 6 Mar 2024 12:16:25 +0100 Subject: [PATCH 40/41] fix democracy list-proposals --- client/src/commands/encointer_democracy.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index 2bc71656..c95e5f8c 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -5,8 +5,7 @@ use crate::{ use crate::utils::{ensure_payment, get_chain_api, keys::get_pair_from_str}; use clap::ArgMatches; -use encointer_api_client_extension::{EncointerXt, ParentchainExtrinsicSigner}; -use encointer_node_notee_runtime::BlockNumber; +use encointer_api_client_extension::{EncointerXt, Moment, ParentchainExtrinsicSigner}; use encointer_primitives::{ ceremonies::{CeremonyIndexType, CommunityCeremony}, democracy::{Proposal, ProposalAction, ProposalIdType, ReputationVec, Vote}, @@ -65,9 +64,9 @@ pub fn list_proposals(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap: let proposal_id = ProposalIdType::decode(&mut key_postfix[key_postfix.len() - 16..].as_ref()) .unwrap(); - let proposal: Proposal = - api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); println!("id: {}", proposal_id); + let proposal: Proposal = + api.get_storage_by_key(storage_key.clone(), at_block).await.unwrap().unwrap(); println!("action: {:?}", proposal.action); println!("start block: {}", proposal.start); println!("start cindex: {}", proposal.start_cindex); From 3b73becfd8aa003248251b357a5cfef52e55956e Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Wed, 6 Mar 2024 12:41:01 +0100 Subject: [PATCH 41/41] fix democracy.vote extrinsic --- client/src/commands/encointer_democracy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/commands/encointer_democracy.rs b/client/src/commands/encointer_democracy.rs index c95e5f8c..d5fa1949 100644 --- a/client/src/commands/encointer_democracy.rs +++ b/client/src/commands/encointer_democracy.rs @@ -110,7 +110,7 @@ pub fn vote(_args: &str, matches: &ArgMatches<'_>) -> Result<(), clap::Error> { }), ) .await; - let reputation_bvec = ReputationVec::>::try_from(reputation_vec); + let reputation_bvec = ReputationVec::>::try_from(reputation_vec).unwrap(); let tx_payment_cid_arg = matches.tx_payment_cid_arg(); set_api_extrisic_params_builder(&mut api, tx_payment_cid_arg).await;