substrate Balance, BlockNumber, AccountId 等值转换
Balance -> u64
let value :Option = TryInto::::try_into(balance).ok();
u64-> Balance
let balance :Option<T::Balance> = value.try_into().ok();
BlockNumber -> u32
let number : Option = TryInto::::try_into(block_number);
u32 -> BlockNumber
原创
2020-12-10 11:36:10 ·
552 阅读 ·
0 评论