Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errant console.log call #2714

Closed
cte opened this issue Feb 19, 2022 · 2 comments
Closed

Errant console.log call #2714

cte opened this issue Feb 19, 2022 · 2 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@cte
Copy link

cte commented Feb 19, 2022

Describe the bug
A console.log was left in a common code path for contract interaction:
https://github.com/ethers-io/ethers.js/blob/v5.5.4/packages/abi/src.ts/interface.ts#L418

Would it be more appropriate to use an internal logger? I'm not sure why anything needs to be logged given that the error is already being propagated.

Reproduction steps
Here's an example of what is logged to my shell when I'm attempting to discover which interfaces a particular contract implements via ERC165 (i.e. contract.supportsInterface(...)):

Error: no matching error (argument="sighash", value="0x734e6e1c", code=INVALID_ARGUMENT, version=abi/5.5.0)
    at Logger.makeError (/node_modules/@ethersproject/logger/src.ts/index.ts:225:28)
    at Logger.throwError (/node_modules/@ethersproject/logger/src.ts/index.ts:237:20)
    at Logger.throwArgumentError (/node_modules/@ethersproject/logger/src.ts/index.ts:241:21)
    at Interface.getError (/node_modules/@ethersproject/abi/src.ts/interface.ts:269:20)
    at Interface.decodeFunctionResult (/node_modules/@ethersproject/abi/src.ts/interface.ts:413:44)
    at Contract.<anonymous> (/node_modules/@ethersproject/contracts/src.ts/index.ts:392:44)
    at step (/node_modules/@ethersproject/contracts/lib/index.js:48:23)
    at Object.next (/node_modules/@ethersproject/contracts/lib/index.js:29:53)
    at fulfilled (/node_modules/@ethersproject/contracts/lib/index.js:20:58)
    at runMicrotasks (<anonymous>) {
  reason: 'no matching error',
  code: 'INVALID_ARGUMENT',
  argument: 'sighash',
  value: '0x734e6e1c'

Environment:
RPC calls are running exclusively against Geth.

Search Terms

  • console.log
  • output
@cte cte added the investigate Under investigation and may be a bug. label Feb 19, 2022
@ricmoo
Copy link
Member

ricmoo commented Feb 19, 2022

Yes, that should definitely be removed. I'm working on the next minor bump now and will add it for inclusion in that.

Thanks! :)

@ricmoo ricmoo added minor-bump Planned for the next minor version bump. on-deck This Enhancement or Bug is currently being worked on. and removed investigate Under investigation and may be a bug. labels Feb 19, 2022
@ricmoo
Copy link
Member

ricmoo commented Mar 10, 2022

Fixed in v5.6.

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants