Skip to content

Commit 9bbfd06

Browse files
committed
Exclude the gas field from the generated ABI
1 parent 545846e commit 9bbfd06

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

packages/target-ethers-v5/test/generation.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,35 @@ describe('Ethers generation edge cases', () => {
3737
expect(source).toEqual(expect.stringMatching(/export class TestContract__factory extends ContractFactory \{/))
3838
expect(source).toEqual(expect.stringMatching(/static linkBytecode\(/))
3939
})
40+
41+
it('should exclude gas field from ABI', () => {
42+
const abi = [
43+
{
44+
stateMutability: 'view',
45+
type: 'function',
46+
name: 'foo',
47+
inputs: [
48+
{
49+
name: 'bar',
50+
type: 'address',
51+
},
52+
],
53+
outputs: [
54+
{
55+
name: '',
56+
type: 'uint256',
57+
},
58+
],
59+
gas: 3135,
60+
},
61+
]
62+
63+
const source = codegenContractFactory(DEFAULT_FLAGS, emptyContract, abi, {
64+
bytecode: '{{BYTECODE}}',
65+
})
66+
67+
expect(source).not.toEqual(expect.stringMatching(/"gas":/))
68+
})
4069
})
4170

4271
describe(generateEventFilters.name, () => {

0 commit comments

Comments
 (0)