Skip to content

Commit

Permalink
Fix/plt panda (#1022)
Browse files Browse the repository at this point in the history
<!--- Please provide a general summary of your changes in the title
above -->

<!-- Give an estimate of the time you spent on this PR in terms of work
days.
Did you spend 0.5 days on this PR or rather 2 days?  -->

Time spent on this PR:

## Pull request type

<!-- Please try to limit your pull request to one type,
submit multiple pull requests if needed. -->

Please check the type of change your PR introduces:

- [x] Bugfix
- [ ] Feature
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] Documentation content changes
- [ ] Other (please describe):

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying,
or link to a relevant issue. -->

Resolves #<Issue number>

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added by
this PR. -->

-
-
-

<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/kkrt-labs/kakarot/1022)
<!-- Reviewable:end -->
  • Loading branch information
Eikix authored Mar 7, 2024
1 parent 9d5c894 commit 6b45cfc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 42 deletions.
33 changes: 1 addition & 32 deletions scripts/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@


def pull_and_plot_ef_tests(name: Union[str, Path] = Path("logs")):

# Pull latest main artifacts
response = requests.get(
"https://api.github.com/repos/kkrt-labs/kakarot/actions/workflows/ci.yml/runs?branch=cw/run-all&per_page=100"
Expand Down Expand Up @@ -97,35 +98,3 @@ def get_artifacts(
z.extractall(Path(name) / artifact["head_branch"])

return artifacts


def fetch_deployments(path: str = "deployments"):
response = requests.get(
"https://api.github.com/repos/kkrt-labs/kakarot/actions/artifacts"
)
artifacts = (
pd.DataFrame(
[
{**artifact["workflow_run"], **artifact}
for artifact in response.json()["artifacts"]
]
)
.loc[lambda df: df["head_branch"] == "main"]
.loc[lambda df: df["name"] == "deployments"]
.sort_values(["updated_at"], ascending=False)
.archive_download_url
)

if artifacts.empty:
raise ValueError("No deployment artifacts found for base branch main")

github_token = os.getenv("GITHUB_TOKEN")
if not github_token:
raise ValueError("github token not found in environment variables")

response = requests.get(
artifacts.tolist()[0],
headers={"Authorization": f"Bearer {github_token}"},
)
z = zipfile.ZipFile(io.BytesIO(response.content))
z.extractall(path)
10 changes: 0 additions & 10 deletions scripts/utils/kakarot.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from web3.exceptions import LogTopicError, MismatchedABI, NoABIFunctionsFound
from web3.types import LogReceipt

from scripts.artifacts import fetch_deployments
from scripts.constants import EVM_ADDRESS, EVM_PRIVATE_KEY, NETWORK, RPC_CLIENT
from scripts.utils.starknet import call as _call_starknet
from scripts.utils.starknet import fund_address as _fund_starknet_address
Expand All @@ -42,15 +41,6 @@
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

if not NETWORK["devnet"]:
try:
fetch_deployments()
except Exception as e:
if not get_deployments():
logger.warn(
f"Using network {NETWORK['name']}, couldn't fetch deployment, error:\n{e}"
)


class EvmTransactionError(Exception):
pass
Expand Down

0 comments on commit 6b45cfc

Please sign in to comment.