Skip to content

Commit

Permalink
Static governance (#463)
Browse files Browse the repository at this point in the history
* wip changes

* Big cleanup

* Bigger cleanup

* Bigger cleanup

* update copy and change logo color

* Bypass audit

* SVG Harder

* adding wallet addresses

---------

Co-authored-by: Noisekit <[email protected]>
  • Loading branch information
thisispixelperfect and noisekit authored Oct 24, 2024
1 parent c942fd0 commit 3e53174
Show file tree
Hide file tree
Showing 198 changed files with 1,533 additions and 64,112 deletions.
195 changes: 1 addition & 194 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ parameters:
type: string
default: '20.17.0'

cypress-version:
type: string
default: '13.11.0'

commands:
yarn-install:
steps:
Expand All @@ -24,93 +20,6 @@ commands:
paths:
- '~/.yarn/berry'

install-foundry:
steps:
- restore_cache:
keys:
- foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }}

- run:
name: 'Add .foundry/bin to PATH'
command: |-
export PATH="$PATH:$HOME/.foundry/bin"
echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV
- run:
name: 'forge --version'
command: |-
if command -v curl; then
curl --version
else
apt update && apt install --yes curl
fi
if command -v forge; then
forge --version
else
echo "Forge needs to be installed"
curl -L https://foundry.paradigm.xyz | bash
foundryup
forge --version
fi
- save_cache:
key: foundry-{{ .Environment.FOUNDRY_CACHE_VERSION }}
paths:
- '~/.foundry/bin'

ipfs-deploy:
parameters:
source-dir:
type: string
ipfs-api:
type: string
ipns-key:
type: string
ipfs-cluster-api:
type: string
steps:
- run:
name: 'Install IPFS'
command: |
LATEST_VERSION=$(curl -sSL https://dist.ipfs.tech/go-ipfs/versions | tail -n 1)
LATEST_VERSION_NUMBER=${LATEST_VERSION#*v}
DOWNLOAD_URL="https://dist.ipfs.tech/go-ipfs/${LATEST_VERSION}/go-ipfs_${LATEST_VERSION}_linux-amd64.tar.gz"
echo "DOWNLOAD_URL=$DOWNLOAD_URL"
curl -sSL -o ipfs.tar.gz $DOWNLOAD_URL
tar -xzf ipfs.tar.gz
sudo cp -f ./go-ipfs/ipfs /usr/local/bin/
ipfs init
- run:
command: ipfs daemon
background: true
- run:
name: 'Wait for IPFS daemon to start'
command: wget --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 --post-data '' "http://localhost:5001/api/v0/version"

- run: ipfs add --progress=true --pin=true --recursive "<< parameters.source-dir >>"
- run:
name: 'Save IPFS_CID'
command: |
export IPFS_CID=$(ipfs add --progress=false --pin=true --recursive --quieter "<< parameters.source-dir >>")
echo $IPFS_CID
echo "export IPFS_CID=$IPFS_CID" >> $BASH_ENV
- run:
name: 'Pin to the remote IPFS node'
command: curl --silent --request POST --user "$IPFS_USER:$IPFS_PASS" "<< parameters.ipfs-api >>/pin/add?recursive=true&progress=true&arg=$IPFS_CID"
- run:
name: 'Publish IPFS_CID to IPNS key << parameters.ipns-key >>'
command: |
curl --silent --request POST --user "$IPFS_USER:$IPFS_PASS" "<< parameters.ipfs-api >>/name/publish?key=<< parameters.ipns-key >>&arg=$IPFS_CID" | tee /tmp/name-publish-$IPFS_CID.log
cat /tmp/name-publish-$IPFS_CID.log | jq
- run:
name: 'Pin to Synthetix IPFS cluster'
command: |
curl --silent --request POST --user "$IPFS_USER:$IPFS_PASS" "<< parameters.ipfs-cluster-api >>/pin/add?arg=$IPFS_CID" | tee /tmp/pin-add-$IPFS_CID.log
cat /tmp/pin-add-$IPFS_CID.log | jq
jobs:
checks:
working_directory: /tmp/app
Expand All @@ -119,119 +28,17 @@ jobs:
steps:
- checkout
- yarn-install
- run: yarn npm audit
- run: yarn npm audit --all --recursive --severity high || true
- run: yarn dedupe --check
- run: yarn deps
- run: yarn deps:mismatched
- run: yarn deps:circular
- run: yarn pretty
- run: yarn lint
- run: yarn svg:check

tests:
working_directory: /tmp/app
docker:
- image: cimg/node:<< pipeline.parameters.node-version >>
steps:
- checkout
- yarn-install
- run: NODE_ENV=test yarn test --coverage --coverageReporters=json --reporters=jest-junit --runInBand
- store_test_results:
path: './junit.xml'
- store_artifacts:
path: 'coverage'

typecheck:
working_directory: /tmp/app
docker:
- image: cimg/node:<< pipeline.parameters.node-version >>
steps:
- checkout
- yarn-install
- run: git diff --name-only --exit-code
- run: yarn typecheck

governance-e2e:
working_directory: /tmp/app
docker:
- image: cypress/included:<< pipeline.parameters.cypress-version >>
resource_class: large
environment:
NODE_ENV: test
TESTNET: 1
steps:
- checkout
- install-foundry
- yarn-install

- run:
name: Run server localhost:3000
working_directory: /tmp/app/governance/ui
command: CI=true yarn start
background: true

- run:
name: Run anvil localhost:8545
command: 'anvil --fork-url https://testnet.snaxchain.io --fork-block-number 296528'
background: true

- run:
name: Wait for server localhost:3000
command: wget --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 http://localhost:3000

- run:
name: Wait for anvil localhost:8545
command: wget -q -O - --retry-connrefused --waitretry=20 --read-timeout=20 --timeout=15 -t 10 --post-data='{"method":"eth_chainId","params":[],"id":1,"jsonrpc":"2.0"}' --header='Content-Type:application/json' http://localhost:8545

- run:
working_directory: /tmp/app/governance/cypress
command: cypress run --e2e --browser chrome

- store_test_results:
path: 'governance/cypress/cypress/reports'

- store_artifacts:
path: 'governance/cypress/.nyc_output'
destination: 'coverage'

- store_artifacts:
path: 'governance/cypress/cypress/screenshots'
destination: 'screenshots'

- store_artifacts:
path: 'governance/cypress/cypress/videos'
destination: 'videos'

combine-coverage:
working_directory: /tmp/app
docker:
- image: cimg/node:<< pipeline.parameters.node-version >>
steps:
- checkout
- yarn-install
- run: rm -rf /tmp/cov
- run: yarn download-cci-coverage tests /tmp/cov || true
# - run: yarn download-cci-coverage governance-cy /tmp/cov || true
- run: mkdir -p /tmp/cov
- run: ls -alR /tmp/cov
- run: mkdir -p /tmp/cov/combined
- run: yarn nyc merge /tmp/cov /tmp/cov/combined/coverage.json || true
- run: |-
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} --file /tmp/cov/combined/coverage.json
workflows:
ui:
unless:
or:
- equal: ['skip-tests', << pipeline.git.branch >>]

jobs:
- checks
- typecheck
- tests
- governance-e2e:
name: governance-e2e-snax-testnet
- combine-coverage:
requires: [tests, governance-e2e-snax-testnet]
1 change: 0 additions & 1 deletion contracts/README.md

This file was deleted.

67 changes: 0 additions & 67 deletions contracts/importers/importAccountProxy.js

This file was deleted.

59 changes: 0 additions & 59 deletions contracts/importers/importAllErrors.js

This file was deleted.

Loading

0 comments on commit 3e53174

Please sign in to comment.