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:
Hoani Bryson
2020-01-29 11:30:25 +13:00
committed by GitHub
parent e7df428274
commit d38e96f2e1
2 changed files with 2 additions and 16 deletions
+1 -1
View File
@@ -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,
};
+1 -15
View File
@@ -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.