Skip to content

Commit

Permalink
fix 'updateParameter' calls
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekdefi committed Jan 2, 2025
1 parent e1985c7 commit fcc93a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export async function createVault(
await vault.connect(coordinator).updateWeights([parse6decimal('0.8'), parse6decimal('0.2')])

await vault.connect(owner).updateParameter({
...(await vault.parameter()),
maxDeposit: maxCollateral ?? parse6decimal('500000'),
minDeposit: 0,
})
Expand Down
14 changes: 6 additions & 8 deletions packages/vault/test/integration/vault/Vault.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ describe('Vault', () => {
await vault.connect(coordinator).updateLeverage(1, leverage)
await vault.connect(coordinator).updateWeights([0.8e6, 0.2e6])
await vault.connect(owner).updateParameter({
...(await vault.parameter()),
maxDeposit: maxCollateral,
minDeposit: 0,
leverageBuffer: parse6decimal('1.2'),
})

await Promise.all([
Expand Down Expand Up @@ -1959,13 +1959,11 @@ describe('Vault', () => {
})

it('reverts when below minDeposit', async () => {
await vault
.connect(owner)
.updateParameter({
maxDeposit: maxCollateral,
minDeposit: parse6decimal('10'),
leverageBuffer: parse6decimal('1.2'),
})
await vault.connect(owner).updateParameter({
...(await vault.parameter()),
maxDeposit: maxCollateral,
minDeposit: parse6decimal('10'),
})
await expect(vault.connect(user).update(user.address, parse6decimal('0.50'), 0, 0)).to.revertedWithCustomError(
vault,
'VaultInsufficientMinimumError',
Expand Down

0 comments on commit fcc93a6

Please sign in to comment.