Skip to content

Commit

Permalink
Merge branch 'main' into bridge_additional_tests2
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored May 3, 2024
2 parents 2653e10 + ece4374 commit 0d983be
Show file tree
Hide file tree
Showing 400 changed files with 21,831 additions and 11,026 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/guardian-prover-health-check-ui-preview.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/guardian-prover-health-check-ui-production.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/guardian-ui-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Deploy Guardians UI to Vercel

on:
workflow_call:
inputs:
environment:
type: string
required: true
flags:
type: string
required: true
vercel_org_id:
type: string
required: true
vercel_project_id:
type: string
required: true

env:
VERCEL_ORG_ID: ${{ inputs.vercel_org_id }}
VERCEL_PROJECT_ID: ${{ inputs.vercel_project_id }}

jobs:
build-deploy:
runs-on: [taiko-runner]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies

- name: Install Vercel CLI
run: pnpm add --global vercel@latest

- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=${{ inputs.environment }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Build Project Artifacts
run: vercel build ${{ inputs.flags }} --token=${{ secrets.VERCEL_TOKEN }}

- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt ${{ inputs.flags }} --token=${{ secrets.VERCEL_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/guardian-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Guardian UI CI/CD

on:
push:
branches-ignore:
- release-please-*
paths:
- "packages/guardian-prover-health-check-ui/**"

jobs:
# Deployment name follow the pattern: deploy_<appname(bridge-ui)>_<network(devnet|hekla|mainnet)>_<environment(preview|production)>
deploy_guardian-ui_hekla_preview:
if: ${{ !github.ref_name == 'main' }}
uses: ./.github/workflows/guardian-ui-deploy.yml
with:
environment: "preview"
flags: ""
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID_GUARDIAN_PROVER_HEALTH_CHECK_UI_HEKLA }}

deploy_guardian-ui_devnet_preview:
if: ${{ !github.ref_name == 'main' }}
uses: ./.github/workflows/guardian-ui-deploy.yml
with:
environment: "preview"
flags: ""
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID_GUARDIAN_PROVER_HEALTH_CHECK_UI_INTERNAL }}

deploy_guardian-ui_hekla_production:
if: ${{ github.ref_name == 'main' && startsWith(github.ref, 'refs/tags/guardian-prover-health-check-ui-') }}
uses: ./.github/workflows/guardian-ui-deploy.yml
with:
environment: "production"
flags: "--prod"
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
vercel_project_id: ${{ secrets.VERCEL_PROJECT_ID_GUARDIAN_PROVER_HEALTH_CHECK_UI_HEKLA }}
2 changes: 1 addition & 1 deletion .github/workflows/slither.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: rm packages/protocol/package.json

- name: Run Slither
uses: crytic/[email protected].1
uses: crytic/[email protected].2
id: slither
with:
target: packages/protocol
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/taikoon-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Taikoon UI

on:
push:
branches: [main]
paths:
- "packages/taikoon-ui/**"
pull_request:
paths:
- "packages/taikoon-ui/**"

jobs:
build:
runs-on: [taiko-runner]
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install pnpm dependencies
uses: ./.github/actions/install-pnpm-dependencies

- name: Check formatting
working-directory: ./packages/taikoon-ui
run: pnpm lint

- name: Frontend build
working-directory: ./packages/taikoon-ui
run: |
export PUBLIC_WALLETCONNECT_PROJECT_ID="fake_project_id"
export PUBLIC_IPFS_GATEWAY="https://ipfs.io/ipfs/"
pnpm build
30 changes: 15 additions & 15 deletions packages/bridge-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,45 @@
"devDependencies": {
"@playwright/test": "^1.43.1",
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.30.4",
"@sveltejs/kit": "^2.5.7",
"@sveltejs/vite-plugin-svelte": "^3.1.0",
"@types/debug": "^4.1.12",
"@types/object-hash": "^3.0.6",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.7.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@vitest/coverage-v8": "^1.4.0",
"@wagmi/cli": "^2.1.4",
"abitype": "^1.0.2",
"ajv": "^8.12.0",
"autoprefixer": "^10.4.18",
"daisyui": "^4.7.2",
"daisyui": "^4.10.3",
"dotenv": "^16.4.5",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-simple-import-sort": "^12.0.0",
"eslint-plugin-svelte": "^2.35.1",
"eslint-plugin-svelte": "^2.38.0",
"ethereum-address": "^0.0.4",
"jsdom": "^24.0.0",
"lokijs": "^1.5.12",
"postcss": "^8.4.38",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.2",
"svelte": "^4.2.12",
"svelte-check": "^3.6.9",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "^4.2.15",
"svelte-check": "^3.7.0",
"tailwindcss": "^3.4.3",
"ts-morph": "^19.0.0",
"tslib": "^2.6.2",
"typescript": "^5.4.3",
"vite": "^4.5.3",
"vite": "^5.2.10",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^0.32.4",
"vitest": "^1.5.3",
"vitest-fetch-mock": "^0.2.2",
"vitest-mock-extended": "1.3.1"
},
"type": "module",
"dependencies": {
"@wagmi/connectors": "^4.1.18",
"@wagmi/core": "^2.6.9",
"@wagmi/connectors": "^4.3.1",
"@wagmi/core": "^2.8.1",
"@walletconnect/ethereum-provider": "^2.12.2",
"@walletconnect/modal": "^2.6.2",
"@web3modal/wagmi": "^4.1.11",
Expand All @@ -71,7 +71,7 @@
"debug": "^4.3.4",
"events": "^3.3.0",
"object-hash": "^3.0.0",
"svelte-i18n": "^3.7.4",
"viem": "^2.7.11"
"svelte-i18n": "^4.0.0",
"viem": "^2.9.29"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@

<script lang="ts">
import { SvelteToast } from '@zerodevx/svelte-toast';
import type { SvelteToastOptions } from '@zerodevx/svelte-toast/stores';
const options: SvelteToastOptions = {
const options = {
duration: toastConfig.duration,
};
</script>
Expand Down
29 changes: 29 additions & 0 deletions packages/bridge-ui/src/tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,32 @@ import dotenv from 'dotenv';
dotenv.config({ path: './.env.test' });

vi.mock('@wagmi/core');

// Source: https://github.com/vitest-dev/vitest/issues/4043#issuecomment-1905172846
// This snippet is needed in order to support Uint8Array with vitest and jsdom.
if (process.env.VITEST === 'true') {
class ESBuildAndJSDOMCompatibleTextEncoder extends TextEncoder {
constructor() {
super();
}

encode(input: string) {
if (typeof input !== 'string') {
throw new TypeError('`input` must be a string');
}

const decodedURI = decodeURIComponent(encodeURIComponent(input));
const arr = new Uint8Array(decodedURI.length);
const chars = decodedURI.split('');
for (let i = 0; i < chars.length; i++) {
arr[i] = decodedURI[i].charCodeAt(0);
}
return arr;
}
}

Object.defineProperty(global, 'TextEncoder', {
value: ESBuildAndJSDOMCompatibleTextEncoder,
writable: true,
});
}
4 changes: 2 additions & 2 deletions packages/bridge-ui/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand Down
4 changes: 2 additions & 2 deletions packages/bridge-ui/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { sveltekit } from '@sveltejs/kit/vite';
import dotenv from 'dotenv';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineProject } from 'vitest/dist/config';

import { generateBridgeConfig } from './scripts/vite-plugins/generateBridgeConfig';
import { generateChainConfig } from './scripts/vite-plugins/generateChainConfig';
Expand All @@ -13,7 +13,7 @@ if (process.env.NODE_ENV === 'test') {
dotenv.config({ path: './.env.test' });
}

export default defineProject({
export default defineConfig({
build: {
sourcemap: true,
},
Expand Down
6 changes: 0 additions & 6 deletions packages/eventindexer/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ func InitFromConfig(ctx context.Context, api *API, cfg *Config) error {
return err
}

statRepository, err := repo.NewStatRepository(db)
if err != nil {
return err
}

nftBalanceRepository, err := repo.NewNFTBalanceRepository(db)
if err != nil {
return err
Expand All @@ -79,7 +74,6 @@ func InitFromConfig(ctx context.Context, api *API, cfg *Config) error {

srv, err := http.NewServer(http.NewServerOpts{
EventRepo: eventRepository,
StatRepo: statRepository,
NFTBalanceRepo: nftBalanceRepository,
ChartRepo: chartRepository,
Echo: echo.New(),
Expand Down
2 changes: 2 additions & 0 deletions packages/eventindexer/disperser/disperser.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ func (d *Disperser) Start() error {
return err
}

slog.Info("addresses", "addresses", addresses)

for _, address := range addresses {
slog.Info("dispersing to", "address", address)

Expand Down
Loading

0 comments on commit 0d983be

Please sign in to comment.