Skip to content

Commit

Permalink
use trusted modifier in complete function (#459)
Browse files Browse the repository at this point in the history
  • Loading branch information
leric7 authored May 10, 2023
1 parent 73cbee6 commit ed5b9f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions packages/core/contracts/Escrow.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,7 @@ contract Escrow is IEscrow, ReentrancyGuard {
return true;
}

function complete() external override notExpired {
require(
areTrustedHandlers[msg.sender],
'Address calling is not trusted'
);
function complete() external override notExpired trusted {
require(status == EscrowStatuses.Paid, 'Escrow not in Paid state');
status = EscrowStatuses.Complete;
emit Completed();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/Escrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ describe('Escrow', function () {
it('Should revert with the right error if address calling is not trusted', async function () {
await expect(
escrow.connect(externalAddress).complete()
).to.be.revertedWith('Address calling is not trusted');
).to.be.revertedWith('Address calling not trusted');
});

it('Should revert with the right error if escrow not in Paid status state', async function () {
Expand Down

1 comment on commit ed5b9f4

@vercel
Copy link

@vercel vercel bot commented on ed5b9f4 May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

fortune-exchange-oracle-server – ./packages/examples/fortune/exchange-oracle/server

fortune-exchange-oracle-server-humanprotocol.vercel.app
fortune-exchange-oracle-server-git-develop-humanprotocol.vercel.app
fortune-exchange-oracle-server.vercel.app

Please sign in to comment.