Society v2 (#11324)

* New Society

* More logic drafting

* More work

* Building

* Some tests

* Fixes

* Improvements to the voting process

* More tests

* Test number 20

* Tests

* 30 tests

* Another test]

* All tests enabled

* Minor stuff

* generate_storage_alias: Rewrite as proc macro attribute

This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing
this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This
makes storage aliases work in migrations for all kind of chains and not just for the ones that use
predefined prefixes.

* Maintenance operations don't pay fee

* Fix compilation and FMT

* Moare fixes

* Migrations

* Fix tests and add migration testing

* Introduce lazy-cleanup and avoid unbounded prefix removal

* Fixes

* Fixes

* [WIP][Society] Adding benchmarking to the v2. (#11776)

* [Society] Adding benchmarking to the v2.

* [Society] Code review.

* [Society] Better code.

* Using clear() + clear_prefix() and adding more tests.

* Benchmarking again...

* Fix Cargo

* Fixes

* Fixes

* Spelling

* Fix benchmarks

* Another fix

* Remove println

---------

Co-authored-by: Bastian Köcher <info@kchr.de>
Co-authored-by: Artur Gontijo <arturgontijo@users.noreply.github.com>
This commit is contained in:
Gavin Wood
2023-06-18 18:22:17 +02:00
committed by GitHub
parent 116b6e65dc
commit 33a6536299
25 changed files with 3416 additions and 1444 deletions
+11 -1
View File
@@ -43,7 +43,7 @@ pub use sp_core::storage::StateVersion;
pub use sp_core::storage::{Storage, StorageChild};
use sp_core::{
crypto::{self, ByteArray},
crypto::{self, ByteArray, FromEntropy},
ecdsa, ed25519,
hash::{H256, H512},
sr25519,
@@ -311,6 +311,16 @@ pub enum MultiSigner {
Ecdsa(ecdsa::Public),
}
impl FromEntropy for MultiSigner {
fn from_entropy(input: &mut impl codec::Input) -> Result<Self, codec::Error> {
Ok(match input.read_byte()? % 3 {
0 => Self::Ed25519(FromEntropy::from_entropy(input)?),
1 => Self::Sr25519(FromEntropy::from_entropy(input)?),
2.. => Self::Ecdsa(FromEntropy::from_entropy(input)?),
})
}
}
/// NOTE: This implementations is required by `SimpleAddressDeterminer`,
/// we convert the hash into some AccountId, it's fine to use any scheme.
impl<T: Into<H256>> crypto::UncheckedFrom<T> for MultiSigner {