Skip to content

Commit

Permalink
Merge branch 'main' into simplify_logging
Browse files Browse the repository at this point in the history
  • Loading branch information
fhenneke committed Nov 14, 2024
2 parents 7849a08 + 47fba95 commit 2571b84
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
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
10 changes: 9 additions & 1 deletion src/fetch/transfer_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,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_obj.print(Transfer.summarize(transfers), category=Category.TOTALS)
Expand Down Expand Up @@ -104,7 +106,9 @@ def auto_propose(
)


if __name__ == "__main__":
def main() -> None:
"""Generate transfers for an accounting period"""

args = generic_script_init(description="Fetch Complete Reimbursement")

orderbook = MultiInstanceDBFetcher(
Expand Down Expand Up @@ -150,3 +154,7 @@ def auto_propose(
)
else:
manual_propose(transfers=payout_transfers, period=dune.period)


if __name__ == "__main__":
main()

0 comments on commit 2571b84

Please sign in to comment.