Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

ci: add missing build workflow #22

Merged
merged 2 commits into from
Nov 27, 2023
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
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Run build

on:
pull_request:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest-16-core
strategy:
matrix:
environment: [devnet-1, testnet-1]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Install npm packages
run: npm ci

- name: Run build
run: npm run build
env:
VITE_ERC20_MESSAGING_CONTRACT_ADDRESS: ${{ vars.ERC20_MESSAGING_CONTRACT_ADDRESS }}
VITE_SUBNET_REGISTRATOR_CONTRACT_ADDRESS: ${{ vars.SUBNET_REGISTRATOR_CONTRACT_ADDRESS }}
VITE_TOPOS_CORE_PROXY_CONTRACT_ADDRESS: ${{ vars.TOPOS_CORE_PROXY_CONTRACT_ADDRESS }}
VITE_TOPOS_SUBNET_ENDPOINT_REMOTE_DEFAULT: ${{ vars.TOPOS_SUBNET_ENDPOINT_REMOTE_DEFAULT }}
VITE_TOPOS_SUBNET_ENDPOINT_CUSTOM_DEFAULT: ${{ vars.TOPOS_SUBNET_ENDPOINT_CUSTOM_DEFAULT }}
VITE_TCE_ENDPOINT_REMOTE_DEFAULT: ${{ vars.TCE_ENDPOINT_REMOTE_DEFAULT }}
VITE_TCE_ENDPOINT_CUSTOM_DEFAULT: ${{ vars.TCE_ENDPOINT_CUSTOM_DEFAULT }}
2 changes: 1 addition & 1 deletion codegen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
schema: 'http://localhost:4000',
schema: 'http://localhost:4030',
documents: ['src/**/*.tsx'],
generates: {
'./src/__generated__/': {
Expand Down
8 changes: 4 additions & 4 deletions src/__generated__/gql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 28 additions & 5 deletions src/__generated__/graphql.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/hooks/useSubnetGetCertificateById.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const GET_CERTIFICATE = graphql(`
id
proof
signature
sourceSubnetId
sourceSubnetId {
value
}
stateRoot
targetSubnets {
value
Expand Down Expand Up @@ -51,7 +53,7 @@ export default function useSubnetGetCertificateById({
if (data) {
if (
!data?.certificate ||
(data.certificate.sourceSubnetId !== selectedSubnet?.id &&
(data.certificate.sourceSubnetId.value !== selectedSubnet?.id &&
selectedSubnet)
) {
setErrors((e) => [
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/useSubnetGetCertificates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const GET_CERTIFICATES = graphql(`
id
proof
signature
sourceSubnetId
sourceSubnetId {
value
}
stateRoot
targetSubnets {
value
Expand Down
16 changes: 12 additions & 4 deletions src/hooks/useSubnetSubscribeToCertificates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ const GET_CERTIFICATES = graphql(`
id
proof
signature
sourceSubnetId
sourceSubnetId {
value
}
stateRoot
targetSubnets {
value
Expand Down Expand Up @@ -123,13 +125,18 @@ export default function useSubnetSubscribeToCertificates({
const newCertificates: Certificate[] = []

data.certificates.forEach((certificate) => {
const currentIndex = newCurrentIndexes.get(certificate.sourceSubnetId)
const currentIndex = newCurrentIndexes.get(
certificate.sourceSubnetId.value
)

if (currentIndex !== undefined) {
newCurrentIndexes.set(certificate.sourceSubnetId, currentIndex + 1)
newCurrentIndexes.set(
certificate.sourceSubnetId.value,
currentIndex + 1
)

const sourcePosition = storedPositions.get(
certificate.sourceSubnetId
certificate.sourceSubnetId.value
)
newCertificates.push({
...certificate,
Expand All @@ -146,6 +153,7 @@ export default function useSubnetSubscribeToCertificates({
},
[data?.certificates]
)
console.log(certificates)

return { certificates, error, loading }
}
Loading