mirror of
https://github.com/getwax/zk-account-abstraction.git
synced 2026-01-08 20:18:05 -05:00
27 lines
637 B
TypeScript
27 lines
637 B
TypeScript
import { ethers } from 'hardhat'
|
|
|
|
export interface DebugLog {
|
|
pc: number
|
|
op: string
|
|
gasCost: number
|
|
depth: number
|
|
stack: string[]
|
|
memory: string[]
|
|
}
|
|
|
|
export interface DebugTransactionResult {
|
|
gas: number
|
|
failed: boolean
|
|
returnValue: string
|
|
structLogs: DebugLog[]
|
|
}
|
|
|
|
export async function debugTransaction (txHash: string, disableMemory = true, disableStorage = true): Promise<DebugTransactionResult> {
|
|
const debugTx = async (hash: string): Promise<DebugTransactionResult> => await ethers.provider.send('debug_traceTransaction', [hash, {
|
|
disableMemory,
|
|
disableStorage
|
|
}])
|
|
|
|
return await debugTx(txHash)
|
|
}
|