Skip to content
This repository was archived by the owner on Dec 14, 2021. It is now read-only.
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

Description

@pointtoken

The convention when writing Solidity Smart Contracts is to capitalize events (http://solidity.readthedocs.io/en/develop/structure-of-a-contract.html#events) aka

contract SimpleAuction {
    event HighestBidIncreased(address bidder, uint amount); // Event

    function bid() payable {
        // ...
        HighestBidIncreased(msg.sender, msg.value); // Triggering event
    }
}

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions