Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
meetmangukiya committed May 25, 2024
1 parent 34afe51 commit 3efb119
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/COWShed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { LibBitmap } from "solady/utils/LibBitmap.sol";

contract COWShed is ICOWAuthHook, COWShedStorage {
error InvalidSignature();
error NonceAlreadyUsed();
error OnlyTrustedExecutor();
error OnlySelf();
error AlreadyInitialized();
Expand Down
3 changes: 3 additions & 0 deletions src/COWShedStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ interface IAdminView {
contract COWShedStorage {
using LibBitmap for LibBitmap.Bitmap;

error NonceAlreadyUsed();

struct State {
bool initialized;
address trustedExecutor;
Expand All @@ -33,6 +35,7 @@ contract COWShedStorage {
}

function _useNonce(bytes32 _nonce) internal {
if (_isNonceUsed(_nonce)) revert NonceAlreadyUsed();
_state().nonces.set(uint256(_nonce));
}

Expand Down
4 changes: 2 additions & 2 deletions test/COWShed.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.25;

import { COWShed, Call } from "src/COWShed.sol";
import { COWShedStorage, COWShed, Call } from "src/COWShed.sol";
import { Test, Vm } from "forge-std/Test.sol";
import { COWShedFactory, COWShedProxy } from "src/COWShedFactory.sol";
import { BaseTest } from "./BaseTest.sol";
Expand Down Expand Up @@ -121,7 +121,7 @@ contract COWShedTest is BaseTest {
userProxy.revokeNonce(nonce);
assertTrue(userProxy.nonces(nonce), "nonce is not used yet");

vm.expectRevert(COWShed.NonceAlreadyUsed.selector);
vm.expectRevert(COWShedStorage.NonceAlreadyUsed.selector);
userProxy.executeHooks(calls, nonce, _deadline(), signature);
}

Expand Down

0 comments on commit 3efb119

Please sign in to comment.