Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BCI-2538]: Updates Examples Directory #364

Merged
merged 9 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/actions/install-starknet-foundry/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Install Starknet Foundry (snforge and sncast)
description: A composite action that installs the snforge and sncast binaries

inputs:
starknet_foundry_version:
description: Starknet Foundry release version
default: "0.18.0"
required: false

runs:
using: composite
steps:
- name: Setup Starknet Foundry for Linux
id: install-starknet-foundry
shell: bash
run: |
curl -L https://raw.githubusercontent.com/foundry-rs/starknet-foundry/master/scripts/install.sh | sh
snfoundryup -v ${{ inputs.starknet_foundry_version }}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Integration Contracts (Vendor, Examples)
name: Example Contracts

on:
push:
Expand All @@ -8,7 +8,7 @@ on:
pull_request:

jobs:
integration_contracts_run_tests:
run_examples_tests:
name: Run Tests
runs-on: ubuntu-latest
steps:
Expand All @@ -23,5 +23,8 @@ jobs:
- name: Install Cairo
uses: ./.github/actions/install-cairo

- name: Install Starknet Foundry
uses: ./.github/actions/install-starknet-foundry

- name: Test
run: nix develop -c make test-integration-contracts
run: nix develop -c make test-examples
14 changes: 4 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,10 @@ test-integration-soak-ci:
cd integration-tests/ && \
go test --timeout=1h -v -count=1 -json ./soak

.PHONY: test-integration-contracts
# TODO: better network lifecycle setup - requires external network (L1 + L2)
# TODO: readd test examples
# cd examples/contracts/aggregator-consumer/ && \
# yarn test
test-integration-contracts: build-ts env-devnet-hardhat
echo "Tests currently broken because of starknet-hardhat-plugin"
exit 1
cd packages-ts/starknet/ && \
yarn test
.PHONY: test-examples
test-examples:
cd ./examples/contracts/aggregator_consumer && \
snforge test

.PHONY: test-integration-gauntlet
# TODO: fix example
Expand Down
1 change: 0 additions & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
},
"dependencies": {
"@chainlink/contracts": "^0.4.2",
"@chainlink/starknet": "^1.0.0",
"@openzeppelin/contracts": "^4.7.3",
"axios": "^0.24.0"
}
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions contracts/test/emergency/StarknetValidator.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ethers, starknet, network } from 'hardhat'
import { BigNumber, Contract, ContractFactory } from 'ethers'
import { hash, number } from 'starknet'
import { hash } from 'starknet'
import {
Account,
StarknetContractFactory,
Expand All @@ -13,7 +13,8 @@ import { abi as aggregatorAbi } from '../../artifacts/@chainlink/contracts/src/v
import { abi as accessControllerAbi } from '../../artifacts/@chainlink/contracts/src/v0.8/interfaces/AccessControllerInterface.sol/AccessControllerInterface.json'
import { abi as starknetMessagingAbi } from '../../artifacts/vendor/starkware-libs/cairo-lang/src/starkware/starknet/solidity/IStarknetMessaging.sol/IStarknetMessaging.json'
import { deployMockContract, MockContract } from '@ethereum-waffle/mock-contract'
import { account, addCompilationToNetwork, expectSuccessOrDeclared } from '@chainlink/starknet'
import * as account from '../account'
import { addCompilationToNetwork, expectSuccessOrDeclared } from '../utils'

describe('StarknetValidator', () => {
/** Fake L2 target */
Expand Down
3 changes: 2 additions & 1 deletion contracts/test/ocr2/aggregator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { starknet } from 'hardhat'
import { ec, hash, num } from 'starknet'
import { Account, StarknetContract, StarknetContractFactory } from 'hardhat/types/runtime'
import { TIMEOUT } from '../constants'
import { account, expectInvokeError, expectSuccessOrDeclared } from '@chainlink/starknet'
import { expectInvokeError, expectSuccessOrDeclared } from '../utils'
import * as account from '../account'
import { bytesToFelts } from '@chainlink/starknet-gauntlet'

interface Oracle {
Expand Down
File renamed without changes.
3 changes: 0 additions & 3 deletions examples/contracts/aggregator-consumer/.gitignore

This file was deleted.

70 changes: 0 additions & 70 deletions examples/contracts/aggregator-consumer/README.md

This file was deleted.

14 changes: 0 additions & 14 deletions examples/contracts/aggregator-consumer/Scarb.toml

This file was deleted.

2 changes: 0 additions & 2 deletions examples/contracts/aggregator-consumer/cairo_project.toml

This file was deleted.

11 changes: 0 additions & 11 deletions examples/contracts/aggregator-consumer/example.env

This file was deleted.

35 changes: 0 additions & 35 deletions examples/contracts/aggregator-consumer/hardhat.config.ts

This file was deleted.

33 changes: 0 additions & 33 deletions examples/contracts/aggregator-consumer/package.json

This file was deleted.

Loading
Loading