Skip to content

Commit

Permalink
Rename gnosis package name to safe_eth (#1286)
Browse files Browse the repository at this point in the history
* Rename gnosis package name

* Update sphinx doc
  • Loading branch information
falvaradorodriguez authored Aug 27, 2024
1 parent c3aa001 commit 211223b
Show file tree
Hide file tree
Showing 218 changed files with 957 additions and 515 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. from gnosis import '...'
1. from safe_eth import '...'
2. '....'

**Expected behavior**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from github.GithubException import GithubException
from github.Repository import Repository

from gnosis.eth import EthereumClient
from safe_eth.eth import EthereumClient


def convert_chain_name(name: str) -> str:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import validators
from tldextract import extract

from gnosis.eth import EthereumClient
from gnosis.eth.utils import mk_contract_address_2
from safe_eth.eth import EthereumClient
from safe_eth.eth.utils import mk_contract_address_2

ERRORS = []

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Run tests and coverage
run: coverage run --source=$SOURCE_FOLDER -m pytest -W ignore::DeprecationWarning -rxXs --reruns 3
env:
SOURCE_FOLDER: gnosis
SOURCE_FOLDER: safe_eth
DJANGO_SETTINGS_MODULE: config.settings.test
ETHEREUM_MAINNET_NODE: ${{ secrets.ETHEREUM_MAINNET_NODE }}
ETHEREUM_POLYGON_NODE: ${{ secrets.ETHEREUM_POLYGON_NODE }}
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
recursive-include docs *
recursive-include gnosis/eth/contracts *.json
recursive-include safe_eth/eth/contracts *.json
34 changes: 17 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Safe-eth-py (previously known as Gnosis-py)
Safe-eth-py includes a set of libraries to work with Ethereum and relevant Ethereum projects:
- `EthereumClient`, a wrapper over Web3.py `Web3` client including utilities to deal with ERC20/721
tokens and tracing.
- `Gnosis Safe <https://github.com/safe-global/safe-contracts>`_ classes and utilities.
- `Safe <https://github.com/safe-global/safe-contracts>`_ classes and utilities.
- Price oracles for `Uniswap`, `Kyber`...
- Django serializers, models and utils.

Expand Down Expand Up @@ -43,7 +43,7 @@ Once the issue is created or edited, an automatic validation will be executed an

Ethereum utils
--------------
gnosis.eth
safe_eth.eth
~~~~~~~~~~~~~~~~~~~~
- ``class EthereumClient (ethereum_node_url: str)``: Class to connect and do operations
with an ethereum node. Uses web3 and raw rpc calls for things not supported in web3.
Expand All @@ -54,8 +54,8 @@ the possibility of doing ``batch_calls`` (a single request making read-only call

.. code-block:: python
from gnosis.eth import EthereumClient
from gnosis.eth.contracts import get_erc721_contract
from safe_eth.eth import EthereumClient
from safe_eth.eth.contracts import get_erc721_contract
ethereum_client = EthereumClient(ETHEREUM_NODE_URL)
erc721_contract = get_erc721_contract(self.w3, token_address)
name, symbol = ethereum_client.batch_call([
Expand All @@ -67,27 +67,27 @@ If you want to use the underlying `web3.py <https://github.com/ethereum/web3.py>

.. code-block:: python
from gnosis.eth import EthereumClient
from safe_eth.eth import EthereumClient
ethereum_client = EthereumClient(ETHEREUM_NODE_URL)
ethereum_client.w3.eth.get_block(57)
gnosis.eth.constants
safe_eth.eth.constants
~~~~~~~~~~~~~~~~~~~~
- ``NULL_ADDRESS (0x000...0)``: Solidity ``address(0)``.
- ``SENTINEL_ADDRESS (0x000...1)``: Used for Gnosis Safe's linked lists (modules, owners...).
- ``SENTINEL_ADDRESS (0x000...1)``: Used for Safe's linked lists (modules, owners...).
- Maximum and minimum values for `R`, `S` and `V` in ethereum signatures.

gnosis.eth.oracles
safe_eth.eth.oracles
~~~~~~~~~~~~~~~~~~

Price oracles for Uniswap, UniswapV2, Kyber, SushiSwap, Aave, Balancer, Curve, Mooniswap, Yearn...
Example:

.. code-block:: python
from gnosis.eth import EthereumClient
from gnosis.eth.oracles import UniswapV2Oracle
from safe_eth.eth import EthereumClient
from safe_eth.eth.oracles import UniswapV2Oracle
ethereum_client = EthereumClient(ETHEREUM_NODE_URL)
uniswap_oracle = UniswapV2Oracle(ethereum_client)
gno_token_mainnet_address = '0x6810e776880C02933D47DB1b9fc05908e5386b96'
Expand All @@ -96,7 +96,7 @@ Example:
gnosis.eth.utils
safe_eth.eth.utils
~~~~~~~~~~~~~~~~

Contains utils for ethereum operations:
Expand All @@ -106,16 +106,16 @@ Contains utils for ethereum operations:

Ethereum django (REST) utils
----------------------------
Django utils are available under ``gnosis.eth.django``.
Django utils are available under ``safe_eth.eth.django``.
You can find a set of helpers for working with Ethereum using Django and Django Rest framework.

It includes:

- **gnosis.eth.django.filters**: EthereumAddressFilter.
- **gnosis.eth.django.models**: Model fields (Ethereum address, Ethereum big integer field).
- **gnosis.eth.django.serializers**: Serializer fields (Ethereum address field, hexadecimal field).
- **gnosis.eth.django.validators**: Ethereum related validators.
- **gnosis.safe.serializers**: Serializers for Gnosis Safe (signature, transaction...).
- **safe_eth.eth.django.filters**: EthereumAddressFilter.
- **safe_eth.eth.django.models**: Model fields (Ethereum address, Ethereum big integer field).
- **safe_eth.eth.django.serializers**: Serializer fields (Ethereum address field, hexadecimal field).
- **safe_eth.eth.django.validators**: Ethereum related validators.
- **safe_eth.safe.serializers**: Serializers for Safe (signature, transaction...).
- All the tests are written using Django Test suite.

Contributors
Expand Down
2 changes: 1 addition & 1 deletion build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export DJANGO_SETTINGS_MODULE=config.settings.test
export DJANGO_DOT_ENV_FILE=.env.test
sphinx-apidoc -o docs/source/ gnosis/
sphinx-apidoc -o docs/source/ safe_eth/
rm docs/source/*test*.rst
make -C docs/ clean
make -C docs/ html
2 changes: 1 addition & 1 deletion config/settings/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .base import * # noqa

INSTALLED_APPS += ("gnosis.eth.django.tests",) # noqa
INSTALLED_APPS += ("safe_eth.eth.django.tests",) # noqa

SECRET_KEY = "testtest"
DEBUG = True
Expand Down
53 changes: 0 additions & 53 deletions docs/source/gnosis.eth.clients.rst

This file was deleted.

10 changes: 0 additions & 10 deletions docs/source/gnosis.eth.contracts.rst

This file was deleted.

53 changes: 0 additions & 53 deletions docs/source/gnosis.eth.django.rst

This file was deleted.

53 changes: 0 additions & 53 deletions docs/source/gnosis.eth.oracles.abis.rst

This file was deleted.

57 changes: 0 additions & 57 deletions docs/source/gnosis.eth.rst

This file was deleted.

Loading

0 comments on commit 211223b

Please sign in to comment.