Update docs
This commit is contained in:
@ -12,6 +12,8 @@ const ContextMockCaller = artifacts.require('ContextMockCaller');
|
||||
const { shouldBehaveLikeRegularContext } = require('../utils/Context.behavior');
|
||||
|
||||
contract('ERC2771Context', function (accounts) {
|
||||
const [, anotherAccount] = accounts;
|
||||
|
||||
beforeEach(async function () {
|
||||
this.forwarder = await MinimalForwarder.new();
|
||||
this.recipient = await ERC2771ContextMock.new(this.forwarder.address);
|
||||
@ -73,6 +75,15 @@ contract('ERC2771Context', function (accounts) {
|
||||
const { tx } = await this.forwarder.execute(req, sign);
|
||||
await expectEvent.inTransaction(tx, ERC2771ContextMock, 'Sender', { sender: this.sender });
|
||||
});
|
||||
|
||||
it('returns the original sender when calldata length is less than 20 bytes (address length)', async function () {
|
||||
// The forwarder doesn't produce calls with calldata length less than 20 bytes
|
||||
const recipient = await ERC2771ContextMock.new(anotherAccount);
|
||||
|
||||
const { receipt } = await recipient.msgSender({ from: anotherAccount });
|
||||
|
||||
await expectEvent(receipt, 'Sender', { sender: anotherAccount });
|
||||
});
|
||||
});
|
||||
|
||||
describe('msgData', function () {
|
||||
|
||||
Reference in New Issue
Block a user