git.delta.rocks / unique-network / refs/commits / 83275847f907

difftreelog

Fix PR

Trubnikov Sergey2022-07-01parent: #63e242d.patch.diff
in: master

3 files changed

modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -181,7 +181,7 @@
 pub struct TokenData<CrossAccountId> {
 	pub properties: Vec<Property>,
 	pub owner: Option<CrossAccountId>,
-	pub pieces: Option<u128>,
+	pub pieces: u128,
 }
 
 pub struct OverflowError;
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
90 let token_data = TokenData {90 let token_data = TokenData {
91 properties: Self::token_properties(collection, token_id, keys)?,91 properties: Self::token_properties(collection, token_id, keys)?,
92 owner: Self::token_owner(collection, token_id)?,92 owner: Self::token_owner(collection, token_id)?,
93 pieces: Self::total_pieces(collection, token_id)?93 pieces: Self::total_pieces(collection, token_id)?.expect("Token pieces always must have some value"),
94 };94 };
9595
96 Ok(token_data)96 Ok(token_data)
modifiedtests/src/interfaces/unique/definitions.tsdiffbeforeafterboth
--- a/tests/src/interfaces/unique/definitions.ts
+++ b/tests/src/interfaces/unique/definitions.ts
@@ -79,5 +79,6 @@
     allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),
     nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option<u64>'),
     effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option<UpDataStructsCollectionLimits>'),
+    totalPieces: fun('Get total pieces of token', [collectionParam, tokenParam], 'Option<u128>'),
   },
 };