1 个稳定版本
1.0.2 | 2021 年 4 月 1 日 |
---|---|
1.0.1 |
|
#41 in #chip
11KB
224 行
pallet-dotchip
polkadot 游戏的芯片货币托盘
入门指南
导入 Pallet Crate
runtime/Cargo.toml
[dependencies]
...
// Add this code
pallet-dotchip = { default-features = false, version = '1.0.0' }
[features]
default = ['std']
runtime-benchmarks = [
...
]
std = [
...
// Add this code
'pallet-dotchip/std'
]
配置 Pallet
runtime/src/lib.rs
// Add this code
impl pallet-dotchip::Config for Runtime {
type Event = Event;
type Currency = Balances;
}
construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
...
// Add this code
DotChip: pallet-dotchip::{Module, Call, Storage, Event<T>},
}
);
测试 Pallet
cargo test
依赖项
~8–18MB
~256K SLoC