@gearbox-protocol/sdk 14.12.0-next.46 → 14.12.0-next.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -197,7 +197,7 @@ async function fulfillMidasWithdrawal(anvil, creditAccount, withdrawalPhantomTok
197
197
  address: MIDAS_VAULT_ADMIN,
198
198
  value: (0, import_viem.parseEther)("100")
199
199
  });
200
- await anvil.writeContract({
200
+ const hash = await anvil.writeContract({
201
201
  chain: anvil.chain,
202
202
  address: midasRedemptionVault,
203
203
  account: MIDAS_VAULT_ADMIN,
@@ -205,6 +205,13 @@ async function fulfillMidasWithdrawal(anvil, creditAccount, withdrawalPhantomTok
205
205
  functionName: "safeApproveRequest",
206
206
  args: [requestId, mTokenRate]
207
207
  });
208
+ const receipt = await anvil.waitForTransactionReceipt({
209
+ hash,
210
+ pollingInterval: 100
211
+ });
212
+ if (receipt.status !== "success") {
213
+ throw new Error(`midas: safeApproveRequest tx ${hash} reverted`);
214
+ }
208
215
  await anvil.stopImpersonatingAccount({ address: MIDAS_VAULT_ADMIN });
209
216
  }
210
217
  }
@@ -186,7 +186,7 @@ async function fulfillMidasWithdrawal(anvil, creditAccount, withdrawalPhantomTok
186
186
  address: MIDAS_VAULT_ADMIN,
187
187
  value: parseEther("100")
188
188
  });
189
- await anvil.writeContract({
189
+ const hash = await anvil.writeContract({
190
190
  chain: anvil.chain,
191
191
  address: midasRedemptionVault,
192
192
  account: MIDAS_VAULT_ADMIN,
@@ -194,6 +194,13 @@ async function fulfillMidasWithdrawal(anvil, creditAccount, withdrawalPhantomTok
194
194
  functionName: "safeApproveRequest",
195
195
  args: [requestId, mTokenRate]
196
196
  });
197
+ const receipt = await anvil.waitForTransactionReceipt({
198
+ hash,
199
+ pollingInterval: 100
200
+ });
201
+ if (receipt.status !== "success") {
202
+ throw new Error(`midas: safeApproveRequest tx ${hash} reverted`);
203
+ }
197
204
  await anvil.stopImpersonatingAccount({ address: MIDAS_VAULT_ADMIN });
198
205
  }
199
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "14.12.0-next.46",
3
+ "version": "14.12.0-next.47",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {