Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove infura dependency and some other constants #430

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ DUNE_API_KEY=

# Safe Transaction Service Requirements.
SAFE_ADDRESS=0xA03be496e67Ec29bC62F01a428683D7F9c204930
INFURA_KEY=
NETWORK=mainnet
PROPOSER_PK=

NODE_URL=

# Slack Bot Credentials
SLACK_TOKEN=
SLACK_CHANNEL=
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ jobs:
- name: Unit Tests
run:
python -m pytest tests/unit
env:
# We make a rinkeby request in one unit test
INFURA_KEY: ${{ secrets.INFURA_KEY }}
8 changes: 2 additions & 6 deletions src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,16 @@
SAFE_ADDRESS = Web3.to_checksum_address(
ENV.get("SAFE_ADDRESS", "0xA03be496e67Ec29bC62F01a428683D7F9c204930")
)
# Found this exposed infura key on https://rpc.info/
INFURA_KEY = ENV.get("INFURA_KEY", "9aa3d95b3bc440fa88ea12eaa4456161")

NETWORK_STRING = ENV.get("NETWORK", "mainnet")
NODE_URL = f"https://{NETWORK_STRING}.infura.io/v3/{INFURA_KEY}"
NODE_URL = ENV.get("NODE_URL")
NETWORK = {
"mainnet": EthereumNetwork.MAINNET,
"gnosis": EthereumNetwork.GNOSIS,
"goerli": EthereumNetwork.GOERLI,
}[NETWORK_STRING]
SHORT_NAME = {
"mainnet": "eth",
"rinkeby": "rin",
"gnosis": "gno",
"goerli": "gor",
}[NETWORK_STRING]

CSV_APP_HASH = "Qme49gESuwpSvwANmEqo34yfCkzyQehooJ5yL7aHmKJnpZ"
Expand Down
2 changes: 2 additions & 0 deletions src/fetch/transfer_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def auto_propose(
# Check for required env vars early
# so not to wait for query execution to realize it's not available.
signing_key = os.environ["PROPOSER_PK"]

assert NODE_URL is not None, "NODE_URL env variable not set!"
client = EthereumClient(URI(NODE_URL))

log_saver.print(Transfer.summarize(transfers), category=Category.TOTALS)
Expand Down
Loading