Skip to content

Commit

Permalink
fix: tx case
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Feb 28, 2024
1 parent c0b2cb0 commit 5da9a23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "20"

- name: Install Repo Deps
run: yarn
Expand All @@ -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

5 changes: 3 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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", {
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/",
});

0 comments on commit 5da9a23

Please sign in to comment.