* Change copyright year to 2023 from 2022
* Fix incorrect update of copyright year
* Remove years from copy right header
* Fix remaining files
* Fix typo in a header and remove update-copyright.sh
* Ranked Collective pallet
* Fixes
* benchmarks
* Weights
* Allow class voting in rank
Use bare ayes for calculating support.
Allow only promotion/demotion by one rank only.
Allow removal of member with rank zero only.
Use new Tally API
* Index by rank, still O(1).
* Custom vote weights
* Formatting
* Update frame/ranked-collective/src/lib.rs
* Broken :(
* origin guard; cleanup uses new API
* Formatting
* Promote/demote by rank
* Formatting
* Use new API
* Remove code in another PR
* Remove code in another PR
* Formatting
* Remove code in another PR
* Docs
* Docs
* Bump
* Fixes
* Formatting
* Fixes
* 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.
* Fix compilation and FMT
* Moare fixes
* 🤦
* ......
* Rework the syntax and support instancing
* FMT
* Prefix variants with `Storage`
* Make it compile
* Fix where clause on rust stable
* Use proper bounded vector type for nominations
* add docs and tweak chill_other for cleanup purposes
* Fix the build
* remove TODO
* add a bit more doc
* even more docs
gushc
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* Update frame/staking/src/pallet/mod.rs
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
* Fix the nasty bug
* also bound the Snapshot type
* fix doc test
* document bounded_vec
* self-review
* remove unused
* Fix build
* frame-support: repetition overload for bounded_vec
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* fix
* remove the need to allocate into unbounded voters etc etc
* Don't expect
* unbreal the build again
* handle macro a bit better
Co-authored-by: Zeke Mostov <z.mostov@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
* Gav wrote this code in pull #10195. Extracting to simplify that PR.
* fix potential panics
* prevent panics in slide
* update doc
* fmt
* Update frame/support/src/storage/bounded_vec.rs
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Gav Wood <gavin@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
* some improvements to bounded vec
* revert license tweak
* more tests
* fix
* Update frame/support/src/storage/bounded_vec.rs
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* add the same stuff for btree map and set as well
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* Prepare UI tests for rust 1.54
* Delete wrong_page.stderr
* CI: run with a staging CI image
* Revert "CI: run with a staging CI image"
This reverts commit 66f5b00d14b50fd9d8fbf773f7e884f380697591.
* CI: debug, again
* LOG_TARGET is only used in std
* Remove unnecessary unsafe
* Fixes
* Use correct rustc locally
* FMT
* Compile with benchmarking
* Review feedback
* Some ui tests
* I know...
* Fix wasm tests
Co-authored-by: Denis P <denis.pisarev@parity.io>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
* Run cargo fmt on the whole code base
* Second run
* Add CI check
* Fix compilation
* More unnecessary braces
* Handle weights
* Use --all
* Use correct attributes...
* Fix UI tests
* AHHHHHHHHH
* 🤦
* Docs
* Fix compilation
* 🤷
* Please stop
* 🤦 x 2
* More
* make rustfmt.toml consistent with polkadot
Co-authored-by: André Silva <andrerfosilva@gmail.com>
* Ensure data size of identity pallet is bounded
* Fix unit tests for identity pallet
* Move identity pallet custom types into its own module
* Make use of NoBound family traits
* Fix identity pallet benchmarks
* Enumerate type imports
* Properly convert to BoundedVec in benchmarks
* Re-export types
* Use BoundedVec when storing sub identities
* Add generate_storage_info
* Manually implement MaxEncodedLen on select types
* Use ConstU32 instead of parameter_type
* Leverage DefaultNoBound and add some comments
* Use max_encoded_len() instead of hardcoded constant
* Use MaxEncodedLen in parity-scal-codec
* Add get_mut method for WeakBoundedVec
* Use expect on an infallible operation
* Rewrite as for loop
* Update impl-codec to use new upstream MaxEncodedLen trait
* Adapt crates to use the updated codec crate for `MaxEncodedLen`
* Remove max-encoded-len crate altogether
* Fix test compilation in `pallet-proxy`
* reorganize import (#9186)
* Fix remaining `MaxEncodedLen` imports
* Fix remaining old usages of max-encoded-len crate
* Fix UI test
* Manually depend on new impl-codec to fix Polkadot companion build
* Use newly released primitive-types v0.9.1 that has new codec impls
* Make sure codec deps are up-to-date in crates that use them
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* requiring users to maintain an unchecked invariant is unsafe
* relax trait restrictions on BoundedVec<T, S>
A normal `Vec<T>` can do many things without any particular trait
bounds on `T`. This commit relaxes the bounds on `BoundedVec<T, S>`
to give it similar capabilities.
* Add `BoundedBTreeMap` to `frame_support::storage`
Part of https://github.com/paritytech/substrate/issues/8719.
* max_encoded_len will never encode length > bound
* requiring users to maintain an unchecked invariant is unsafe
* only impl debug when std
* add some marker traits
* add tests
* implement BoundedEncodedLen
* update header
* update imports
* use impl_for_tuples instead of a custom macro
* remove redundant where clause
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* impl for Compact<T>
* impl BoundedEncodedLen for BoundedVec (#8727)
* impl BoundedEncodedLen for bool
* explicitly implement BoundedEncodedLen for each Compact form
Turns out that u16 doesn't play nicely with the pattern; those values
take two extra bytes, where all other cases take one. :(
* rename BoundedEncodedLen -> MaxEncodedLen
* add tests of compact encoded length
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
* prototype for shawn
* Clean and document it
* Add more docs
* Move imports
* Some changes for easier compat.
* revert exmaple pallet
* rename
* BoundedVec for AccountLocks (#8580)
* Example with balances
* Fix tests
* Make it indexable
* fix
* Fix tests
* fix test
* Fix collective as well
* Fix test
* Update frame/support/src/storage/mod.rs
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* Repot and add for value
* Add for map and double map
* Final touches.
* Update frame/support/src/storage/bounded_vec.rs
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
* Add a few more tests
* Add import
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>