16 major breaking releases

new 20.0.0 Mar 26, 2023
19.0.0 Mar 5, 2023
18.0.0 Feb 26, 2023
17.0.0 Feb 19, 2023
0.0.0 Nov 21, 2022

#91 in Magic Beans

Download history 12/week @ 2022-12-08 172/week @ 2022-12-15 20/week @ 2022-12-22 29/week @ 2023-01-05 38/week @ 2023-01-12 66/week @ 2023-01-19 29/week @ 2023-01-26 53/week @ 2023-02-02 46/week @ 2023-02-09 57/week @ 2023-02-16 28/week @ 2023-02-23 21/week @ 2023-03-02 30/week @ 2023-03-09 2/week @ 2023-03-16 40/week @ 2023-03-23

97 downloads per month

Apache-2.0

2MB
35K SLoC

generate-bags

Auto-generated README.md for publishing to crates.io


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 [frame_support::traits::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

~22MB
~493K SLoC