From 27d5fdba6c969e2bd0b8838ff421ff68cecf207c Mon Sep 17 00:00:00 2001 From: Peter Michael Date: Mon, 26 Sep 2022 13:20:27 -0400 Subject: [PATCH] test: Added executor mirror with sig test. --- .../foundry/interactions/PublishingTest.t.sol | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/test/foundry/interactions/PublishingTest.t.sol b/test/foundry/interactions/PublishingTest.t.sol index 81a3b86..2dd7cb1 100644 --- a/test/foundry/interactions/PublishingTest.t.sol +++ b/test/foundry/interactions/PublishingTest.t.sol @@ -224,7 +224,39 @@ contract PublishingTest is BaseTest { sig: _getSigStruct(otherSignerKey, digest, deadline) }) ); + assertEq(pubId, 2); + } + function testExecutorMirrorWithSig() public { + vm.startPrank(profileOwner); + hub.setDelegatedExecutorApproval(otherSigner, true); + hub.post(mockPostData); + vm.stopPrank(); + + uint256 nonce = 0; + uint256 deadline = type(uint256).max; + bytes32 digest = _getMirrorTypedDataHash( + firstProfileId, + firstProfileId, + 1, + '', + address(0), + '', + nonce, + deadline + ); + + uint256 pubId = hub.mirrorWithSig( + DataTypes.MirrorWithSigData({ + profileId: firstProfileId, + profileIdPointed: firstProfileId, + pubIdPointed: 1, + referenceModuleData: '', + referenceModule: address(0), + referenceModuleInitData: '', + sig: _getSigStruct(otherSignerKey, digest, deadline) + }) + ); assertEq(pubId, 2); } }