Skip to content
This repository was archived by the owner on Oct 2, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pallets/living-assets-ownership/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ impl<T: Config> Pallet<T> {
collection_id.checked_add(One::one()).ok_or(Error::<T>::CollectionIdOverflow)?;
CollectionCounter::<T>::put(counter);

// Attempt to increment the collection counter by 1. If this operation
// would result in an overflow, return early with an error
let counter =
collection_id.checked_add(One::one()).ok_or(Error::<T>::CollectionIdOverflow)?;
CollectionCounter::<T>::put(counter);

Self::deposit_event(Event::CollectionCreated { collection_id, who });

Ok(collection_id)
Expand Down
3 changes: 2 additions & 1 deletion pallets/living-assets-ownership/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// <https://docs.substrate.io/reference/frame-pallets/>
pub use pallet::*;
use parity_scale_codec::alloc::string::ToString;
use sp_core::{H160, U256};
use sp_core::H160;
use sp_std::vec::Vec;

mod functions;
Expand All @@ -21,6 +21,7 @@ pub mod pallet {
BoundedVec,
};
use frame_system::pallet_prelude::*;
use sp_core::{H160, U256};

/// Collection id type
pub type CollectionId = u64;
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("laos-parachain"),
impl_name: create_runtime_str!("laos-parachain"),
authoring_version: 1,
spec_version: 4,
spec_version: 5,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down