Rename GSNRecipients to Bouncers

pull/1844/head
Nicolás Venturo 6 years ago committed by Santiago Palladino
parent 108c998faa
commit 5c0e49bb29
  1. 20
      contracts/gsn/bouncers/GSNBouncerERC20Fee.sol
  2. 6
      contracts/gsn/bouncers/GSNBouncerSignature.sol
  3. 6
      contracts/mocks/GSNBouncerSignatureMock.sol
  4. 8
      test/gsn/GSNBouncerSignature.test.js

@ -1,13 +1,13 @@
pragma solidity ^0.5.0;
import "./GSNRecipient.sol";
import "../math/SafeMath.sol";
import "../ownership/Secondary.sol";
import "../token/ERC20/SafeERC20.sol";
import "../token/ERC20/ERC20.sol";
import "../token/ERC20/ERC20Detailed.sol";
contract GSNRecipientERC20Charge is GSNRecipient {
import "../GSNRecipient.sol";
import "../../math/SafeMath.sol";
import "../../ownership/Secondary.sol";
import "../../token/ERC20/SafeERC20.sol";
import "../../token/ERC20/ERC20.sol";
import "../../token/ERC20/ERC20Detailed.sol";
contract GSNBouncerERC20Fee is GSNRecipient {
using SafeERC20 for __unstable__ERC20PrimaryAdmin;
using SafeMath for uint256;
@ -72,7 +72,7 @@ contract GSNRecipientERC20Charge is GSNRecipient {
/**
* @title __unstable__ERC20PrimaryAdmin
* @dev An ERC20 token owned by another contract, which has minting permissions and can use transferFrom to receive
* anyone's tokens. This contract is an internal helper for GSNRecipientERC20Charge, and should not be used
* anyone's tokens. This contract is an internal helper for GSNRecipientERC20Fee, and should not be used
* outside of this context.
*/
// solhint-disable-next-line contract-name-camelcase
@ -83,7 +83,7 @@ contract __unstable__ERC20PrimaryAdmin is ERC20, ERC20Detailed, Secondary {
// solhint-disable-previous-line no-empty-blocks
}
// The primary account (GSNRecipientERC20Charge) can mint tokens
// The primary account (GSNRecipientERC20Fee) can mint tokens
function mint(address account, uint256 amount) public onlyPrimary {
_mint(account, amount);
}

@ -1,9 +1,9 @@
pragma solidity ^0.5.0;
import "./GSNRecipient.sol";
import "../cryptography/ECDSA.sol";
import "../GSNRecipient.sol";
import "../../cryptography/ECDSA.sol";
contract GSNRecipientSignedData is GSNRecipient {
contract GSNBouncerSignature is GSNRecipient {
using ECDSA for bytes32;
address private _trustedSigner;

@ -1,9 +1,9 @@
pragma solidity ^0.5.0;
import "../gsn/GSNRecipientSignedData.sol";
import "../gsn/bouncers/GSNBouncerSignature.sol";
contract GSNRecipientSignedDataMock is GSNRecipientSignedData {
constructor(address trustedSigner) public GSNRecipientSignedData(trustedSigner) {
contract GSNBouncerSignatureMock is GSNBouncerSignature {
constructor(address trustedSigner) public GSNBouncerSignature(trustedSigner) {
// solhint-disable-previous-line no-empty-blocks
}

@ -2,11 +2,11 @@ const { expectEvent } = require('openzeppelin-test-helpers');
const gsn = require('@openzeppelin/gsn-helpers');
const { fixSignature } = require('../helpers/sign');
const GSNRecipientSignedDataMock = artifacts.require('GSNRecipientSignedDataMock');
const GSNBouncerSignatureMock = artifacts.require('GSNBouncerSignatureMock');
contract('GSNRecipientSignedData', function ([_, deployer, signer, other]) {
contract('GSNBouncerSignature', function ([_, deployer, signer, other]) {
beforeEach(async function () {
this.recipient = await GSNRecipientSignedDataMock.new(signer);
this.recipient = await GSNBouncerSignatureMock.new(signer);
});
context('when called directly', function () {
@ -52,7 +52,7 @@ contract('GSNRecipientSignedData', function ([_, deployer, signer, other]) {
const { tx } = await this.recipient.mockFunction({ value: 0, useGSN: true, approveFunction });
await expectEvent.inTransaction(tx, GSNRecipientSignedDataMock, 'MockFunctionCalled');
await expectEvent.inTransaction(tx, GSNBouncerSignatureMock, 'MockFunctionCalled');
});
});
});
Loading…
Cancel
Save