difftreelog
Fix PR
in: master
3 files changed
primitives/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;
runtime/common/src/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -90,7 +90,7 @@
let token_data = TokenData {
properties: Self::token_properties(collection, token_id, keys)?,
owner: Self::token_owner(collection, token_id)?,
- pieces: Self::total_pieces(collection, token_id)?
+ pieces: Self::total_pieces(collection, token_id)?.expect("Token pieces always must have some value"),
};
Ok(token_data)
tests/src/interfaces/unique/definitions.tsdiffbeforeafterboth79 allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),79 allowed: fun('Check if user is allowed to use collection', [collectionParam, crossAccountParam()], 'bool'),80 nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option<u64>'),80 nextSponsored: fun('Get number of blocks when sponsored transaction is available', [collectionParam, crossAccountParam(), tokenParam], 'Option<u64>'),81 effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option<UpDataStructsCollectionLimits>'),81 effectiveCollectionLimits: fun('Get effective collection limits', [collectionParam], 'Option<UpDataStructsCollectionLimits>'),82 totalPieces: fun('Get total pieces of token', [collectionParam, tokenParam], 'Option<u128>'),82 },83 },83};84};8485