From bd23dba190ba6bafc07ccd59ed6b325e8d762f43 Mon Sep 17 00:00:00 2001 From: cjber Date: Tue, 8 Apr 2025 17:49:02 +0100 Subject: [PATCH] filter outputs from resolve --- python/thirdweb-ai/src/thirdweb_ai/common/utils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/python/thirdweb-ai/src/thirdweb_ai/common/utils.py b/python/thirdweb-ai/src/thirdweb_ai/common/utils.py index 8d02f9f..608b2e3 100644 --- a/python/thirdweb-ai/src/thirdweb_ai/common/utils.py +++ b/python/thirdweb-ai/src/thirdweb_ai/common/utils.py @@ -56,10 +56,9 @@ def clean_resolve(out: dict[str, Any]): """Clean the response from the resolve function.""" if "transactions" in out["data"]: for transaction in out["data"]["transactions"]: - if "data" in transaction and is_encoded(transaction["data"]): - transaction.pop("data") - if "logs_bloom" in transaction: - transaction.pop("logs_bloom") + for key in list(transaction.keys()): + if key not in TRANSACTION_KEYS_TO_KEEP: + transaction.pop(key, None) return out