openzeppelin-gsn-helpers
openzeppelin-gsn-helpers copied to clipboard
Add GSN-specific assertions
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)
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');
};