36 major breaking releases

new 39.0.0 Jan 14, 2025
38.0.0 Sep 26, 2024
37.0.0 Jul 18, 2024
36.0.0 Jul 12, 2024
0.0.0 Nov 21, 2022

#340 in Magic Beans

Download history 72/week @ 2024-09-27 12/week @ 2024-10-04 9/week @ 2024-10-11 2/week @ 2024-10-18 30/week @ 2024-11-01 26/week @ 2024-11-08 69/week @ 2024-11-15 62/week @ 2024-11-22 66/week @ 2024-11-29 75/week @ 2024-12-06 82/week @ 2024-12-13 48/week @ 2024-12-20 23/week @ 2024-12-27 28/week @ 2025-01-03 139/week @ 2025-01-10

248 downloads per month
Used in 2 crates

Apache-2.0

2.5MB
46K SLoC

Release

Polkadot SDK Stable 2412


lib.rs:

Support code to ease the process of generating bag thresholds.

NOTE: this assume the runtime implements pallet_staking::Config, as it requires an implementation of the traits frame_support::traits::Currency and CurrencyToVote.

The process of adding bags to a runtime requires only four steps.

  1. Update the runtime definition.

    parameter_types!{
         pub const BagThresholds: &'static [u64] = &[];
    }
    
    impl pallet_bags_list::Config for Runtime {
         // <snip>
         type BagThresholds = BagThresholds;
    }
    
  2. Write a little program to generate the definitions. This program exists only to hook together the runtime definitions with the various calculations here. Take a look at utils/frame/generate_bags/node-runtime for an example.

  3. Run that program:

    $ cargo run -p node-runtime-generate-bags -- --total-issuance 1234 --minimum-balance 1
    

output.rs ```

  1. Update the runtime definition.

    + mod output;
    - pub const BagThresholds: &'static [u64] = &[];
    + pub const BagThresholds: &'static [u64] = &output::THRESHOLDS;
    

Dependencies

~21–33MB
~537K SLoC