From 9706c07638a43a37883a789cc432fd8d8ffc7a0f Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 26 Aug 2024 12:49:52 -0500 Subject: [PATCH 1/2] feat: make queries toplvl obj --- src/ape/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ape/__init__.py b/src/ape/__init__.py index 0136919efe..effc626d9f 100644 --- a/src/ape/__init__.py +++ b/src/ape/__init__.py @@ -51,6 +51,11 @@ Catch and expect contract logic reverts. Resembles ``pytest.raises()``. """ +queries = _ManagerAccessMixin.query_manager +""" +Query chain data. +""" + __all__ = [ "accounts", @@ -63,4 +68,5 @@ "project", "Project", # So you can load other projects "reverts", + "queries", ] From ea07d3156620e6fcf52826c717f33e21444cea46 Mon Sep 17 00:00:00 2001 From: Juliya Smith Date: Mon, 26 Aug 2024 13:04:38 -0500 Subject: [PATCH 2/2] refactor: data --- src/ape/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/ape/__init__.py b/src/ape/__init__.py index effc626d9f..fed990d4f9 100644 --- a/src/ape/__init__.py +++ b/src/ape/__init__.py @@ -46,17 +46,14 @@ convert = _ManagerAccessMixin.conversion_manager.convert """Conversion utility function. See :class:`ape.managers.converters.ConversionManager`.""" +data = _ManagerAccessMixin.query_manager +"""Query chain data.""" + reverts = RevertsContextManager """ Catch and expect contract logic reverts. Resembles ``pytest.raises()``. """ -queries = _ManagerAccessMixin.query_manager -""" -Query chain data. -""" - - __all__ = [ "accounts", "chain", @@ -64,9 +61,9 @@ "config", "convert", "Contract", + "data", "networks", "project", "Project", # So you can load other projects "reverts", - "queries", ]