From 0e97a86c07a7e416aaa121e43f35d18a646645d0 Mon Sep 17 00:00:00 2001 From: Alain Brenzikofer Date: Mon, 9 Sep 2024 18:27:49 +0200 Subject: [PATCH] fix BigInt issue prettier --- pages/index.vue | 18 +++++++++++------- store/teerAccount.ts | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 0fe1d4c..2090c68 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -411,7 +411,10 @@ Bond TEER to accumulate TEERdays
Not enough transferrable TEER. Please get free test TEER @@ -442,9 +445,10 @@ step="0.1" :min="0.1" :max=" - accountStore.getTransferrable / - Math.pow(10, 12) - - 0.1 + Number( + accountStore.getTransferrable / + BigInt(Math.pow(10, 12)), + ) - 0.1 " required class="flex-grow rounded-md border-0 bg-gray-800 py-1.5 text-white shadow-sm ring-1 ring-inset ring-gray-700 focus:ring-1 focus:ring-inset focus:ring-incognitee-green sm:text-sm sm:leading-6" @@ -1161,9 +1165,9 @@ watch(accountStore, async () => { }, }) => { console.log("TEER balance:" + currentFree); - accountStore.free = Number(currentFree); - accountStore.reserved = Number(currentReserved); - accountStore.frozen = Number(currentFrozen); + accountStore.free = BigInt(currentFree); + accountStore.reserved = BigInt(currentReserved); + accountStore.frozen = BigInt(currentFrozen); isFetchingTeerBalance.value = false; }, ); diff --git a/store/teerAccount.ts b/store/teerAccount.ts index 942ce1a..15b3fc9 100644 --- a/store/teerAccount.ts +++ b/store/teerAccount.ts @@ -4,9 +4,9 @@ import { formatBalance } from "@polkadot/util"; export const useAccount = defineStore("teerAccount", { state: () => ({ address: null, - free: 0, - reserved: 0, - frozen: 0, + free: BigInt(0), + reserved: BigInt(0), + frozen: BigInt(0), }), getters: { getShortAddress({ address }): string {