Skip to content

Commit

Permalink
resolving merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-de-leon-cll committed Mar 15, 2024
2 parents d5674f2 + fb70e9d commit 35b60eb
Show file tree
Hide file tree
Showing 88 changed files with 1,552 additions and 2,449 deletions.
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
46 changes: 33 additions & 13 deletions .github/workflows/integration-tests-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ concurrency:
cancel-in-progress: true

env:
CHAINLINK_ENV_USER: ${{ github.actor }}
TEST_LOG_LEVEL: debug
CL_ECR: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
ENV_JOB_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink-starknet-tests:${{ github.sha }}
Expand Down Expand Up @@ -114,18 +113,12 @@ jobs:
image:
- name: ""
tag-suffix: ""
- name: (plugins)
test-name: embedded
- name: plugins
tag-suffix: -plugins
test-name: plugins
env:
TEST_SUITE: smoke
TEST_ARGS: -test.timeout 1h
PRIVATE_KEY: ${{ secrets.GOERLI_PRIVATE_KEY }}
ACCOUNT: ${{ secrets.GOERLI_ACCOUNT }}
TTL: 3h
TEST_DURATION: 15m
NODE_COUNT: 5
CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
CHAINLINK_VERSION: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
permissions:
checks: write
pull-requests: write
Expand All @@ -147,10 +140,37 @@ jobs:
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Cairo
uses: ./.github/actions/install-cairo
- name: Build contracts
run: |
cd contracts && scarb --profile release build
- name: Build gauntlet
run: |
yarn install && yarn build
- name: Generate config overrides
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
cat << EOF > config.toml
[ChainlinkImage]
image="${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink"
version="starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}"
[Network]
selected_networks=["SIMULATED"]
[Common]
internal_docker_repo = "${{ env.INTERNAL_DOCKER_REPO }}"
stateful_db = false
EOF
# shellcheck disable=SC2002
BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0)
# shellcheck disable=SC2086
echo ::add-mask::$BASE64_CONFIG_OVERRIDE
# shellcheck disable=SC2086
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
- name: Run Tests ${{ matrix.image.name }}
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@ea889b3133bd7f16ab19ba4ba130de5d9162c669 # v2.3.4
with:
test_command_to_run: nix develop -c helm repo update && make test-integration-smoke-ci
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
test_command_to_run: nix develop -c helm repo update && make test=${{ matrix.image.test-name }} test-integration-smoke-ci
test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download
cl_repo: ${{ env.CL_ECR }}
cl_image_tag: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
Expand All @@ -159,4 +179,4 @@ jobs:
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
artifacts_location: /home/runner/work/chainlink-starknet/chainlink-starknet/integration-tests/smoke/logs
artifacts_location: /home/runner/work/chainlink-starknet/chainlink-starknet/integration-tests/smoke/logs
132 changes: 0 additions & 132 deletions .github/workflows/integration-tests-soak.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,4 @@ ztarrepo.tar.gz
eslint-report.json
.run.id
.local-mock-server
override*.toml
18 changes: 6 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,29 +200,23 @@ test-integration-smoke: test-integration-prep
.PHONY: test-integration-smoke-ci
test-integration-smoke-ci:
cd integration-tests/ && \
go test --timeout=2h -v -count=1 -json ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt
go test --timeout=2h -v -count=1 -run TestOCRBasic/$(test) -json ./smoke

.PHONY: test-integration-soak
test-integration-soak: test-integration-prep
cd integration-tests/ && \
go test --timeout=1h -v -json./soak
go test --timeout=1h -v -json ./soak

# CI Already has already ran test-integration-prep
.PHONY: test-integration-soak-ci
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface FunderOptions {
network?: string
gateway?: string
accountAddr?: string
keyPair?: Uint8Array
keyPair: Uint8Array
}

// Define the Strategy to use depending on the network.
Expand Down Expand Up @@ -71,7 +71,7 @@ class DevnetFundingStrategy implements IFundingStrategy {

// Fund the Account on Testnet
class AllowanceFundingStrategy implements IFundingStrategy {
public async fund(accounts: FundAccounts[], opts: FunderOptions) {
public async fund(accounts: FundAccounts[], opts: Required<FunderOptions>) {
const provider = new RpcProvider({
nodeUrl: constants.NetworkName.SN_GOERLI,
})
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/emergency/StarknetValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { BigNumber, Contract, ContractFactory } from 'ethers'
import * as l1l2messaging from '../l1-l2-messaging'
import { STARKNET_DEVNET_URL } from '../constants'
import { account } from '@chainlink/starknet'
import * as account from '../account'
import { ethers } from 'hardhat'
import { expect } from 'chai'

Expand Down
2 changes: 1 addition & 1 deletion contracts/test/ocr2/aggregator.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fetchStarknetAccount, getStarknetContractArtifacts } from '../utils'
import { bytesToFelts } from '@chainlink/starknet-gauntlet'
import { STARKNET_DEVNET_URL, TIMEOUT } from '../constants'
import { account } from '@chainlink/starknet'
import * as account from '../account'
import { assert, expect } from 'chai'
import {
DeclareDeployUDCResponse,
Expand Down
3 changes: 0 additions & 3 deletions examples/contracts/aggregator-consumer/.gitignore

This file was deleted.

Loading

0 comments on commit 35b60eb

Please sign in to comment.