openzeppelin-gsn-helpers icon indicating copy to clipboard operation
openzeppelin-gsn-helpers copied to clipboard

Add GSN-specific assertions

Open spalladino opened this issue 6 years ago • 1 comments

Add assertion matchers for:

  • Checking that a tx indeed went through the GSN
  • Checking that sending a tx via the GSN failed due to no relayers being available (or any other errors that do not trigger a revert, since they never get to actually sending a tx)

spalladino avatar Aug 01 '19 16:08 spalladino

We should probably limit ourselves to an MVP until:

a) we have more clearly defined the type of errors that may occur when interacting with the GSN b) we have stabilized the error messaged, switched to custom error objects, or can somehow identify these

The initial version could be as simple as:

const expectGSNError = async function (promise) {
  try {
    await promise;
  } catch (error) {
    return;
  }

  expect.fail('Expected a GSN exception but none was received');
};

nventuro avatar Aug 01 '19 19:08 nventuro