git.delta.rocks / unique-network / refs/commits / df0209a30591

difftreelog

NextCollectionId renamed

str-mv2020-09-01parent: #9acc85c.patch.diff
in: master

1 file changed

modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
131 trait Store for Module<T: Trait> as Nft {131 trait Store for Module<T: Trait> as Nft {
132132
133 // Private members133 // Private members
134 NextCollectionID: u64;134 CreatedCollectionCount: u64;
135 ItemListIndex: map hasher(blake2_128_concat) u64 => u64;135 ItemListIndex: map hasher(blake2_128_concat) u64 => u64;
136136
137 pub Collection get(fn collection): map hasher(identity) u64 => CollectionType<T::AccountId>;137 pub Collection get(fn collection): map hasher(identity) u64 => CollectionType<T::AccountId>;
212 ensure!(prefix.len() <= 16, "Token prefix can not be longer than 15 char");212 ensure!(prefix.len() <= 16, "Token prefix can not be longer than 15 char");
213213
214 // Generate next collection ID214 // Generate next collection ID
215 let next_id = NextCollectionID::get()215 let next_id = CreatedCollectionCount::get()
216 .checked_add(1)216 .checked_add(1)
217 .expect("collection id error");217 .expect("collection id error");
218218
219 NextCollectionID::put(next_id);219 CreatedCollectionCount::put(next_id);
220220
221 // Create new collection221 // Create new collection
222 let new_collection = CollectionType {222 let new_collection = CollectionType {