mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Use EncodeLike for storages traits (#3676)
* impl * patch * lock * some refactor * some avoided copy * new api without ref for doublemap * fix * version bump * fix * point to incoming release * use codec latest * bumpd impl version * fix unused * fix * Update srml/support/src/storage/mod.rs Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
committed by
Bastian Köcher
parent
83d4764d46
commit
53e0ddee4e
@@ -159,7 +159,7 @@ decl_module! {
|
||||
let id = Self::next_asset_id();
|
||||
<NextAssetId<T>>::mutate(|id| *id += One::one());
|
||||
|
||||
<Balances<T>>::insert((id, origin.clone()), total);
|
||||
<Balances<T>>::insert((id, &origin), total);
|
||||
<TotalSupply<T>>::insert(id, total);
|
||||
|
||||
Self::deposit_event(RawEvent::Issued(id, origin, total));
|
||||
@@ -186,7 +186,7 @@ decl_module! {
|
||||
/// Destroy any assets of `id` owned by `origin`.
|
||||
fn destroy(origin, #[compact] id: T::AssetId) {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let balance = <Balances<T>>::take((id, origin.clone()));
|
||||
let balance = <Balances<T>>::take((id, &origin));
|
||||
ensure!(!balance.is_zero(), "origin balance should be non-zero");
|
||||
|
||||
<TotalSupply<T>>::mutate(id, |total_supply| *total_supply -= balance);
|
||||
|
||||
Reference in New Issue
Block a user