Hey @abcoathup
Is there a working example of using truffle tests to test a GSN recipient contract. I am currently trying to modify my tests, but cant figure out a way to update web3 to use GSN web3 provider.
Thanks again!
1 Like
Hi @meh_blah ,
I recommend having a look at the OpenZeppelin Contracts tests themselves on how to do this. For example GSNRecipientERC20Fee.test.js
:
const { ether, expectEvent } = require('@openzeppelin/test-helpers');
const gsn = require('@openzeppelin/gsn-helpers');
const { expect } = require('chai');
const GSNRecipientERC20FeeMock = artifacts.require('GSNRecipientERC20FeeMock');
const ERC20Detailed = artifacts.require('ERC20Detailed');
const IRelayHub = artifacts.require('IRelayHub');
contract('GSNRecipientERC20Fee', function ([_, sender, other]) {
const name = 'FeeToken';
const symbol = 'FTKN';
beforeEach(async function () {
this.recipient = await GSNRecipientERC20FeeMock.new(name, symbol);
this.token = await ERC20Detailed.at(await this.recipient.token());
});
describe('token', function () {
it('has a name', async function () {
This file has been truncated. show original
Thanks, @abcoathup ! That was exactly what I was looking for.
1 Like
martriay
Split this topic
July 8, 2020, 7:58pm
4