From 5da9a232b9d4b5ea8075773a0fac5af32aae765e Mon Sep 17 00:00:00 2001 From: Darren Kelly Date: Wed, 28 Feb 2024 10:54:25 +0000 Subject: [PATCH] fix: tx case --- .github/workflows/deploy-gh-pages.yaml | 7 +++---- src/App.tsx | 5 +++-- vite.config.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index 981f468..18761ee 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -2,7 +2,7 @@ name: Deploy to GH pages on: push: - branches: [ main ] + branches: [main] # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: '20' + node-version: "20" - name: Install Repo Deps run: yarn @@ -34,9 +34,8 @@ jobs: - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: './dist' + path: "./dist" - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v1 - diff --git a/src/App.tsx b/src/App.tsx index fe86718..33fcf60 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,7 +20,6 @@ const testnet = new DAppKit({ const errorSelector = keccak256("Error(string)").toString("hex").slice(0, 8); const panicSelector = keccak256("Panic(uint256)").toString("hex").slice(0, 8); - export function decodeRevertReason(data: string): string { try { if (data.startsWith(errorSelector)) { @@ -68,7 +67,9 @@ function App() { if (!block) return; - const txIndex = block.transactions.findIndex((tx) => tx === txHash); + const txIndex = block.transactions.findIndex( + (tx) => tx.toLocaleLowerCase() === txHash.toLowerCase(), + ); for (let i = 0; i < tx.clauses.length; i++) { const debugged = await axios.post(url + "/debug/tracers", { diff --git a/vite.config.ts b/vite.config.ts index 5566876..b282f5a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -6,7 +6,7 @@ import { nodePolyfills } from "vite-plugin-node-polyfills"; export default defineConfig({ plugins: [react(), nodePolyfills()], build: { - commonjsOptions: { transformMixedEsModules: true } // Change + commonjsOptions: { transformMixedEsModules: true }, // Change }, base: "/thor-debug-revert-reason/", });