GSN renaming (#1963)

* Merge GSNBouncerBase into GSNRecipient

* Remove emtpy implementations for _pre and _post

* Rename bouncers to recipients

* Rename bouncers documentation to strategies

* Rewrite guides and docstrings to use the strategy naming scheme

* Address review comments

* Apply suggestions from code review

Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>

* change wording of docs
This commit is contained in:
Nicolás Venturo
2019-10-25 13:36:56 -03:00
committed by GitHub
parent 9e19d90cd9
commit aae95db4e0
13 changed files with 195 additions and 183 deletions

View File

@ -3,16 +3,16 @@ const gsn = require('@openzeppelin/gsn-helpers');
const { expect } = require('chai');
const GSNBouncerERC20FeeMock = artifacts.require('GSNBouncerERC20FeeMock');
const GSNRecipientERC20FeeMock = artifacts.require('GSNRecipientERC20FeeMock');
const ERC20Detailed = artifacts.require('ERC20Detailed');
const IRelayHub = artifacts.require('IRelayHub');
contract('GSNBouncerERC20Fee', function ([_, sender, other]) {
contract('GSNRecipientERC20Fee', function ([_, sender, other]) {
const name = 'FeeToken';
const symbol = 'FTKN';
beforeEach(async function () {
this.recipient = await GSNBouncerERC20FeeMock.new(name, symbol);
this.recipient = await GSNRecipientERC20FeeMock.new(name, symbol);
this.token = await ERC20Detailed.at(await this.recipient.token());
});

View File

@ -4,11 +4,11 @@ const { fixSignature } = require('../helpers/sign');
const { utils: { toBN } } = require('web3');
const { ZERO_ADDRESS } = constants;
const GSNBouncerSignatureMock = artifacts.require('GSNBouncerSignatureMock');
const GSNRecipientSignatureMock = artifacts.require('GSNRecipientSignatureMock');
contract('GSNBouncerSignature', function ([_, signer, other]) {
contract('GSNRecipientSignature', function ([_, signer, other]) {
beforeEach(async function () {
this.recipient = await GSNBouncerSignatureMock.new(signer);
this.recipient = await GSNRecipientSignatureMock.new(signer);
});
context('when called directly', function () {
@ -21,10 +21,10 @@ contract('GSNBouncerSignature', function ([_, signer, other]) {
context('when constructor is called with a zero address', function () {
it('fails when constructor called with a zero address', async function () {
await expectRevert(
GSNBouncerSignatureMock.new(
GSNRecipientSignatureMock.new(
ZERO_ADDRESS
),
'GSNBouncerSignature: trusted signer is the zero address'
'GSNRecipientSignature: trusted signer is the zero address'
);
});
});
@ -66,7 +66,7 @@ contract('GSNBouncerSignature', function ([_, signer, other]) {
const { tx } = await this.recipient.mockFunction({ value: 0, useGSN: true, approveFunction });
await expectEvent.inTransaction(tx, GSNBouncerSignatureMock, 'MockFunctionCalled');
await expectEvent.inTransaction(tx, GSNRecipientSignatureMock, 'MockFunctionCalled');
});
it('rejects relay requests where all parameters are signed by an invalid signer', async function () {