You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2021. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 14, 2021. It is now read-only.
Unable to write tests for events when using Solidity Events #7
Such a contract will generate a javascript function that will appear as
SimpleAuction.HighestBidIncreased
But if you try to use the ABI when writing tests for ethjs, you will anger ESLint with the error:
A function with a name starting with an uppercase letter should only be used as a constructor ne
w-cap
The workaround is to write solidity contracts with events starting with a lower case character, which isn't ideal if there are linting constraints introduced in Solidity which force uppercase event names.
That feels like a bug in the linter. The linter shouldn't be complaining when a method with capital first letter is called, it should be complaining when such a method is declared. Otherwise the linter will complain about the output of third party libraries (like in this case).
It is the solidity linter, not EcmaScript linter. Though, Solidity did also just add disabling linting via comments as well, but I don't know the comment off-hand.
On Dec 12, 2017, at 7:18 PM, Micah Zoltu ***@***.***> wrote:
It is the solidity linter, not EcmaScript linter. Though, Solidity did also just add disabling linting via comments as well, but I don't know the comment off-hand.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
The convention when writing Solidity Smart Contracts is to capitalize events (http://solidity.readthedocs.io/en/develop/structure-of-a-contract.html#events) aka
Such a contract will generate a javascript function that will appear as
But if you try to use the ABI when writing tests for ethjs, you will anger ESLint with the error:
The workaround is to write solidity contracts with events starting with a lower case character, which isn't ideal if there are linting constraints introduced in Solidity which force uppercase event names.