Added tests for JSON format (#4248).

This commit is contained in:
Richard Moore 2023-07-24 17:45:27 -04:00
parent 8c2652c8cb
commit ba36079a28

View File

@ -151,9 +151,27 @@ describe("Test Interface", function() {
assert.equal(log.args[0], "0x8ba1f109551bD432803012645Ac136ddd64DBA72");
assert.equal(log.args[1], "0xAC1639CF97a3A46D431e6d1216f576622894cBB5");
assert.equal(log.args[2], BigInt(234));
});
// See #4248
it("formats JSON ABI parameters with default empty string for `name` key", function() {
assert.deepEqual(JSON.parse(iface.getFunction("balanceOf")!.format('json')), {
constant: false,
inputs: [
{ name: "owner", type: "address" }
],
name: "balanceOf",
outputs: [
{ name: "", type: "uint256" }
],
payable: false,
type: "function",
});
});
});
describe("Tests Legacy ABI formats", function() {
// See: #3932