hardhat-tracer
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -44,2 +44,9 @@ "use strict"; | ||
} | ||
const extra = []; | ||
if ((value = ethers_1.BigNumber.from(value)).gt(0)) { | ||
extra.push(`value: ${(0, param_1.formatParam)(value, dependencies)}`); | ||
} | ||
if ((gas = ethers_1.BigNumber.from(gas)).gt(0) && dependencies.tracerEnv.gasCost) { | ||
extra.push(`gas: ${(0, param_1.formatParam)(gas, dependencies)}`); | ||
} | ||
if (result && functionFragment) { | ||
@@ -50,9 +57,2 @@ const inputArgs = (0, result_1.formatResult)(result, functionFragment, { decimals: -1, isInput: true, shorten: false }, dependencies); | ||
: ""; | ||
const extra = []; | ||
if ((value = ethers_1.BigNumber.from(value)).gt(0)) { | ||
extra.push(`value: ${(0, param_1.formatParam)(value, dependencies)}`); | ||
} | ||
if ((gas = ethers_1.BigNumber.from(gas)).gt(0) && dependencies.tracerEnv.gasCost) { | ||
extra.push(`gas: ${(0, param_1.formatParam)(gas, dependencies)}`); | ||
} | ||
const nameTag = (0, utils_2.getFromNameTags)(to, dependencies); | ||
@@ -67,6 +67,6 @@ return `${nameTag | ||
if (toBytecode.length > 2 && contractName) { | ||
return `${(0, colors_1.colorContract)(contractName)}.<${(0, colors_1.colorFunction)("UnknownFunction")}>(${(0, colors_1.colorKey)("input=")}${input}, ${(0, colors_1.colorKey)("ret=")}${ret})`; | ||
return `${(0, colors_1.colorContract)(contractName)}.<${(0, colors_1.colorFunction)("UnknownFunction")}>${extra.length !== 0 ? `{${extra.join(",")}}` : ""}(${(0, colors_1.colorKey)("input=")}${input}, ${(0, colors_1.colorKey)("ret=")}${ret})`; | ||
} | ||
else { | ||
return `${(0, colors_1.colorFunction)("UnknownContractAndFunction")}(${(0, colors_1.colorKey)("to=")}${to}, ${(0, colors_1.colorKey)("input=")}${input}, ${(0, colors_1.colorKey)("ret=")}${ret})`; | ||
return `${(0, colors_1.colorFunction)("UnknownContractAndFunction")}${extra.length !== 0 ? `{${extra.join(",")}}` : ""}(${(0, colors_1.colorKey)("to=")}${to}, ${(0, colors_1.colorKey)("input=")}${input}, ${(0, colors_1.colorKey)("ret=")}${ret})`; | ||
} | ||
@@ -73,0 +73,0 @@ } |
{ | ||
"name": "hardhat-tracer", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Hardhat Tracer plugin", | ||
@@ -5,0 +5,0 @@ "repository": "github:zemse/hardhat-tracer", |
@@ -1,5 +0,7 @@ | ||
# hardhat-tracer 🕵️ | ||
# hardhat-tracer 🕵️<!-- omit from toc --> | ||
Allows you to see events, calls and storage operations when running your tests. | ||
> NOTE: hardhat-tracer v2 is currently in beta. Please see [v2-beta](https://github.com/zemse/hardhat-tracer/tree/v2-beta) branch. | ||
- [Installation](#installation) | ||
@@ -43,5 +45,5 @@ - [Usage](#usage) | ||
```ts | ||
hre.tracer.enable = true; | ||
hre.tracer.enabled = true; | ||
await myContract.doStuff(val2); | ||
hre.tracer.enable = false; | ||
hre.tracer.enabled = false; | ||
``` | ||
@@ -48,0 +50,0 @@ |
@@ -59,2 +59,10 @@ import { BigNumber, BigNumberish, ethers } from "ethers"; | ||
const extra = []; | ||
if ((value = BigNumber.from(value)).gt(0)) { | ||
extra.push(`value: ${formatParam(value, dependencies)}`); | ||
} | ||
if ((gas = BigNumber.from(gas)).gt(0) && dependencies.tracerEnv.gasCost) { | ||
extra.push(`gas: ${formatParam(gas, dependencies)}`); | ||
} | ||
if (result && functionFragment) { | ||
@@ -76,9 +84,2 @@ const inputArgs = formatResult( | ||
const extra = []; | ||
if ((value = BigNumber.from(value)).gt(0)) { | ||
extra.push(`value: ${formatParam(value, dependencies)}`); | ||
} | ||
if ((gas = BigNumber.from(gas)).gt(0) && dependencies.tracerEnv.gasCost) { | ||
extra.push(`gas: ${formatParam(gas, dependencies)}`); | ||
} | ||
const nameTag = getFromNameTags(to, dependencies); | ||
@@ -103,5 +104,9 @@ return `${ | ||
"UnknownFunction" | ||
)}>(${colorKey("input=")}${input}, ${colorKey("ret=")}${ret})`; | ||
)}>${ | ||
extra.length !== 0 ? `{${extra.join(",")}}` : "" | ||
}(${colorKey("input=")}${input}, ${colorKey("ret=")}${ret})`; | ||
} else { | ||
return `${colorFunction("UnknownContractAndFunction")}(${colorKey( | ||
return `${colorFunction("UnknownContractAndFunction")}${ | ||
extra.length !== 0 ? `{${extra.join(",")}}` : "" | ||
}(${colorKey( | ||
"to=" | ||
@@ -108,0 +113,0 @@ )}${to}, ${colorKey("input=")}${input}, ${colorKey("ret=")}${ret})`; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
253742
4284
86