34 个重大更新发布
37.0.0 | 2024年7月18日 |
---|---|
36.0.0 | 2024年7月12日 |
35.0.0 | 2024年6月24日 |
34.0.0 | 2024年5月24日 |
0.0.0 | 2022年11月21日 |
#234 在 魔法豆
373 每月下载量
在 2 crates 中使用
2.5MB
44K SLoC
支持代码,简化生成阈值包的过程。
注意:此假定运行时实现了 pallet_staking::Config
,因为它需要实现 frame_support::traits::Currency
和 CurrencyToVote
特性。
将包添加到运行时的过程只需要四个步骤。
-
更新运行时定义。
parameter_types!{ pub const BagThresholds: &'static [u64] = &[]; } impl pallet_bags_list::Config for Runtime { // <snip> type BagThresholds = BagThresholds; }
-
编写一个小程序来生成定义。这个程序仅用于将运行时定义与各种计算连接起来。请参阅utils/frame/generate_bags/node-runtime获取示例。
-
运行该程序
$ cargo run -p node-runtime-generate-bags -- --total-issuance 1234 --minimum-balance 1
output.rs ```
-
更新运行时定义。
+ mod output; - pub const BagThresholds: &'static [u64] = &[]; + pub const BagThresholds: &'static [u64] = &output::THRESHOLDS;
依赖项
~21–34MB
~563K SLoC