difftreelog
CORE-410 Implement token_owner for Refungible token
in: master
2 files changed
pallets/refungible/src/common.rsdiffbeforeafterboth413 TokenId(<TokensMinted<T>>::get(self.id))413 TokenId(<TokensMinted<T>>::get(self.id))414 }414 }415415416 fn token_owner(&self, _token: TokenId) -> Option<T::CrossAccountId> {416 fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId> {417 None417 <Pallet<T>>::token_owner(self.id, token)418 }418 }419419420 fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option<PropertyValue> {420 fn token_property(&self, _token_id: TokenId, _key: &PropertyKey) -> Option<PropertyValue> {pallets/refungible/src/lib.rsdiffbeforeafterboth1094 Ok(())1094 Ok(())1095 }1095 }10961097 fn token_owner(collection_id: CollectionId, token_id: TokenId) -> Option<T::CrossAccountId> {1098 let mut owner = None;1099 let mut count = 0;1100 for key in Balance::<T>::iter_key_prefix((collection_id, token_id)) {1101 count += 1;1102 if count > 1 {1103 return None;1104 }1105 owner = Some(key);1106 }1107 owner1108 }109611091097 fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<u128> {1110 fn total_pieces(collection_id: CollectionId, token_id: TokenId) -> Option<u128> {1098 <TotalSupply<T>>::try_get((collection_id, token_id)).ok()1111 <TotalSupply<T>>::try_get((collection_id, token_id)).ok()