From d1518340a8b406153b5aca619dbe14dfbc7d3dfd Mon Sep 17 00:00:00 2001 From: Mathieu <60658558+enitrat@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:09:09 +0100 Subject: [PATCH] Update cairo/tests/utils/strategies.py Co-authored-by: Oba --- cairo/tests/utils/strategies.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/cairo/tests/utils/strategies.py b/cairo/tests/utils/strategies.py index c8dc520d..8b158991 100644 --- a/cairo/tests/utils/strategies.py +++ b/cairo/tests/utils/strategies.py @@ -357,27 +357,14 @@ def tuple_strategy(thing): # A strategy for an empty state - the tries have no data. empty_state = st.builds( State, - _main_trie=st.builds( - Trie[Address, Optional[Account]], - secured=st.just(True), - default=st.none(), - _data=st.just({}), + _main_trie=st.just( + Trie[Address, Optional[Account]](secured=True, default=None, _data={}) ), _storage_tries=st.just({}), - _snapshots=st.just([]), + _snapshots=st.just( + [(Trie[Address, Optional[Account]](secured=True, default=None, _data={}), {})] + ), created_accounts=st.just(set()), -).map( - lambda state: State( - _main_trie=state._main_trie, - _storage_tries=state._storage_tries, - _snapshots=[ - ( - copy_trie(state._main_trie), - {addr: copy_trie(trie) for addr, trie in state._storage_tries.items()}, - ) - ], - created_accounts=state.created_accounts, - ) )