Skip to content

Commit

Permalink
Merge branch 'main' into subgraph_activity_details
Browse files Browse the repository at this point in the history
  • Loading branch information
ioay committed Apr 14, 2024
2 parents 8d44058 + d742627 commit 7b131bb
Show file tree
Hide file tree
Showing 185 changed files with 5,527 additions and 1,650 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Auto-fix linting
d2a058fe6cfbab6f82d0d977d1b2d8bd9f494df1
0976ac1b09b7257fe74389bafe94697059a07aed

# Move core/ to solidity/
9b45a73a99b879e6fd362553f60de79405abad98
12 changes: 6 additions & 6 deletions .github/workflows/reusable-sdk-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ on:
workflow_call:

jobs:
core-build:
uses: ./.github/workflows/reusable-core-build.yaml
solidity-build:
uses: ./.github/workflows/reusable-solidity-build.yaml

sdk-build:
defaults:
run:
working-directory: ./sdk
needs: [core-build]
needs: [solidity-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -24,11 +24,11 @@ jobs:
node-version-file: "sdk/.nvmrc"
cache: "pnpm"

- name: Download Core Build Artifacts
- name: Download Solidity Build Artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Install Dependencies
run: pnpm install --prefer-offline --frozen-lockfile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Build the core package
name: Build the Solidity package
on:
workflow_call:

jobs:
build-core:
build-solidity:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./core
working-directory: ./solidity
steps:
- uses: actions/checkout@v4

Expand All @@ -17,7 +17,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
node-version-file: "solidity/.nvmrc"
cache: "pnpm"

- name: Install Dependencies
Expand All @@ -29,9 +29,9 @@ jobs:
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: core-build
name: solidity-build
path: |
core/build/
core/cache/
core/typechain/
solidity/build/
solidity/cache/
solidity/typechain/
if-no-files-found: error
12 changes: 6 additions & 6 deletions .github/workflows/sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
node-version-file: "sdk/.nvmrc"
cache: "pnpm"

- name: Download Core Build Artifacts
- name: Download Solidity Build Artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Install Dependencies
run: pnpm install --prefer-offline --frozen-lockfile
Expand All @@ -58,11 +58,11 @@ jobs:
node-version-file: "sdk/.nvmrc"
cache: "pnpm"

- name: Download Core Build Artifacts
- name: Download Solidity Build Artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Install Dependencies
run: pnpm install --prefer-offline --frozen-lockfile
Expand Down
62 changes: 31 additions & 31 deletions .github/workflows/core.yaml → .github/workflows/solidity.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Core
name: Solidity

on:
push:
branches:
- main
paths:
- "core/**"
- "solidity/**"
pull_request:
workflow_dispatch:
inputs:
Expand All @@ -19,14 +19,14 @@ on:

defaults:
run:
working-directory: ./core
working-directory: ./solidity

jobs:
core-build:
uses: ./.github/workflows/reusable-core-build.yaml
solidity-build:
uses: ./.github/workflows/reusable-solidity-build.yaml

core-format:
needs: [core-build]
solidity-format:
needs: [solidity-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
node-version-file: "solidity/.nvmrc"
cache: "pnpm"

- name: Install Dependencies
Expand All @@ -46,14 +46,14 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Format
run: pnpm run format

core-slither:
needs: [core-build]
solidity-slither:
needs: [solidity-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
node-version-file: "solidity/.nvmrc"
cache: "pnpm"

- name: Install Dependencies
Expand All @@ -82,14 +82,14 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Run Slither
run: slither --hardhat-ignore-compile .

core-test:
needs: [core-build]
solidity-test:
needs: [solidity-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -100,7 +100,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
node-version-file: "solidity/.nvmrc"
cache: "pnpm"

- name: Install Dependencies
Expand All @@ -109,14 +109,14 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Test
run: pnpm run test --no-compile

core-deploy-dry-run:
needs: [core-build]
solidity-deploy-dry-run:
needs: [solidity-build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -127,7 +127,7 @@ jobs:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
node-version-file: "solidity/.nvmrc"
cache: "pnpm"

- name: Install Dependencies
Expand All @@ -136,14 +136,14 @@ jobs:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Deploy
run: pnpm run deploy --no-compile

core-deploy-testnet:
needs: [core-deploy-dry-run]
solidity-deploy-testnet:
needs: [solidity-deploy-dry-run]
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
Expand All @@ -155,7 +155,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "core/.nvmrc"
node-version-file: "solidity/.nvmrc"
cache: "pnpm"

- name: Install dependencies
Expand All @@ -164,8 +164,8 @@ jobs:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: core-build
path: core/
name: solidity-build
path: solidity/

- name: Remove existing deployment artifacts for the selected network
run: rm -rf deployments/${{ github.event.inputs.environment }}
Expand All @@ -186,5 +186,5 @@ jobs:
with:
name: deployed-contracts-${{ github.event.inputs.environment }}
path: |
core/deployments/${{ github.event.inputs.environment }}
solidity/deployments/${{ github.event.inputs.environment }}
if-no-files-found: error
1 change: 0 additions & 1 deletion .github/workflows/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,3 @@ jobs:

- name: Tests
run: pnpm run test

29 changes: 14 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@ repos:
- id: root-lint
name: "lint root"
entry: /usr/bin/env bash -c "npm run format"
exclude: (^core/|^dapp/|^website/|^subgraph/)
exclude: (^solidity/|^dapp/|^website/|^subgraph/)
language: script
description: "Checks code according to the package's linter configuration"
# Core
- id: core-lint-sol
name: "lint core sol"
entry: /usr/bin/env bash -c "npm --prefix ./core/ run lint:sol"
files: ^core/
# Solidity
- id: solidity-lint-sol
name: "lint solidity sol"
entry: /usr/bin/env bash -c "npm --prefix ./solidity/ run lint:sol"
files: ^solidity/
types: [solidity]
language: script
description: "Checks solidity code according to the package's linter configuration"
- id: core-lint-js
name: "lint core ts/js"
entry: /usr/bin/env bash -c "npm --prefix ./core/ run lint:js"
files: ^core/
- id: solidity-lint-js
name: "lint solidity ts/js"
entry: /usr/bin/env bash -c "npm --prefix ./solidity/ run lint:js"
files: ^solidity/
types_or: [ts, javascript]
language: script
description: "Checks TS/JS code according to the package's linter configuration"
- id: core-lint-config
name: "lint core json/yaml"
entry: /usr/bin/env bash -c "npm --prefix ./core/ run lint:config"
files: ^core/
- id: solidity-lint-config
name: "lint solidity json/yaml"
entry: /usr/bin/env bash -c "npm --prefix ./solidity/ run lint:config"
files: ^solidity/
types_or: [json, yaml]
language: script
description: "Checks JSON/YAML code according to the package's linter configuration"
Expand Down Expand Up @@ -90,4 +90,3 @@ repos:
types_or: [json, yaml]
language: script
description: "Checks JSON/YAML code according to the package's linter configuration"

2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Packages that have own prettier configuration.
core/
solidity/
dapp/
website/
sdk/
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Bitcoin Liquid Staking

[![Core](https://github.com/thesis/acre/actions/workflows/core.yaml/badge.svg?branch=main&event=push)](https://github.com/thesis/acre/actions/workflows/core.yaml)

## Development

### pnpm
Expand Down Expand Up @@ -51,7 +49,7 @@ commands:
pre-commit run --all-files

# Execute hooks for specific files (e.g. stBTC.sol):
pre-commit run --files ./core/contracts/stBTC.sol
pre-commit run --files ./solidity/contracts/stBTC.sol
```

### Syncpack
Expand Down
1 change: 0 additions & 1 deletion core/.solhintignore

This file was deleted.

3 changes: 0 additions & 3 deletions core/README.md

This file was deleted.

Loading

0 comments on commit 7b131bb

Please sign in to comment.