difftreelog
CORE-410 Implement token_owner for Refungible token
in: master
2 files changed
pallets/refungible/src/common.rsdiffbeforeafterboth--- a/pallets/refungible/src/common.rs
+++ b/pallets/refungible/src/common.rs
@@ -413,8 +413,8 @@
TokenId(<TokensMinted<T>>::get(self.id))
}
- fn token_owner(&self, _token: TokenId) -> Option<T::CrossAccountId> {
- None
+ fn token_owner(&self, token: TokenId) -> Option<T::CrossAccountId> {
+ <Pallet<T>>::token_owner(self.id, token)
}
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()