Skip to content

Commit

Permalink
Format execution json (#55)
Browse files Browse the repository at this point in the history
* Format execution json

* Update config.py
  • Loading branch information
nivcertora authored Dec 30, 2024
1 parent 39364e7 commit e46bb01
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions Quorum/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
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(
Expand Down
45 changes: 20 additions & 25 deletions Quorum/execution.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
}
49 changes: 49 additions & 0 deletions Quorum/regression.json
Original file line number Diff line number Diff line change
@@ -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": []
}
}
}
24 changes: 12 additions & 12 deletions Quorum/utils/chain_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
ETH = 'Ethereum'
ARB = 'Arbitrum'
AVAX = 'Avalanche'
BASE = 'Base'
BSC = 'BNBChain'
GNO = 'Gnosis'
MET = 'Metis'
OPT = 'Optimism'
POLY = 'Polygon'
SCROLL = 'Scroll'
ZK = 'zkSync'
LINEA= 'LINEA'
50 changes: 31 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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": []
}
}
Expand Down

0 comments on commit e46bb01

Please sign in to comment.