diff --git a/Cargo.toml b/Cargo.toml
index 179b8a18..b4ae26d3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,6 +26,76 @@ members = [
'vouches',
]
+[workspace.dependencies]
+# local pin
+encointer-ceremonies-assignment = { path = "ceremonies/assignment", default-features = false, version = "3.0.2" }
+encointer-meetup-validation = { path = "ceremonies/meetup-validation", default-features = false, version = "3.0.2" }
+encointer-primitives = { path = "primitives", default-features = false, features = ["serde_derive"], version = "3.0.2" }
+encointer-rpc = { path = "rpc", version = "3.0.2" }
+ep-core = { path = "primitives/core", default-features = false, version = "3.0.2" }
+pallet-encointer-balances = { path = "balances", default-features = false, version = "3.0.2" }
+pallet-encointer-ceremonies = { path = "ceremonies", default-features = false, version = "3.0.2" }
+pallet-encointer-communities = { path = "communities", default-features = false, version = "3.0.3" }
+pallet-encointer-reputation-commitments = { path = "reputation-commitments", default-features = false, version = "3.0.2" }
+pallet-encointer-scheduler = { path = "scheduler", default-features = false, version = "3.0.3" }
+test-utils = { path = "test-utils" }
+# rpc apis
+encointer-balances-tx-payment-rpc-runtime-api = { path = "balances-tx-payment/rpc/runtime-api", version = "3.0.2" }
+pallet-encointer-bazaar-rpc-runtime-api = { path = "bazaar/rpc/runtime-api", version = "3.0.2" }
+pallet-encointer-ceremonies-rpc-runtime-api = { path = "ceremonies/rpc/runtime-api", version = "3.0.2" }
+pallet-encointer-communities-rpc-runtime-api = { path = "communities/rpc/runtime-api", version = "3.0.2" }
+
+# various
+array-bytes = "6.1.0"
+bs58 = { version = "0.4.0", default-features = false, features = ["alloc"] }
+crc = "2.1.0"
+fixed = { package = "substrate-fixed", default-features = false, version = "0.5.9" }
+geohash = { package = "substrate-geohash", version = "0.13.0" }
+impl-serde = { version = "0.4.0", default-features = false }
+impl-trait-for-tuples = { version = "0.2.2", default-features = false }
+log = { version = "0.4.20", default-features = false }
+parity-scale-codec = { version = "3.6.4", default-features = false, features = ["derive", "max-encoded-len"] }
+parking_lot = "0.12.0"
+scale-info = { version = "2.10.0", default-features = false, features = ["derive"] }
+serde = { version = "1.0.188", default-features = false, features = ["derive", "alloc"] }
+thiserror = "1.0.31"
+
+# polkadot-sdk [no_std]
+frame-benchmarking = { default-features = false, version = "25.0.0" }
+frame-support = { default-features = false, version = "25.0.0" }
+frame-system = { default-features = false, version = "25.0.0" }
+pallet-asset-tx-payment = { default-features = false, version = "25.0.0" }
+pallet-balances = { default-features = false, version = "25.0.0" }
+pallet-timestamp = { default-features = false, version = "24.0.0" }
+pallet-transaction-payment = { default-features = false, version = "25.0.0" }
+pallet-treasury = { default-features = false, version = "24.0.0" }
+sp-api = { default-features = false, version = "23.0.0" }
+sp-application-crypto = { default-features = false, version = "27.0.0" }
+sp-arithmetic = { default-features = false, version = "20.0.0" }
+sp-core = { default-features = false, version = "25.0.0" }
+sp-io = { default-features = false, version = "27.0.0" }
+sp-runtime = { default-features = false, version = "28.0.0" }
+sp-std = { default-features = false, version = "12.0.0" }
+
+# rpc stuff [std]
+jsonrpsee = { version = "0.16.3", features = ["client-core", "server", "macros"] }
+jsonrpsee-core = { version = "0.16.3" }
+jsonrpsee-types = { version = "0.16.3" }
+pallet-transaction-payment-rpc = { version = "27.0.0" }
+sc-rpc = "26.0.0"
+sc-rpc-api = "0.30.0"
+sp-blockchain = "25.0.0"
+sp-rpc = "23.0.0"
+
+# dev deps
+approx = "0.5.1"
+itertools = "0.10.3"
+rstest = "0.12.0"
+serde_json = "1.0.105"
+sp-inherents = "23.0.0"
+sp-keyring = "28.0.0"
+sp-keystore = "0.31.0"
+
#[patch."https://github.com/encointer/substrate-fixed"]
#substrate-fixed = { path = "../substrate-fixed"}
#
diff --git a/balances-tx-payment/Cargo.toml b/balances-tx-payment/Cargo.toml
index 75189518..bd4dbc97 100644
--- a/balances-tx-payment/Cargo.toml
+++ b/balances-tx-payment/Cargo.toml
@@ -9,38 +9,34 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-log = { version = "0.4.20", default-features = false }
+log = { workspace = true }
-encointer-primitives = { path = "../primitives", default-features = false, version = "3.0.2" }
-pallet-encointer-balances = { path = "../balances", default-features = false, version = "3.0.2" }
-pallet-encointer-ceremonies = { path = "../ceremonies", default-features = false, version = "3.0.2" }
+encointer-primitives = { workspace = true }
+pallet-encointer-balances = { workspace = true }
+pallet-encointer-ceremonies = { workspace = true }
# substrate dependencies
-frame-support = { default-features = false, version = "25.0.0" }
-frame-system = { default-features = false, version = "25.0.0" }
-pallet-asset-tx-payment = { default-features = false, version = "25.0.0" }
-pallet-transaction-payment = { default-features = false, version = "25.0.0" }
-sp-runtime = { default-features = false, version = "28.0.0" }
+frame-support = { workspace = true }
+frame-system = { workspace = true }
+pallet-asset-tx-payment = { workspace = true }
+pallet-transaction-payment = { workspace = true }
+sp-runtime = { workspace = true }
[dev-dependencies]
-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = [
- "derive",
-] }
-rstest = "0.12.0"
-scale-info = { version = "2.10.0", default-features = false }
-sp-io = "27.0.0"
-test-utils = { path = "../test-utils" }
+parity-scale-codec = { workspace = true }
+rstest = { workspace = true }
+scale-info = { workspace = true }
+sp-io = { workspace = true, features = ["std"] }
+test-utils = { workspace = true }
[features]
default = ["std"]
std = [
"encointer-primitives/std",
- # substrate deps
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-asset-tx-payment/std",
- # encointer deps
"pallet-encointer-balances/std",
"pallet-encointer-ceremonies/std",
"pallet-transaction-payment/std",
diff --git a/balances-tx-payment/rpc/Cargo.toml b/balances-tx-payment/rpc/Cargo.toml
index d7c8b95d..fe83fdc1 100644
--- a/balances-tx-payment/rpc/Cargo.toml
+++ b/balances-tx-payment/rpc/Cargo.toml
@@ -9,28 +9,24 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false }
-jsonrpsee = { version = "0.16.3", features = [
- "client-core",
- "server",
- "macros",
-] }
-log = "0.4.20"
-parking_lot = "0.12.0"
-thiserror = "1.0.31"
+jsonrpsee = { workspace = true }
+log = { workspace = true, features = ["std"] }
+parity-scale-codec = { workspace = true }
+parking_lot = { workspace = true }
+thiserror = { workspace = true }
# local deps
-encointer-balances-tx-payment-rpc-runtime-api = { package = "encointer-balances-tx-payment-rpc-runtime-api", path = "runtime-api", version = "3.0.2" }
-encointer-primitives = { path = "../../primitives", version = "3.0.2" }
-encointer-rpc = { path = "../../rpc", version = "3.0.2" }
+encointer-balances-tx-payment-rpc-runtime-api = { workspace = true }
+encointer-primitives = { workspace = true }
+encointer-rpc = { workspace = true }
# substrate deps
-pallet-transaction-payment = { version = "25.0.0" }
-pallet-transaction-payment-rpc = { version = "27.0.0" }
-sc-rpc = "26.0.0"
-sc-rpc-api = "0.30.0"
-sp-api = "23.0.0"
-sp-blockchain = "25.0.0"
-sp-core = "25.0.0"
-sp-rpc = "23.0.0"
-sp-runtime = "28.0.0"
+pallet-transaction-payment = { workspace = true, features = ["std"] }
+pallet-transaction-payment-rpc = { workspace = true }
+sc-rpc = { workspace = true }
+sc-rpc-api = { workspace = true }
+sp-api = { workspace = true, features = ["std"] }
+sp-blockchain = { workspace = true }
+sp-core = { workspace = true, features = ["std"] }
+sp-rpc = { workspace = true }
+sp-runtime = { workspace = true, features = ["std"] }
diff --git a/balances-tx-payment/rpc/runtime-api/Cargo.toml b/balances-tx-payment/rpc/runtime-api/Cargo.toml
index 40607ba9..b3ec4754 100644
--- a/balances-tx-payment/rpc/runtime-api/Cargo.toml
+++ b/balances-tx-payment/rpc/runtime-api/Cargo.toml
@@ -10,23 +10,21 @@ license = "GPL-3.0-or-later"
[dependencies]
# local deps
-encointer-primitives = { path = "../../../primitives", default-features = false, version = "3.0.2" }
+encointer-primitives = { workspace = true }
# substrate deps
-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = [
- "derive",
-] }
-frame-support = { default-features = false, version = "25.0.0" }
-scale-info = { version = "2.10.0", default-features = false }
-sp-api = { default-features = false, version = "23.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+frame-support = { workspace = true }
+parity-scale-codec = { workspace = true }
+scale-info = { workspace = true }
+sp-api = { workspace = true }
+sp-std = { workspace = true }
[features]
default = ["std"]
std = [
- "codec/std",
"encointer-primitives/std",
"frame-support/std",
+ "parity-scale-codec/std",
"scale-info/std",
"sp-api/std",
"sp-std/std",
diff --git a/balances-tx-payment/rpc/src/lib.rs b/balances-tx-payment/rpc/src/lib.rs
index f17f198c..6d93f3aa 100644
--- a/balances-tx-payment/rpc/src/lib.rs
+++ b/balances-tx-payment/rpc/src/lib.rs
@@ -14,7 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Encointer. If not, see .
-use codec::Codec;
use core::fmt::Display;
use encointer_balances_tx_payment_rpc_runtime_api::{
BalancesTxPaymentApi as BalancesTxPaymentApiRuntimeApi, Error,
@@ -27,6 +26,7 @@ use jsonrpsee::{
pub use pallet_transaction_payment::RuntimeDispatchInfo;
use pallet_transaction_payment::{FeeDetails, InclusionFee};
use pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi;
+use parity_scale_codec::Codec;
use sp_api::{Decode, Encode, ProvideRuntimeApi};
use sp_blockchain::HeaderBackend;
use sp_core::Bytes;
diff --git a/balances/Cargo.toml b/balances/Cargo.toml
index 39d70cd6..a8235516 100644
--- a/balances/Cargo.toml
+++ b/balances/Cargo.toml
@@ -9,42 +9,38 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-approx = { version = "0.5.1", optional = true }
-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = [
- "derive",
-] }
-log = { version = "0.4.20", default-features = false }
-scale-info = { version = "2.10.0", default-features = false }
+approx = { workspace = true, optional = true }
+log = { workspace = true }
+parity-scale-codec = { workspace = true }
+scale-info = { workspace = true }
# local deps
-encointer-primitives = { path = "../primitives", default-features = false, features = ["serde_derive"], version = "3.0.2" }
+encointer-primitives = { workspace = true }
# substrate deps
-frame-benchmarking = { default-features = false, optional = true, version = "25.0.0" }
-frame-support = { default-features = false, version = "25.0.0" }
-frame-system = { default-features = false, version = "25.0.0" }
-pallet-asset-tx-payment = { default-features = false, version = "25.0.0" }
-pallet-transaction-payment = { default-features = false, version = "25.0.0" }
-sp-runtime = { default-features = false, version = "28.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+frame-benchmarking = { workspace = true, optional = true }
+frame-support = { workspace = true }
+frame-system = { workspace = true }
+pallet-asset-tx-payment = { workspace = true }
+pallet-transaction-payment = { workspace = true }
+sp-runtime = { workspace = true }
+sp-std = { workspace = true }
[dev-dependencies]
-approx = "0.5.1"
-sp-io = "27.0.0"
-test-utils = { path = "../test-utils" }
+approx = { workspace = true, features = ["std"] }
+sp-io = { workspace = true, features = ["std"] }
+test-utils = { workspace = true }
[features]
default = ["std"]
std = [
- "codec/std",
- # local deps
"encointer-primitives/std",
- # substrate deps
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-asset-tx-payment/std",
"pallet-transaction-payment/std",
+ "parity-scale-codec/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
diff --git a/balances/src/mock.rs b/balances/src/mock.rs
index bff9043e..0a3d7217 100644
--- a/balances/src/mock.rs
+++ b/balances/src/mock.rs
@@ -35,7 +35,7 @@ frame_support::construct_runtime!(
System: frame_system::{Pallet, Call, Config, Storage, Event},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Balances: pallet_balances::{Pallet, Call, Storage, Config, Event},
- EncointerScheduler: encointer_scheduler::{Pallet, Call, Storage, Config, Event},
+ EncointerScheduler: pallet_encointer_scheduler::{Pallet, Call, Storage, Config, Event},
EncointerBalances: dut::{Pallet, Call, Storage, Event, Config},
}
);
diff --git a/bazaar/Cargo.toml b/bazaar/Cargo.toml
index a5eefcba..e20e377c 100644
--- a/bazaar/Cargo.toml
+++ b/bazaar/Cargo.toml
@@ -9,51 +9,47 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = [
- "derive",
-] }
-log = { version = "0.4.20", default-features = false }
-scale-info = { version = "2.10.0", default-features = false }
+log = { workspace = true }
+parity-scale-codec = { workspace = true }
+scale-info = { workspace = true }
# local deps
-encointer-communities = { package = "pallet-encointer-communities", path = "../communities", default-features = false, version = "3.0.3" }
-encointer-primitives = { path = "../primitives", default-features = false, features = ["serde_derive"], version = "3.0.2" }
+encointer-primitives = { workspace = true }
+pallet-encointer-communities = { workspace = true }
# substrate deps
-frame-benchmarking = { default-features = false, optional = true, version = "25.0.0" }
-frame-support = { default-features = false, version = "25.0.0" }
-frame-system = { default-features = false, version = "25.0.0" }
-sp-core = { default-features = false, version = "25.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+frame-benchmarking = { workspace = true, optional = true }
+frame-support = { workspace = true }
+frame-system = { workspace = true }
+sp-core = { workspace = true }
+sp-std = { workspace = true }
[dev-dependencies]
-sp-io = "27.0.0"
-test-utils = { path = "../test-utils" }
+sp-io = { workspace = true, features = ["std"] }
+test-utils = { workspace = true }
[features]
default = ["std"]
std = [
- "codec/std",
- # local deps
- "encointer-communities/std",
"encointer-primitives/std",
- # substrate deps
"frame-support/std",
"frame-system/std",
"log/std",
+ "pallet-encointer-communities/std",
+ "parity-scale-codec/std",
"scale-info/std",
"sp-core/std",
"sp-std/std",
]
runtime-benchmarks = [
- "encointer-communities/runtime-benchmarks",
+ "pallet-encointer-communities/runtime-benchmarks",
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
]
try-runtime = [
- "encointer-communities/try-runtime",
"frame-system/try-runtime",
+ "pallet-encointer-communities/try-runtime",
]
diff --git a/bazaar/rpc/Cargo.toml b/bazaar/rpc/Cargo.toml
index dab4a9f9..ca50ca98 100644
--- a/bazaar/rpc/Cargo.toml
+++ b/bazaar/rpc/Cargo.toml
@@ -9,23 +9,19 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-jsonrpsee = { version = "0.16.3", features = [
- "client-core",
- "server",
- "macros",
-] }
-log = "0.4.20"
-parking_lot = "0.12.0"
-thiserror = "1.0.31"
+jsonrpsee = { workspace = true }
+log = { workspace = true, features = ["std"] }
+parking_lot = { workspace = true }
+thiserror = { workspace = true }
# local deps
-encointer-bazaar-rpc-runtime-api = { package = "pallet-encointer-bazaar-rpc-runtime-api", path = "runtime-api", version = "3.0.2" }
-encointer-primitives = { path = "../../primitives", version = "3.0.2" }
-encointer-rpc = { path = "../../rpc", version = "3.0.2" }
+encointer-primitives = { workspace = true }
+encointer-rpc = { workspace = true }
+pallet-encointer-bazaar-rpc-runtime-api = { workspace = true }
# substrate deps
-sc-rpc = "26.0.0"
-sc-rpc-api = "0.30.0"
-sp-api = "23.0.0"
-sp-blockchain = "25.0.0"
-sp-runtime = "28.0.0"
+sc-rpc = { workspace = true }
+sc-rpc-api = { workspace = true }
+sp-api = { workspace = true, features = ["std"] }
+sp-blockchain = { workspace = true }
+sp-runtime = { workspace = true, features = ["std"] }
diff --git a/bazaar/rpc/runtime-api/Cargo.toml b/bazaar/rpc/runtime-api/Cargo.toml
index dac818d0..c3088881 100644
--- a/bazaar/rpc/runtime-api/Cargo.toml
+++ b/bazaar/rpc/runtime-api/Cargo.toml
@@ -10,12 +10,12 @@ license = "GPL-3.0-or-later"
[dependencies]
# local deps
-encointer-primitives = { path = "../../../primitives", default-features = false, version = "3.0.2" }
+encointer-primitives = { workspace = true }
# substrate deps
-frame-support = { default-features = false, version = "25.0.0" }
-sp-api = { default-features = false, version = "23.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+frame-support = { workspace = true }
+sp-api = { workspace = true }
+sp-std = { workspace = true }
[features]
default = ["std"]
diff --git a/bazaar/rpc/src/lib.rs b/bazaar/rpc/src/lib.rs
index 5e94e275..d1179369 100644
--- a/bazaar/rpc/src/lib.rs
+++ b/bazaar/rpc/src/lib.rs
@@ -21,11 +21,11 @@ use sp_blockchain::HeaderBackend;
use sp_runtime::traits::Block as BlockT;
use std::sync::Arc;
-use encointer_bazaar_rpc_runtime_api::BazaarApi as BazaarRuntimeApi;
use encointer_primitives::{
bazaar::{Business, BusinessIdentifier, OfferingData},
communities::CommunityIdentifier,
};
+use pallet_encointer_bazaar_rpc_runtime_api::BazaarApi as BazaarRuntimeApi;
#[rpc(client, server)]
pub trait BazaarApi
diff --git a/bazaar/src/benchmarking.rs b/bazaar/src/benchmarking.rs
index 5c749ffa..fcac52b7 100644
--- a/bazaar/src/benchmarking.rs
+++ b/bazaar/src/benchmarking.rs
@@ -24,10 +24,11 @@ fn create_community() -> CommunityIdentifier {
let bs = vec![alice.clone(), bob.clone(), charlie.clone()];
let community_meta: CommunityMetadata = CommunityMetadata::default();
- encointer_communities::Pallet::::set_min_solar_trip_time_s(RawOrigin::Root.into(), 1).ok();
- encointer_communities::Pallet::::set_max_speed_mps(RawOrigin::Root.into(), 83).ok();
+ pallet_encointer_communities::Pallet::::set_min_solar_trip_time_s(RawOrigin::Root.into(), 1)
+ .ok();
+ pallet_encointer_communities::Pallet::::set_max_speed_mps(RawOrigin::Root.into(), 83).ok();
- encointer_communities::Pallet::::new_community(
+ pallet_encointer_communities::Pallet::::new_community(
RawOrigin::Root.into(),
location,
bs.clone(),
diff --git a/bazaar/src/lib.rs b/bazaar/src/lib.rs
index 485df408..34591df8 100644
--- a/bazaar/src/lib.rs
+++ b/bazaar/src/lib.rs
@@ -43,7 +43,7 @@ pub mod pallet {
use frame_system::pallet_prelude::*;
#[pallet::config]
- pub trait Config: frame_system::Config + encointer_communities::Config {
+ pub trait Config: frame_system::Config + pallet_encointer_communities::Config {
type RuntimeEvent: From> + IsType<::RuntimeEvent>;
type WeightInfo: WeightInfo;
}
@@ -65,7 +65,7 @@ pub mod pallet {
let sender = ensure_signed(origin)?;
// Check that the supplied community is actually registered
ensure!(
- >::community_identifiers().contains(&cid),
+ >::community_identifiers().contains(&cid),
Error::::NonexistentCommunity
);
diff --git a/bazaar/src/mock.rs b/bazaar/src/mock.rs
index 69123e6a..60764e72 100644
--- a/bazaar/src/mock.rs
+++ b/bazaar/src/mock.rs
@@ -25,9 +25,9 @@ frame_support::construct_runtime!(
{
System: frame_system::{Pallet, Call, Config, Storage, Event},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
- EncointerScheduler: encointer_scheduler::{Pallet, Call, Storage, Config, Event},
- EncointerCommunities: encointer_communities::{Pallet, Call, Storage, Event},
- EncointerBalances: encointer_balances::{Pallet, Call, Storage, Event},
+ EncointerScheduler: pallet_encointer_scheduler::{Pallet, Call, Storage, Config, Event},
+ EncointerCommunities: pallet_encointer_communities::{Pallet, Call, Storage, Event},
+ EncointerBalances: pallet_encointer_balances::{Pallet, Call, Storage, Event},
EncointerBazaar: dut::{Pallet, Call, Storage, Event},
}
);
@@ -48,7 +48,7 @@ impl_encointer_scheduler!(TestRuntime);
pub fn new_test_ext() -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap();
- encointer_communities::GenesisConfig:: {
+ pallet_encointer_communities::GenesisConfig:: {
min_solar_trip_time_s: 1,
max_speed_mps: 83,
..Default::default()
diff --git a/ceremonies/Cargo.toml b/ceremonies/Cargo.toml
index 4d505218..c017bd77 100644
--- a/ceremonies/Cargo.toml
+++ b/ceremonies/Cargo.toml
@@ -9,56 +9,54 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = [
- "derive",
-] }
-log = { version = "0.4.20", default-features = false }
-scale-info = { version = "2.10.0", default-features = false }
+log = { workspace = true }
+parity-scale-codec = { workspace = true }
+scale-info = { workspace = true }
# local deps
-encointer-balances = { package = "pallet-encointer-balances", path = "../balances", default-features = false, version = "3.0.2" }
-encointer-ceremonies-assignment = { path = "assignment", default-features = false, version = "3.0.2" }
-encointer-communities = { package = "pallet-encointer-communities", path = "../communities", default-features = false, version = "3.0.3" }
-encointer-meetup-validation = { path = "meetup-validation", default-features = false, version = "3.0.2" }
-encointer-primitives = { path = "../primitives", default-features = false, features = ["serde_derive"], version = "3.0.2" }
-encointer-scheduler = { package = "pallet-encointer-scheduler", path = "../scheduler", default-features = false, version = "3.0.3" }
+encointer-ceremonies-assignment = { workspace = true }
+encointer-meetup-validation = { workspace = true }
+encointer-primitives = { workspace = true }
+pallet-encointer-balances = { workspace = true }
+pallet-encointer-communities = { workspace = true }
+pallet-encointer-scheduler = { workspace = true }
# substrate deps
-frame-support = { default-features = false, version = "25.0.0" }
-frame-system = { default-features = false, version = "25.0.0" }
-pallet-timestamp = { default-features = false, version = "24.0.0" }
-sp-core = { default-features = false, version = "25.0.0" }
-sp-io = { default-features = false, version = "27.0.0" }
-sp-runtime = { default-features = false, version = "28.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+frame-support = { workspace = true }
+frame-system = { workspace = true }
+pallet-timestamp = { workspace = true }
+sp-core = { workspace = true }
+sp-io = { workspace = true }
+sp-runtime = { workspace = true }
+sp-std = { workspace = true }
# benchmarking
-frame-benchmarking = { default-features = false, optional = true, version = "25.0.0" }
-sp-application-crypto = { default-features = false, optional = true, version = "27.0.0" }
+frame-benchmarking = { workspace = true, optional = true }
+sp-application-crypto = { workspace = true, optional = true }
[dev-dependencies]
-approx = "0.5.1"
-itertools = "0.10.3"
-rstest = "0.12.0"
-sp-io = "27.0.0"
-sp-keystore = "0.31.0"
-test-utils = { path = "../test-utils" }
+approx = { workspace = true }
+itertools = { workspace = true }
+rstest = { workspace = true }
+sp-io = { workspace = true, features = ["std"] }
+sp-keystore = { workspace = true }
+test-utils = { workspace = true }
[features]
default = ["std"]
std = [
- "codec/std",
- "encointer-balances/std",
"encointer-ceremonies-assignment/std",
- "encointer-communities/std",
"encointer-meetup-validation/std",
"encointer-primitives/std",
- "encointer-scheduler/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"log/std",
+ "pallet-encointer-balances/std",
+ "pallet-encointer-communities/std",
+ "pallet-encointer-scheduler/std",
"pallet-timestamp/std",
+ "parity-scale-codec/std",
"scale-info/std",
"sp-core/std",
"sp-io/std",
@@ -67,19 +65,19 @@ std = [
]
runtime-benchmarks = [
- "encointer-balances/runtime-benchmarks",
- "encointer-communities/runtime-benchmarks",
- "encointer-scheduler/runtime-benchmarks",
"frame-benchmarking",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
+ "pallet-encointer-balances/runtime-benchmarks",
+ "pallet-encointer-communities/runtime-benchmarks",
+ "pallet-encointer-scheduler/runtime-benchmarks",
"sp-application-crypto",
]
try-runtime = [
- "encointer-balances/try-runtime",
- "encointer-communities/try-runtime",
- "encointer-scheduler/try-runtime",
+ "pallet-encointer-balances/try-runtime",
+ "pallet-encointer-communities/try-runtime",
+ "pallet-encointer-scheduler/try-runtime",
"frame-system/try-runtime",
]
diff --git a/ceremonies/assignment/Cargo.toml b/ceremonies/assignment/Cargo.toml
index 3a1f9beb..5b0f3af2 100644
--- a/ceremonies/assignment/Cargo.toml
+++ b/ceremonies/assignment/Cargo.toml
@@ -10,14 +10,14 @@ license = "GPL-3.0-or-later"
[dependencies]
# local deps
-encointer-primitives = { path = "../../primitives", default-features = false, version = "3.0.2" }
+encointer-primitives = { workspace = true }
# substrate deps
-sp-runtime = { default-features = false, version = "28.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+sp-runtime = { workspace = true }
+sp-std = { workspace = true }
[dev-dependencies]
-sp-core = "25.0.0"
+sp-core = { workspace = true, features = ["std"] }
[features]
default = ["std"]
diff --git a/ceremonies/meetup-validation/Cargo.toml b/ceremonies/meetup-validation/Cargo.toml
index 922d2910..e35e52d7 100644
--- a/ceremonies/meetup-validation/Cargo.toml
+++ b/ceremonies/meetup-validation/Cargo.toml
@@ -9,31 +9,26 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-codec = { package = "parity-scale-codec", version = "3.6.4", default-features = false, features = [
- "derive",
-] }
-scale-info = { version = "2.10.0", default-features = false }
-serde = { version = "1.0.188", default-features = false, features = [
- "derive",
- "alloc",
-] }
+parity-scale-codec = { workspace = true }
+scale-info = { workspace = true }
+serde = { workspace = true }
# local deps
-encointer-primitives = { path = "../../primitives", default-features = false, version = "3.0.2" }
+encointer-primitives = { workspace = true }
# substrate deps
-sp-runtime = { default-features = false, version = "28.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+sp-runtime = { workspace = true }
+sp-std = { workspace = true }
[dev-dependencies]
-rstest = "0.12.0"
-sp-core = "25.0.0"
+rstest = { workspace = true }
+sp-core = { workspace = true, features = ["std"] }
[features]
default = ["std"]
std = [
- "codec/std",
"encointer-primitives/std",
+ "parity-scale-codec/std",
"scale-info/std",
"serde/std",
"sp-runtime/std",
diff --git a/ceremonies/meetup-validation/src/lib.rs b/ceremonies/meetup-validation/src/lib.rs
index 9437770f..f0ad51f0 100644
--- a/ceremonies/meetup-validation/src/lib.rs
+++ b/ceremonies/meetup-validation/src/lib.rs
@@ -1,5 +1,5 @@
#![cfg_attr(not(feature = "std"), no_std)]
-use codec::{Decode, Encode, MaxEncodedLen};
+use parity_scale_codec::{Decode, Encode, MaxEncodedLen};
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_std::{vec, vec::Vec};
diff --git a/ceremonies/rpc/Cargo.toml b/ceremonies/rpc/Cargo.toml
index 5778c0e5..ded6023e 100644
--- a/ceremonies/rpc/Cargo.toml
+++ b/ceremonies/rpc/Cargo.toml
@@ -9,23 +9,19 @@ repository = "https://github.com/encointer/pallets"
license = "GPL-3.0-or-later"
[dependencies]
-jsonrpsee = { version = "0.16.3", features = [
- "client-core",
- "server",
- "macros",
-] }
-log = "0.4.20"
-parking_lot = "0.12.0"
-thiserror = "1.0.31"
+jsonrpsee = { workspace = true }
+log = { workspace = true, features = ["std"] }
+parking_lot = { workspace = true }
+thiserror = { workspace = true }
# local deps
-encointer-ceremonies-rpc-runtime-api = { package = "pallet-encointer-ceremonies-rpc-runtime-api", path = "runtime-api", version = "3.0.2" }
-encointer-primitives = { path = "../../primitives", version = "3.0.2" }
-encointer-rpc = { path = "../../rpc", version = "3.0.2" }
+encointer-primitives = { workspace = true }
+encointer-rpc = { workspace = true }
+pallet-encointer-ceremonies-rpc-runtime-api = { workspace = true }
# substrate deps
-sc-rpc = "26.0.0"
-sc-rpc-api = "0.30.0"
-sp-api = "23.0.0"
-sp-blockchain = "25.0.0"
-sp-runtime = "28.0.0"
+sc-rpc = { workspace = true }
+sc-rpc-api = { workspace = true }
+sp-api = { workspace = true, features = ["std"] }
+sp-blockchain = { workspace = true }
+sp-runtime = { workspace = true, features = ["std"] }
diff --git a/ceremonies/rpc/runtime-api/Cargo.toml b/ceremonies/rpc/runtime-api/Cargo.toml
index 19a368c0..de169c13 100644
--- a/ceremonies/rpc/runtime-api/Cargo.toml
+++ b/ceremonies/rpc/runtime-api/Cargo.toml
@@ -10,12 +10,12 @@ license = "GPL-3.0-or-later"
[dependencies]
# local deps
-encointer-primitives = { path = "../../../primitives", default-features = false, version = "3.0.2" }
+encointer-primitives = { workspace = true }
# substrate deps
-frame-support = { default-features = false, version = "25.0.0" }
-sp-api = { default-features = false, version = "23.0.0" }
-sp-std = { default-features = false, version = "12.0.0" }
+frame-support = { workspace = true }
+sp-api = { workspace = true }
+sp-std = { workspace = true }
[features]
default = ["std"]
diff --git a/ceremonies/rpc/src/lib.rs b/ceremonies/rpc/src/lib.rs
index 7b69d1f0..ef1743ad 100644
--- a/ceremonies/rpc/src/lib.rs
+++ b/ceremonies/rpc/src/lib.rs
@@ -25,7 +25,6 @@ use sp_blockchain::HeaderBackend;
use sp_runtime::traits::Block as BlockT;
use std::sync::Arc;
-use encointer_ceremonies_rpc_runtime_api::CeremoniesApi as CeremoniesRuntimeApi;
use encointer_primitives::{
ceremonies::{
reputation_cache_dirty_key, reputation_cache_key, AggregatedAccountData, CeremonyInfo,
@@ -34,6 +33,7 @@ use encointer_primitives::{
communities::CommunityIdentifier,
scheduler::CeremonyIndexType,
};
+use pallet_encointer_ceremonies_rpc_runtime_api::CeremoniesApi as CeremoniesRuntimeApi;
#[rpc(client, server)]
pub trait CeremoniesApi
diff --git a/ceremonies/src/benchmarking.rs b/ceremonies/src/benchmarking.rs
index 5f2c2aa6..de197ca5 100644
--- a/ceremonies/src/benchmarking.rs
+++ b/ceremonies/src/benchmarking.rs
@@ -45,19 +45,19 @@ fn test_location() -> Location {
fn create_community() -> CommunityIdentifier {
let location = test_location();
let bs = bootstrappers::();
- encointer_scheduler::Pallet::::set_phase_duration(
+ pallet_encointer_scheduler::Pallet::::set_phase_duration(
RawOrigin::Root.into(),
CeremonyPhaseType::Assigning,
10u32.into(),
)
.ok();
- encointer_scheduler::Pallet::::set_phase_duration(
+ pallet_encointer_scheduler::Pallet::::set_phase_duration(
RawOrigin::Root.into(),
CeremonyPhaseType::Attesting,
10u32.into(),
)
.ok();
- encointer_scheduler::Pallet::::set_phase_duration(
+ pallet_encointer_scheduler::Pallet::::set_phase_duration(
RawOrigin::Root.into(),
CeremonyPhaseType::Registering,
10u32.into(),
@@ -73,9 +73,10 @@ fn create_community() -> CommunityIdentifier {
Pallet::::set_location_tolerance(RawOrigin::Root.into(), 1000).ok();
Pallet::::set_time_tolerance(RawOrigin::Root.into(), 1_000_000u32.into()).ok();
- encointer_communities::Pallet::::set_min_solar_trip_time_s(RawOrigin::Root.into(), 1).ok();
- encointer_communities::Pallet::::set_max_speed_mps(RawOrigin::Root.into(), 83).ok();
- encointer_communities::Pallet::::new_community(
+ pallet_encointer_communities::Pallet::::set_min_solar_trip_time_s(RawOrigin::Root.into(), 1)
+ .ok();
+ pallet_encointer_communities::Pallet::::set_max_speed_mps(RawOrigin::Root.into(), 83).ok();
+ pallet_encointer_communities::Pallet::::new_community(
RawOrigin::Root.into(),
location,
bs.clone(),
@@ -113,7 +114,7 @@ where
/// We purposely don't use `run_to_next_phase` because in the actual node aura complained
/// when the timestamps were manipulated.
fn next_phase() {
- encointer_scheduler::Pallet::::next_phase(RawOrigin::Root.into()).unwrap();
+ pallet_encointer_scheduler::Pallet::::next_phase(RawOrigin::Root.into()).unwrap();
}
pub fn account_id(account: &TestPublic) -> T::AccountId
@@ -131,10 +132,10 @@ where
::AccountId: ByteArray,
::Signature: From,
{
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
let prover_account: T::AccountId = account_id::(prover);
- assert_ok!(encointer_balances::Pallet::::issue(
+ assert_ok!(pallet_encointer_balances::Pallet::::issue(
cid,
&prover_account,
NominalIncome::from_num(1)
@@ -145,7 +146,7 @@ where
Reputation::VerifiedUnlinked
);
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
IssuedRewards::::insert((cid, cindex - 1), 0, MeetupResult::Ok);
let proof = create_proof_of_attendance::(prover_account, cid, cindex - 1, prover);
proof
@@ -212,7 +213,7 @@ benchmarks! {
let zoran = generate_pair();
let zoran_account= account_id::(&zoran);
let proof = fake_last_attendance_and_get_proof::(&zoran, cid);
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
assert_eq!(ReputableCount::::get((cid, cindex)), 0);
}: _(RawOrigin::Signed(zoran_account.clone()), cid, Some(proof))
@@ -230,7 +231,7 @@ benchmarks! {
let zoran = generate_pair();
let zoran_account= account_id::(&zoran);
let proof = fake_last_attendance_and_get_proof::(&zoran, cid);
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
assert_ok!(Pallet::::register_participant(
RawOrigin::Signed(zoran_account.clone()).into(),
@@ -255,7 +256,7 @@ benchmarks! {
let zoran = generate_pair();
let zoran_account= account_id::(&zoran);
let proof = fake_last_attendance_and_get_proof::(&zoran, cid);
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
assert_ok!(Pallet::::register_participant(
RawOrigin::Signed(zoran_account.clone()).into(),
@@ -294,7 +295,7 @@ benchmarks! {
next_phase::();
next_phase::();
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
let mindex = 1;
}: _(RawOrigin::Signed(attestor_account.clone()), cid, 3, attestees)
@@ -306,14 +307,14 @@ benchmarks! {
endorse_newcomer {
let cid = create_community::();
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
// we let the newbie be endorsed by a reputable as this is the worst case scenario
let zoran = account_id::(&generate_pair());
Pallet::::fake_reputation((cid, cindex - 1), &zoran, Reputation::VerifiedUnlinked);
// issue some income such that newbies are allowed to register
- assert_ok!(encointer_balances::Pallet::::issue(
+ assert_ok!(pallet_encointer_balances::Pallet::::issue(
cid,
&zoran,
NominalIncome::from_num(1)
@@ -340,7 +341,7 @@ benchmarks! {
next_phase::();
next_phase::();
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
let loc = test_location();
let time = crate::Pallet::::get_meetup_time(loc).expect("Could not get meetup time");
let mindex = 1;
@@ -408,7 +409,7 @@ benchmarks! {
purge_community_ceremony {
let cid = create_community::();
- let cindex = encointer_scheduler::Pallet::::current_ceremony_index();
+ let cindex = pallet_encointer_scheduler::Pallet::::current_ceremony_index();
let user = generate_pair();
assert_ok!(Pallet::::register_participant(RawOrigin::Signed(account_id::(&user.clone())).into(), cid, Some(fake_last_attendance_and_get_proof::(&user.clone(), cid))));
assert_eq!(ReputableCount::::get((cid, cindex)), 1);
diff --git a/ceremonies/src/lib.rs b/ceremonies/src/lib.rs
index c4bbf945..59341f36 100644
--- a/ceremonies/src/lib.rs
+++ b/ceremonies/src/lib.rs
@@ -25,7 +25,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
-use codec::{Decode, Encode};
use encointer_ceremonies_assignment::{
assignment_fn_inverse, generate_assignment_function_params, get_meetup_location_index,
math::{checked_ceil_division, find_prime_below, find_random_coprime_below},
@@ -39,7 +38,6 @@ use encointer_primitives::{
scheduler::{CeremonyIndexType, CeremonyPhaseType},
RandomNumberGenerator,
};
-use encointer_scheduler::OnCeremonyPhaseChange;
use frame_support::{
dispatch::{DispatchResult, DispatchResultWithPostInfo, Pays},
ensure,
@@ -48,6 +46,8 @@ use frame_support::{
};
use frame_system::ensure_signed;
use log::{debug, error, info, trace, warn};
+use pallet_encointer_scheduler::OnCeremonyPhaseChange;
+use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
use sp_core::bounded::BoundedSlice;
use sp_runtime::traits::{IdentifyAccount, Member, Verify};
@@ -80,9 +80,9 @@ pub mod pallet {
pub trait Config:
frame_system::Config
+ pallet_timestamp::Config
- + encointer_communities::Config
- + encointer_balances::Config
- + encointer_scheduler::Config
+ + pallet_encointer_communities::Config
+ + pallet_encointer_balances::Config
+ + pallet_encointer_scheduler::Config
{
type RuntimeEvent: From> + IsType<::RuntimeEvent>;
@@ -117,18 +117,18 @@ pub mod pallet {
proof: Option>,
) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
- let current_phase = >::current_phase();
+ let current_phase = >::current_phase();
ensure!(
CeremonyPhaseType::is_registering_or_attesting(¤t_phase),
Error::::RegisteringOrAttestationPhaseRequired
);
ensure!(
- >::community_identifiers().contains(&cid),
+ >::community_identifiers().contains(&cid),
Error::::InexistentCommunity
);
- let mut cindex = >::current_ceremony_index();
+ let mut cindex = >::current_ceremony_index();
if current_phase == CeremonyPhaseType::Attesting {
cindex += 1
@@ -190,9 +190,9 @@ pub mod pallet {
proof: ProofOfAttendance,
) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin.clone())?;
- let current_phase = >::current_phase();
+ let current_phase = >::current_phase();
ensure!(
- >::community_identifiers().contains(&cid),
+ >::community_identifiers().contains(&cid),
Error::::InexistentCommunity
);
@@ -201,7 +201,7 @@ pub mod pallet {
Error::::RegisteringOrAttestationPhaseRequired
);
- let mut cindex = >::current_ceremony_index();
+ let mut cindex = >::current_ceremony_index();
if current_phase == CeremonyPhaseType::Attesting {
cindex += 1
@@ -226,18 +226,18 @@ pub mod pallet {
maybe_reputation_community_ceremony: Option,
) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
- let current_phase = >::current_phase();
+ let current_phase = >::current_phase();
ensure!(
CeremonyPhaseType::is_registering_or_attesting(¤t_phase),
Error::::RegisteringOrAttestationPhaseRequired
);
ensure!(
- >::community_identifiers().contains(&cid),
+ >::community_identifiers().contains(&cid),
Error::::InexistentCommunity
);
- let mut cindex = >::current_ceremony_index();
+ let mut cindex = >::current_ceremony_index();
if current_phase == CeremonyPhaseType::Attesting {
cindex += 1
@@ -279,11 +279,12 @@ pub mod pallet {
) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
ensure!(
- >::current_phase() == CeremonyPhaseType::Attesting,
+ >::current_phase()
+ == CeremonyPhaseType::Attesting,
Error::::AttestationPhaseRequired
);
ensure!(
- >::community_identifiers().contains(&cid),
+ >::community_identifiers().contains(&cid),
Error::::InexistentCommunity
);
@@ -330,12 +331,14 @@ pub mod pallet {
let sender = ensure_signed(origin)?;
ensure!(
- >::community_identifiers().contains(&cid),
+ >::community_identifiers().contains(&cid),
Error::::InexistentCommunity
);
- let mut cindex = >::current_ceremony_index();
- if >::current_phase() != CeremonyPhaseType::Registering {
+ let mut cindex = >::current_ceremony_index();
+ if >::current_phase()
+ != CeremonyPhaseType::Registering
+ {
cindex += 1; //safe; cindex comes from within, will not overflow at +1/d
}
@@ -372,8 +375,8 @@ pub mod pallet {
) -> DispatchResultWithPostInfo {
let participant = &ensure_signed(origin)?;
- let current_phase = >::current_phase();
- let mut cindex = >::current_ceremony_index();
+ let current_phase = >::current_phase();
+ let mut cindex = >::current_ceremony_index();
match current_phase {
CeremonyPhaseType::Registering => cindex -= 1,
CeremonyPhaseType::Attesting => (),
@@ -573,7 +576,9 @@ pub mod pallet {
meetup_time_offset: MeetupTimeOffsetType,
) -> DispatchResultWithPostInfo {
::CeremonyMaster::ensure_origin(origin)?;
- if >::current_phase() != CeremonyPhaseType::Registering {
+ if >::current_phase()
+ != CeremonyPhaseType::Registering
+ {
return Err(>::WrongPhaseForChangingMeetupTimeOffset.into());
}
@@ -1103,9 +1108,9 @@ impl Pallet {
cid: CommunityIdentifier,
account: &T::AccountId,
) -> AggregatedAccountData {
- let cindex = >::current_ceremony_index();
+ let cindex = >::current_ceremony_index();
let aggregated_account_data_global = AggregatedAccountDataGlobal {
- ceremony_phase: >::current_phase(),
+ ceremony_phase: >::current_phase(),
ceremony_index: cindex,
};
@@ -1123,7 +1128,7 @@ impl Pallet {
// check if the participant is already assigned to a meetup
if let Some(participant_meetup_index) = Self::get_meetup_index((cid, cindex), account) {
meetup_index = Some(participant_meetup_index);
- let locations = >::get_locations(&cid);
+ let locations = >::get_locations(&cid);
let location_assignment_params = Self::assignments((cid, cindex)).locations;
meetup_location_index = get_meetup_location_index(
@@ -1160,8 +1165,8 @@ impl Pallet {
pub fn get_ceremony_info() -> CeremonyInfo {
CeremonyInfo {
- ceremony_phase: >::current_phase(),
- ceremony_index: >::current_ceremony_index(),
+ ceremony_phase: >::current_phase(),
+ ceremony_index: >::current_ceremony_index(),
}
}
@@ -1172,7 +1177,7 @@ impl Pallet {
is_reputable: bool,
) -> Result> {
let participant_type =
- if >::bootstrappers(cid).contains(sender) {
+ if >::bootstrappers(cid).contains(sender) {
let participant_index = >::get((cid, cindex))
.checked_add(1)
.ok_or(Error::::RegistryOverflow)?;
@@ -1180,7 +1185,7 @@ impl Pallet {
>::insert((cid, cindex), sender, participant_index);
>::insert((cid, cindex), participant_index);
ParticipantType::Bootstrapper
- } else if >::total_issuance(cid) <= 0 {
+ } else if >::total_issuance(cid) <= 0 {
return Err(Error::::OnlyBootstrappers);
} else if is_reputable {
let participant_index = >::get((cid, cindex))
@@ -1217,7 +1222,9 @@ impl Pallet {
cindex: CeremonyIndexType,
participant: &T::AccountId,
) -> Result<(), Error> {
- if >::current_phase() != CeremonyPhaseType::Registering {
+ if >::current_phase()
+ != CeremonyPhaseType::Registering
+ {
return Err(>::WrongPhaseForUnregistering);
}
@@ -1290,7 +1297,7 @@ impl Pallet {
return Ok(());
}
- if >::bootstrappers(cid).contains(sender)
+ if >::bootstrappers(cid).contains(sender)
&& >::get(cid, sender)
< Self::endorsement_tickets_per_bootstrapper()
{
@@ -1349,7 +1356,7 @@ impl Pallet {
}
fn purge_registry(cindex: CeremonyIndexType) {
- let cids = >::community_identifiers();
+ let cids = >::community_identifiers();
for cid in cids.into_iter() {
Self::purge_community_ceremony_internal((cid, cindex));
}
@@ -1417,7 +1424,8 @@ impl Pallet {
random_source: &mut RandomNumberGenerator,
) -> AssignmentParams {
let num_locations =
- >::get_locations(&community_ceremony.0).len() as u64;
+ >::get_locations(&community_ceremony.0).len()
+ as u64;
AssignmentParams {
m: num_locations,
@@ -1431,7 +1439,8 @@ impl Pallet {
meetup_multiplier: u64,
) -> Result> {
let num_locations =
- >::get_locations(&community_ceremony.0).len() as u64;
+ >::get_locations(&community_ceremony.0).len()
+ as u64;
debug!(
target: LOG,
"Number of locations for cid {:?} is {:?}", community_ceremony.0, num_locations
@@ -1513,7 +1522,7 @@ impl Pallet {
}
fn purge_community(cid: CommunityIdentifier) {
- let current = >::current_ceremony_index();
+ let current = >::current_ceremony_index();
let reputation_lifetime = Self::reputation_lifetime();
for cindex in current.saturating_sub(reputation_lifetime)..=current {
@@ -1525,12 +1534,12 @@ impl Pallet {
#[allow(deprecated)]
>::remove_prefix(cid, None);
- >::remove_community(cid);
+ >::remove_community(cid);
}
fn generate_all_meetup_assignment_params() {
- let cids = >::community_identifiers();
- let cindex = >::current_ceremony_index();
+ let cids = >::community_identifiers();
+ let cindex = >::current_ceremony_index();
// we don't need to pass a subject here, as this is only called once in a block.
let mut random_source =
@@ -1724,7 +1733,7 @@ impl Pallet {
cc: CommunityCeremony,
meetup_idx: MeetupIndexType,
) -> Option {
- let locations = >::get_locations(&cc.0);
+ let locations = >::get_locations(&cc.0);
let assignment_params = Self::assignments(cc).locations;
meetup_location(meetup_idx, locations, assignment_params)
@@ -1732,13 +1741,15 @@ impl Pallet {
// this function only works during ATTESTING, so we're keeping it for private use
pub(crate) fn get_meetup_time(location: Location) -> Option {
- if !(>::current_phase() == CeremonyPhaseType::Attesting) {
+ if !(>::current_phase()
+ == CeremonyPhaseType::Attesting)
+ {
return None;
}
let duration =
- >::phase_durations(CeremonyPhaseType::Attesting);
- let next = >::next_phase_timestamp();
+ >::phase_durations(CeremonyPhaseType::Attesting);
+ let next = >::next_phase_timestamp();
let start = next - duration;
Some(meetup_time::(
@@ -1752,7 +1763,7 @@ impl Pallet {
/// Returns the community-specific nominal income if it is set. Otherwise returns the
/// the ceremony reward defined in the genesis config.
pub fn nominal_income(cid: &CommunityIdentifier) -> NominalIncome {
- encointer_communities::NominalIncome::::try_get(cid)
+ pallet_encointer_communities::NominalIncome::::try_get(cid)
.unwrap_or_else(|_| Self::ceremony_reward())
}
@@ -1771,7 +1782,7 @@ impl Pallet {
.ok_or(Error::::MeetupValidationIndexOutOfBounds)?;
trace!(target: LOG, "participant merits reward: {:?}", participant);
- if >::issue(cid, participant, reward).is_ok() {
+ if >::issue(cid, participant, reward).is_ok() {
>::insert(
(&cid, cindex),
participant,
@@ -1828,7 +1839,7 @@ impl Pallet {
cid: &CommunityIdentifier,
participant: &T::AccountId,
) -> Result, Error> {
- let cindex =