Skip to content

Commit

Permalink
Address CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Oct 14, 2024
1 parent 1adfcbb commit 8693f3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion contracts/contracts/vault/VaultStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ contract VaultStorage is Initializable, Governable {
/// @notice Mapping of withdrawal request indices to the user withdrawal request data
mapping(uint256 => WithdrawalRequest) public withdrawalRequests;

/// @notice Used for OETH & superOETHb async withdrawal
/// @notice Sets a minimum delay that is required to elapse between
/// requesting async withdrawals and claiming the request.
/// When set to 0 async withdrawals are disabled.
// slither-disable-start constable-states
// slither-disable-next-line uninitialized-state
uint256 public withdrawalClaimDelay;
Expand Down
16 changes: 10 additions & 6 deletions contracts/test/vault/oethb-vault.base.fork-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,15 @@ describe("ForkTest: OETHb Vault", function () {

describe("Async withdrawals", function () {
it("Should allow 1:1 async withdrawals", async () => {
const { rafael, oethbVault } = fixture;
const { rafael, governor, oethbVault } = fixture;

const delayPeriod = await oethbVault.withdrawalClaimDelay();

if (delayPeriod == 0) {
// Skip when disabled
return;
// Temporarily set to 10m if disabled
await oethbVault.connect(governor).setWithdrawalClaimDelay(
10 * 60 // 10 mins
);
}

const { nextWithdrawalIndex: requestId } =
Expand All @@ -138,13 +140,15 @@ describe("ForkTest: OETHb Vault", function () {
});

it("Should not allow withdraw before claim delay", async () => {
const { rafael, oethbVault } = fixture;
const { rafael, governor, oethbVault } = fixture;

const delayPeriod = await oethbVault.withdrawalClaimDelay();

if (delayPeriod == 0) {
// Skip when disabled
return;
// Temporarily set to 10m if disabled
await oethbVault.connect(governor).setWithdrawalClaimDelay(
10 * 60 // 10 mins
);
}

const { nextWithdrawalIndex: requestId } =
Expand Down

0 comments on commit 8693f3b

Please sign in to comment.