11import { describe , expect , it , beforeAll } from "@jest/globals"
22import { TransactionReceipt , parseEther } from "ethers"
33import { provider } from "./setup"
4- import { alice , deployContractTestERC20 } from "./utils"
4+ import { alice , deployContractTestERC20 , hexify } from "./utils"
5+ import { TestERC20Compiled__factory } from "../types/ethers-contracts"
56
67describe ( "debug queries" , ( ) => {
78 let contractAddress : string
@@ -28,16 +29,15 @@ describe("debug queries", () => {
2829 blockHash = receipt . blockHash
2930 } , 20e3 )
3031
31- // TODO: impl in EVM: remove skip
32- it . skip ( "debug_traceBlockByNumber" , async ( ) => {
32+ it ( "debug_traceBlockByNumber" , async ( ) => {
3333 const traceResult = await provider . send ( "debug_traceBlockByNumber" , [
3434 blockNumber ,
3535 ] )
3636 expectTrace ( traceResult )
3737 } )
3838
3939 // TODO: impl in EVM: remove skip
40- it . skip ( "debug_traceBlockByHash" , async ( ) => {
40+ it ( "debug_traceBlockByHash" , async ( ) => {
4141 const traceResult = await provider . send ( "debug_traceBlockByHash" , [
4242 blockHash ,
4343 ] )
@@ -50,6 +50,22 @@ describe("debug queries", () => {
5050 expectTrace ( [ { result : traceResult } ] )
5151 } )
5252
53+ it ( "debug_traceCall" , async ( ) => {
54+ const contractInterface = TestERC20Compiled__factory . createInterface ( )
55+ const callData = contractInterface . encodeFunctionData ( "totalSupply" )
56+ const tx = {
57+ to : contractAddress ,
58+ data : callData ,
59+ gas : hexify ( 1000_000 ) ,
60+ }
61+ const traceResult = await provider . send ( "debug_traceCall" , [
62+ tx ,
63+ "latest" ,
64+ { } ,
65+ ] )
66+ expectTrace ( [ { result : traceResult } ] )
67+ } )
68+
5369 // TODO: impl in EVM: remove skip
5470 it . skip ( "debug_getBadBlocks" , async ( ) => {
5571 const traceResult = await provider . send ( "debug_getBadBlocks" , [ txHash ] )
0 commit comments