在基板中实现运行时模块时,给定以下存储
decl_storage! {
trait Store for Module<T: Trait> as CatAuction {
Kitties get(kitties): map T::Hash => Kitty<T::Hash, T::Balance>;
KittyOwner get(owner_of): map T::Hash => Option<T::AccountId>;
OwnedKitties get(kitties_owned): map T::AccountId => T::Hash;
pub AllKittiesCount get(all_kitties_cnt): u64;
Nonce: u64;
// if you want to initialize value in storage, use genesis block
}
}
pub
前面的目的是AllKittiesCount
什么?因为不管有pub
没有,polkadot UI 还是可以查询到的,就好像它是一个公共变量一样。