Skip to content
This repository was archived by the owner on Jan 10, 2019. It is now read-only.
This repository was archived by the owner on Jan 10, 2019. It is now read-only.

assertRevert does not throw an assertion error on true #330

@geoknee

Description

@geoknee

Making the following modification to /test/rock-paper-scissors.js:

  it("disallows transitions where the stake changes", async () => {
    reveal.roundBuyIn = bnToHex(hexToBN(reveal.roundBuyIn).add(new BN(1)));
    // assertRevert(validTransition(reveal, resting));
    assertRevert(true);
  });

I would expect the test not to be passed. The fact that it doe pass, indicates that assertRevert is not trustworthy, since if we made a mistake in coding validTransition, such that it failed to revert on a disallowed move, our tests for this scenario would still pass.

fmg-core has an improved helper called expectRevert.

So this could be an easy fix!

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