From 5e3f847f31a4d0eb7eeb9addff52e9f22b8ef77e Mon Sep 17 00:00:00 2001 From: JCNoguera <88061365+VmMad@users.noreply.github.com> Date: Thu, 18 Jan 2024 18:37:16 +0100 Subject: [PATCH 1/5] fix: quantity of native tokens in hex (#960) --- .../stardust/address/section/native-tokens/AssetsTable.tsx | 6 ++++-- .../app/components/stardust/foundry/TokenInfoSection.tsx | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/src/app/components/stardust/address/section/native-tokens/AssetsTable.tsx b/client/src/app/components/stardust/address/section/native-tokens/AssetsTable.tsx index ad6f4b299..ebfe3abbc 100644 --- a/client/src/app/components/stardust/address/section/native-tokens/AssetsTable.tsx +++ b/client/src/app/components/stardust/address/section/native-tokens/AssetsTable.tsx @@ -35,10 +35,12 @@ const AssetsTable: React.FC = ({ networkId, outputs, setTokenC ) { for (const token of (output as CommonOutput).nativeTokens ?? []) { const existingToken = theTokens.find((t) => t.id === token.id); + // Convert to BigInt again in case the amount is hex + const amount = BigInt(token.amount); if (existingToken) { - existingToken.amount += token.amount; + existingToken.amount += amount; } else { - theTokens.push({ id: token.id, amount: token.amount }); + theTokens.push({ id: token.id, amount }); } } } diff --git a/client/src/app/components/stardust/foundry/TokenInfoSection.tsx b/client/src/app/components/stardust/foundry/TokenInfoSection.tsx index e0d189268..629f0974b 100644 --- a/client/src/app/components/stardust/foundry/TokenInfoSection.tsx +++ b/client/src/app/components/stardust/foundry/TokenInfoSection.tsx @@ -29,9 +29,9 @@ const TokenInfoSection: React.FC = ({ tokenId, tokenSchem const simpleTokenScheme = tokenScheme as SimpleTokenScheme; - const maximumSupply = formatNumberWithCommas(simpleTokenScheme.maximumSupply); - const mintedTokens = formatNumberWithCommas(simpleTokenScheme.mintedTokens); - const meltedTokens = formatNumberWithCommas(simpleTokenScheme.meltedTokens); + const maximumSupply = formatNumberWithCommas(BigInt(simpleTokenScheme.maximumSupply)); + const mintedTokens = formatNumberWithCommas(BigInt(simpleTokenScheme.mintedTokens)); + const meltedTokens = formatNumberWithCommas(BigInt(simpleTokenScheme.meltedTokens)); return (
From 1498be6d8019b7e596d57a742f1856cce383e786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eike=20Ha=C3=9F?= Date: Thu, 18 Jan 2024 18:38:38 +0100 Subject: [PATCH 2/5] Fix potential double loading of identity Wasm (#945) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix potential double loading of identity wasm * linter: fix format --------- Co-authored-by: Begoña Álvarez de la Cruz --- client/src/services/identityService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/services/identityService.ts b/client/src/services/identityService.ts index 887eea416..2c5f861f3 100644 --- a/client/src/services/identityService.ts +++ b/client/src/services/identityService.ts @@ -9,6 +9,8 @@ import { CHRYSALIS, STARDUST } from "~models/config/protocolVersion"; import * as identity from "@iota/identity-wasm/web"; export class IdentityService { + private initLibraryPromise: Promise | undefined; + /** * Resolves DID into it's DID document (Chrysalis). * @param {string} did DID to be resolved @@ -66,6 +68,10 @@ export class IdentityService { } public async initLibrary(path = "/wasm/identity_wasm_bg.wasm") { - return await identity.init(path); + if (!this.initLibraryPromise) { + this.initLibraryPromise = identity.init(path); + } + + return this.initLibraryPromise; } } From e4781729e0cb47840c2437ad137551e6a659ac2f Mon Sep 17 00:00:00 2001 From: JCNoguera <88061365+VmMad@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:17:25 +0100 Subject: [PATCH 3/5] ci: add build check for pr (#969) * ci: add build check for pr * refactor: improve inflixDbClient code and disable fail-fast --------- Co-authored-by: Mario --- .github/workflows/pr-build-check.yaml | 29 +++++++++++++++++++++++++++ .husky/pre-push | 4 ---- package.json | 1 - 3 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/pr-build-check.yaml delete mode 100755 .husky/pre-push diff --git a/.github/workflows/pr-build-check.yaml b/.github/workflows/pr-build-check.yaml new file mode 100644 index 000000000..2236d061a --- /dev/null +++ b/.github/workflows/pr-build-check.yaml @@ -0,0 +1,29 @@ +name: PR build check + +on: + pull_request: + types: [opened, reopened, synchronize] + +jobs: + build-check: + strategy: + fail-fast: false + matrix: + project: [api, client] + runs-on: ubuntu-latest + defaults: + run: + working-directory: ${{ matrix.project }} + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: "16" + + - name: Install Dependencies + run: npm install + + - name: Build Check + run: npm run build diff --git a/.husky/pre-push b/.husky/pre-push deleted file mode 100755 index b4c0b12de..000000000 --- a/.husky/pre-push +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -npm run pre-push diff --git a/package.json b/package.json index ce1d1e301..2dfbff78c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,6 @@ "setup:dev": "npm run clear && npm run prepare && npm run setup:client && npm run setup:api", "clear": "rimraf api/node_modules api/dist client/node_modules client/build", "dev": "concurrently 'cd api && npm run start-dev' 'cd client && npm run start'", - "pre-push": "concurrently 'cd api && npm run build-compile && npm run build-lint && npm run build-config' 'cd client && npm run build'", "prepare": "husky install", "format": "concurrently 'cd api && npm run format' 'cd client && npm run format'" }, From 5970aeda469b55370b2e0abf6753d5272b0d896e Mon Sep 17 00:00:00 2001 From: JCNoguera <88061365+VmMad@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:24:02 +0100 Subject: [PATCH 4/5] chore: simplify task creation template (#964) Co-authored-by: Mario --- .github/ISSUE_TEMPLATE/create-task.yml | 29 -------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/create-task.yml b/.github/ISSUE_TEMPLATE/create-task.yml index 8df1cdb86..cb8ec44d0 100644 --- a/.github/ISSUE_TEMPLATE/create-task.yml +++ b/.github/ISSUE_TEMPLATE/create-task.yml @@ -19,32 +19,3 @@ body: description: Describe the task that needs to be completed. validations: required: true - - - type: textarea - id: requirements - attributes: - label: Requirements - description: What are the requirements for this task, this could be a checklist of subtasks. - validations: - required: true - - - type: textarea - id: acceptance_criteria - attributes: - label: Acceptance criteria - description: What is the criteria for this task to be marked as done? This will help anyone approving any PRs related to this task. - validations: - required: true - - - type: checkboxes - id: checklist - attributes: - label: Creation checklist - description: 'Before submitting this task please ensure you have done the following if necessary:' - options: - - label: I have assigned this task to the correct people - required: false - - label: I have added the most appropriate labels - required: false - - label: I have linked the correct milestone and/or project - required: false From 41f619f189d9d3ef0b42dadbe8c491bf89693592 Mon Sep 17 00:00:00 2001 From: JCNoguera <88061365+VmMad@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:53:57 +0100 Subject: [PATCH 5/5] feat: add ci to assign the project to bug reports (#966) * feat: add ci to assign the project to bug reports * chore: use single quote --------- Co-authored-by: Mario --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/workflows/add-bugs-to-project.yaml | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/add-bugs-to-project.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a99abc500..010496dbe 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -2,7 +2,7 @@ name: Found a bug? description: Fill in this form to report it, and help us improve title: '[Bug]: ' -labels: type:bug report +labels: 'bug report' body: - type: markdown diff --git a/.github/workflows/add-bugs-to-project.yaml b/.github/workflows/add-bugs-to-project.yaml new file mode 100644 index 000000000..bc992d607 --- /dev/null +++ b/.github/workflows/add-bugs-to-project.yaml @@ -0,0 +1,19 @@ +name: Assign Bugs to Project + +on: + issues: + types: [labeled] +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + assign_to_project: + runs-on: ubuntu-latest + name: Assign bug issue to Bug Management project + steps: + - name: Assign issues with bug report label to 'Tooling - Bug Management' project + uses: srggrs/assign-one-project-github-action@4fc2b23bdaaac08e64dcc590a6e138d2f9b8c86e + if: contains(github.event.issue.labels.*.name, 'bug report') + with: + project: 'https://github.com/orgs/iotaledger/projects/78' + column_name: 'Triage'