Skip to content

Commit

Permalink
dev(cleanup):
Browse files Browse the repository at this point in the history
  • Loading branch information
akhercha committed Oct 26, 2024
1 parent 6f82a38 commit 44a420e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
jobs:
check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: pragma-oracle
steps:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gas_reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
result=$(python scripts/gas_usage/compare_snapshot.py| sed 's/\x1b\[[0-9;]*m//g')
result=$(python pragma-deployer/pragma_deployer/gas_usage/compare_snapshot.py| sed 's/\x1b\[[0-9;]*m//g')
result=$(echo "$result" | grep -v "Archive:")
result=$(echo "$result" | grep -v "inflating:")
echo "$result" > temp_result.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_previous_snapshot():

def get_current_gas_snapshot():
"""Execute command and return current gas snapshots."""
output = subprocess.check_output("scarb cairo-test", shell=True).decode("utf-8")
output = subprocess.check_output("cd pragma-oracle && scarb cairo-test", shell=True).decode("utf-8")
pattern = r"test (.+?) \.\.\. ok \(gas usage est.: (\d+)\)"
matches = re.findall(pattern, output)
matches.sort()
Expand Down
10 changes: 5 additions & 5 deletions pragma-deployer/pragma_deployer/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@


CURRENT_FILE = Path(__file__).resolve()
REPO_ROOT = CURRENT_FILE.parent.parent.parent
PROJECT_ROOT = REPO_ROOT.parent / "pragma-oracle"
DEPLOYER_ROOT = CURRENT_FILE.parent.parent.parent
ORACLE_ROOT = DEPLOYER_ROOT.parent / "pragma-oracle"

BUILD_DIR = PROJECT_ROOT / "target" / "dev"
BUILD_DIR = ORACLE_ROOT / "target" / "dev"
BUILD_DIR.mkdir(exist_ok=True, parents=True)

SOURCE_DIR = PROJECT_ROOT / "src"
SOURCE_DIR = ORACLE_ROOT / "src"
CONTRACTS = {p.stem: p for p in list(SOURCE_DIR.glob("**/*.cairo"))}

DEPLOYMENTS_DIR = REPO_ROOT / "deployments" / NETWORK["name"]
DEPLOYMENTS_DIR = DEPLOYER_ROOT.parent / "deployments" / NETWORK["name"]
DEPLOYMENTS_DIR.mkdir(exist_ok=True, parents=True)


Expand Down
4 changes: 2 additions & 2 deletions pragma-deployer/pragma_deployer/utils/starknet.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from pragma_deployer.utils.constants import (
BUILD_DIR,
POETRY_ROOT,
ORACLE_ROOT,
# CONTRACTS,
DEPLOYMENTS_DIR,
ETH_TOKEN_ADDRESS,
Expand Down Expand Up @@ -84,7 +84,7 @@ async def get_starknet_account(address=None, private_key=None, port=None) -> Acc


async def get_eth_contract(port=None) -> Contract:
erc_20_path = POETRY_ROOT / "pragma_deployer" / "utils" / "erc20.json"
erc_20_path = ORACLE_ROOT / "pragma_deployer" / "utils" / "erc20.json"
return Contract(
ETH_TOKEN_ADDRESS,
json.loads(erc_20_path.read_text())["abi"],
Expand Down

0 comments on commit 44a420e

Please sign in to comment.