From 77f76b4eb254963c063526cb4e402348c49fa267 Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:04:59 +0100 Subject: [PATCH] update tags and id metadata when tags are removed --- contracts/AddressProviderNG.vy | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index 450a093..df0550f 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -301,6 +301,19 @@ def remove_tags(_tags_to_remove: DynArray[String[64], 20]): for _id in self._ids: self.id_tag_mapping[keccak256(concat(uint2str(_id), _tag))] = False + # Update tags per id: + for _id in self._ids: + _id_tags: DynArray[String[64], 20] = self.get_id_info[_id].tags + _new_tags: DynArray[String[64], 20] = [] + + for _id_tag in _id_tags: + if self.check_tag_exists[_id_tag]: + _new_tags.append(_id_tag) + + self.get_id_info[_id].tags = _new_tags + self._update_entry_metadata(_id) + + # ------------------------------ Admin Methods -------------------------------