mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Remove unnecessary duplication in generic asset create (#4744)
* Remove unneccessary duplication in generic asset create * Increment impl_version due to refactoring generic_asset
This commit is contained in:
@@ -81,7 +81,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
|
||||
// implementation changes and behavior does not, then leave spec_version as
|
||||
// is and increment impl_version.
|
||||
spec_version: 207,
|
||||
impl_version: 207,
|
||||
impl_version: 208,
|
||||
apis: RUNTIME_API_VERSIONS,
|
||||
};
|
||||
|
||||
|
||||
@@ -362,21 +362,7 @@ decl_module! {
|
||||
/// Create a new kind of asset.
|
||||
fn create(origin, options: AssetOptions<T::Balance, T::AccountId>) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let id = Self::next_asset_id();
|
||||
|
||||
let permissions: PermissionVersions<T::AccountId> = options.permissions.clone().into();
|
||||
|
||||
// The last available id serves as the overflow mark and won't be used.
|
||||
let next_id = id.checked_add(&One::one()).ok_or_else(|| Error::<T>::NoIdAvailable)?;
|
||||
|
||||
<NextAssetId<T>>::put(next_id);
|
||||
<TotalIssuance<T>>::insert(id, &options.initial_issuance);
|
||||
<FreeBalance<T>>::insert(&id, &origin, &options.initial_issuance);
|
||||
<Permissions<T>>::insert(&id, permissions);
|
||||
|
||||
Self::deposit_event(RawEvent::Created(id, origin, options));
|
||||
|
||||
Ok(())
|
||||
Self::create_asset(None, Some(origin), options)
|
||||
}
|
||||
|
||||
/// Transfer some liquid free balance to another account.
|
||||
|
||||
Reference in New Issue
Block a user