Skip to content

Commit

Permalink
Added tests for JSON format (#4248).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Jul 24, 2023
1 parent 8c2652c commit ba36079
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src.ts/_tests/test-abi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba36079

Please sign in to comment.