From fa38164ce91ed1dedd924c3aa8cde1ad216c1a7d Mon Sep 17 00:00:00 2001 From: niv vaknin Date: Mon, 30 Dec 2024 14:57:12 +0200 Subject: [PATCH 1/2] Format execution json --- .github/workflows/CI.yml | 2 +- Quorum/config.py | 7 ++++++ Quorum/execution.json | 45 +++++++++++++++------------------- Quorum/regression.json | 49 +++++++++++++++++++++++++++++++++++++ Quorum/utils/chain_enum.py | 24 +++++++++--------- README.md | 50 +++++++++++++++++++++++--------------- 6 files changed, 120 insertions(+), 57 deletions(-) create mode 100644 Quorum/regression.json diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b582b35..357eca0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -39,4 +39,4 @@ jobs: - name: Execute Regression Tests run: | pytest Quorum/tests --maxfail=1 --disable-warnings --tb=short - CheckProposal --config Quorum/execution.json + CheckProposal --config Quorum/regression.json diff --git a/Quorum/config.py b/Quorum/config.py index 6ccce67..ee896ea 100644 --- a/Quorum/config.py +++ b/Quorum/config.py @@ -16,9 +16,16 @@ GROUND_TRUTH_PATH = MAIN_PATH / "ground_truth.json" DEFAULT_REPOS = Path(__file__).parent / "ground_truth.json" +EXECUTION_PATH = MAIN_PATH / "execution.json" +DEFAULT_EXECUTION = Path(__file__).parent / "execution.json" + if not GROUND_TRUTH_PATH.exists(): shutil.copy(DEFAULT_REPOS, GROUND_TRUTH_PATH) +if not EXECUTION_PATH.exists(): + shutil.copy(DEFAULT_EXECUTION, EXECUTION_PATH) + + ANTHROPIC_API_KEY = os.getenv('ANTHROPIC_API_KEY') if not ANTHROPIC_API_KEY: pp.pretty_print( diff --git a/Quorum/execution.json b/Quorum/execution.json index 4b55cfd..df3979c 100644 --- a/Quorum/execution.json +++ b/Quorum/execution.json @@ -1,42 +1,37 @@ { "Aave": { - "AVAX": { + "Ethereum": { "Proposals": [] }, - "ETH": { - "Proposals": [ - "0xAD6c03BF78A3Ee799b86De5aCE32Bb116eD24637" - ] + "Arbitrum": { + "Proposals": [] + }, + "Avalanche": { + "Proposals": [] }, - "GNO": { + "Base": { "Proposals": [] }, - "ARB": { - "Proposals": [ - "0x22ca2Dd3063189F9E7e76fA3078E2d916B3998b7" - ] + "BNBChain": { + "Proposals": [] }, - "BASE": { - "Proposals": [ - "0x6B96B41a531713a141F6EcBbae80715601d0e456" - ] + "Gnosis": { + "Proposals": [] }, - "BSC": { - "Proposals": ["0xb4F2786984093eaE1D6Be2B4F8c8e3c2cb018b54"] + "Metis": { + "Proposals": [] }, - "MET": { + "Optimism": { "Proposals": [] }, - "OPT": { + "Polygon": { "Proposals": [] }, - "POLY": { - "Proposals": [ - "0x2dbBe7E30CD959A192FeFCEd9A5ae681d540deB4" - ] + "Scroll": { + "Proposals": [] }, - "SCROLL": { - "Proposals": ["0x9d9892256dF8f97d0c15F4494aa5D44D376CC749"] + "zkSync": { + "Proposals": [] } } -} \ No newline at end of file +} diff --git a/Quorum/regression.json b/Quorum/regression.json new file mode 100644 index 0000000..77ea782 --- /dev/null +++ b/Quorum/regression.json @@ -0,0 +1,49 @@ +{ + "Aave": { + "Ethereum": { + "Proposals": [ + "0xAD6c03BF78A3Ee799b86De5aCE32Bb116eD24637" + ] + }, + "Arbitrum": { + "Proposals": [ + "0x22ca2Dd3063189F9E7e76fA3078E2d916B3998b7" + ] + }, + "Avalanche": { + "Proposals": [] + }, + "Base": { + "Proposals": [ + "0x6B96B41a531713a141F6EcBbae80715601d0e456" + ] + }, + "BNBChain": { + "Proposals": [ + "0xb4F2786984093eaE1D6Be2B4F8c8e3c2cb018b54" + ] + }, + "Gnosis": { + "Proposals": [] + }, + "Metis": { + "Proposals": [] + }, + "Optimism": { + "Proposals": [] + }, + "Polygon": { + "Proposals": [ + "0x2dbBe7E30CD959A192FeFCEd9A5ae681d540deB4" + ] + }, + "Scroll": { + "Proposals": [ + "0x9d9892256dF8f97d0c15F4494aa5D44D376CC749" + ] + }, + "zkSync": { + "Proposals": [] + } + } +} \ No newline at end of file diff --git a/Quorum/utils/chain_enum.py b/Quorum/utils/chain_enum.py index a4b844a..31931eb 100644 --- a/Quorum/utils/chain_enum.py +++ b/Quorum/utils/chain_enum.py @@ -5,15 +5,15 @@ class Chain(StrEnum): """ Enumeration for supported blockchain networks. """ - ETH = 'ETH' - ARB = 'ARB' - AVAX = 'AVAX' - BASE = 'BASE' - BSC = 'BSC' - GNO = 'GNO' - MET = 'MET' - OPT = 'OPT' - POLY = 'POLY' - SCROLL = 'SCROLL' - ZK = 'ZKSYNC' - LINEA= 'LINEA' \ No newline at end of file + ETH = 'Ethereum' + ARB = 'Arbitrum' + AVAX = 'Avalanche' + BASE = 'Base' + BSC = 'BNBChain' + GNO = 'Gnosis' + MET = 'Metis' + OPT = 'Optimism' + POLY = 'Polygon' + SCROLL = 'Scroll' + ZK = 'zkSync' + LINEA= 'LINEA' diff --git a/README.md b/README.md index 3eab2cd..381e918 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ OR python3 Quorum/check_proposal.py --customer "CustomerName" --chain "ChainName" --proposal_address "Address" ``` -Replace `CustomerName` with the customer identifier, `ChainName` with the blockchain chain (e.g., "ETH", "AVAX"), and `Address` with the proposal address. +Replace `CustomerName` with the customer identifier, `ChainName` with the blockchain chain, and `Address` with the proposal address. ### Example Usage with Config File @@ -82,37 +82,49 @@ Example config file `config.json`: ```json { "Aave": { - "AVAX": { - "Proposals": ["0x564Dfd09eBB63F7e468401AffE2d8c2cDD08D68D"] + "Ethereum": { + "Proposals": [ + "0xAD6c03BF78A3Ee799b86De5aCE32Bb116eD24637" + ] }, - "ETH": { - "Proposals": ["0x683FdF51d5898F92317F870B25a6A4dF67dC58Ab", "0x065DF1F9d0aeDEa11E6d059ce29e91d2Abed59fA"] + "Arbitrum": { + "Proposals": [ + "0x22ca2Dd3063189F9E7e76fA3078E2d916B3998b7" + ] }, - "GNO": { - "Proposals": ["0xF0221Fc5a2F825bbF6F994f30743aD5AAC66cd4E"] - }, - "ARB": { + "Avalanche": { "Proposals": [] }, - "BASE": { - "Proposals": [] + "Base": { + "Proposals": [ + "0x6B96B41a531713a141F6EcBbae80715601d0e456" + ] }, - "BSC": { - "Proposals": [] + "BNBChain": { + "Proposals": [ + "0xb4F2786984093eaE1D6Be2B4F8c8e3c2cb018b54" + ] }, - "MET": { + "Gnosis": { "Proposals": [] }, - "OPT": { + "Metis": { "Proposals": [] }, - "POLY": { + "Optimism": { "Proposals": [] }, - "SCR": { - "Proposals": [] + "Polygon": { + "Proposals": [ + "0x2dbBe7E30CD959A192FeFCEd9A5ae681d540deB4" + ] + }, + "Scroll": { + "Proposals": [ + "0x9d9892256dF8f97d0c15F4494aa5D44D376CC749" + ] }, - "ZK": { + "zkSync": { "Proposals": [] } } From 19f373e693dbf0d9eec70dcdb6fa99e7f252826e Mon Sep 17 00:00:00 2001 From: Niv vaknin <122722245+nivcertora@users.noreply.github.com> Date: Mon, 30 Dec 2024 16:52:39 +0200 Subject: [PATCH 2/2] Update config.py --- Quorum/config.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Quorum/config.py b/Quorum/config.py index ee896ea..85e0c3e 100644 --- a/Quorum/config.py +++ b/Quorum/config.py @@ -25,7 +25,6 @@ if not EXECUTION_PATH.exists(): shutil.copy(DEFAULT_EXECUTION, EXECUTION_PATH) - ANTHROPIC_API_KEY = os.getenv('ANTHROPIC_API_KEY') if not ANTHROPIC_API_KEY: pp.pretty_print(