Skip to content

Commit 998a48f

Browse files
committed
chore: increase gas for Gnosis bridge hook to 150k
1 parent 5428aec commit 998a48f

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cowprotocol/cow-sdk",
3-
"version": "6.3.1",
3+
"version": "6.3.2-RC.0",
44
"license": "(MIT OR Apache-2.0)",
55
"files": [
66
"/dist"

src/bridging/BridgingSdk/getCrossChainOrder.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@ interface GetCrossChainOrderParams {
2020
export async function getCrossChainOrder(params: GetCrossChainOrderParams): Promise<CrossChainOrder | null> {
2121
const { chainId, orderId, orderBookApi, providers, env } = params
2222

23+
console.log('SDK getCrossChainOrder params ==>', params)
24+
2325
const chainContext = { chainId, env }
2426
const order = await orderBookApi.getOrder(orderId, chainContext)
2527

28+
console.log('SDKgetCrossChainOrder order ==>', order)
29+
2630
// Find the provider by name (note that I could just have use this.provider, but just wanted to leave it ready in case we implement multiple providers)
2731
const provider = order.fullAppData && findBridgeProviderFromHook(order.fullAppData, providers)
2832
if (!provider) {
@@ -37,6 +41,8 @@ export async function getCrossChainOrder(params: GetCrossChainOrderParams): Prom
3741
// Check if there are any trades for this order
3842
const trades = await orderBookApi.getTrades({ orderUid: order.uid }, chainContext)
3943

44+
console.log('SDK getCrossChainOrder trades ==>', trades)
45+
4046
if (trades.length > 0) {
4147
// Bridging already initiated
4248
const firstTrade = trades[0]
@@ -52,7 +58,11 @@ export async function getCrossChainOrder(params: GetCrossChainOrderParams): Prom
5258
const { params: bridgingParams, status: statusResult } =
5359
(await provider.getBridgingParams(chainId, orderId, tradeTxHash)) || {}
5460

61+
console.log('SDK getCrossChainOrder bridgingParams ==>', bridgingParams)
62+
console.log('SDK getCrossChainOrder statusResult ==>', statusResult)
63+
5564
if (!bridgingParams || !statusResult) {
65+
console.log('SDK getCrossChainOrder bridgingParams || !statusResult ==>', bridgingParams || !statusResult)
5666
throw new BridgeOrderParsingError(`Bridging params cannot be derived from transaction: ${tradeTxHash}`)
5767
}
5868

@@ -70,13 +80,15 @@ export async function getCrossChainOrder(params: GetCrossChainOrderParams): Prom
7080
try {
7181
const explorerUrl = provider.getExplorerUrl(bridgingParams.bridgingId)
7282

83+
console.log('SDK getCrossChainOrder explorerUrl ==>', explorerUrl)
84+
7385
return {
7486
...state,
7587
statusResult,
7688
explorerUrl,
7789
}
7890
} catch (e) {
79-
console.error('Cannot get bridging status', e)
91+
console.error('SDK getCrossChainOrder Cannot get bridging status', e)
8092
return state
8193
}
8294
}

src/bridging/const.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { RAW_FILES_PATH } from '../common/consts/path'
33
export const RAW_PROVIDERS_FILES_PATH = `${RAW_FILES_PATH}/src/bridging/providers`
44
// Based on https://dashboard.tenderly.co/shoom/project/simulator/a5e29dac-d0f2-407f-9e3d-d1b916da595b
55
export const DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION = 240_000
6-
export const DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION = 100_000
6+
export const DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION = 150_000
77
// Based on https://dashboard.tenderly.co/shoom/project/tx/0x2971aee9aa7237d24b254da8ccd4345ff77410c8829c8e825e9a02cb2cece5e6/gas-usage
88
export const COW_SHED_PROXY_CREATION_GAS = 360_000
99
export const HOOK_DAPP_BRIDGE_PROVIDER_PREFIX = 'cow-sdk://bridging/providers'

src/bridging/providers/bungee/BungeeApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ export class BungeeApi {
338338
params,
339339
isValidBungeeEventsResponse,
340340
)
341+
console.log('SDK getEvents response ==>', response)
341342
if (!response.success) {
342343
throw new BridgeProviderError('Bungee Events Api Error', response)
343344
}

src/bridging/providers/bungee/BungeeBridgeProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,11 @@ export class BungeeBridgeProvider implements BridgeProvider<BungeeQuoteResult> {
203203
orderId: string,
204204
_txHash: string,
205205
): Promise<{ params: BridgingDepositParams; status: BridgeStatusResult } | null> {
206+
console.log('SDK getBridgingParams orderId ==>', orderId)
207+
console.log('SDK getBridgingParams txHash ==>', _txHash)
206208
const events = await this.api.getEvents({ orderId })
207-
const event = events[0]
209+
console.log('SDK getBridgingParams events ==>', events)
210+
const event = events?.[0]
208211

209212
if (!event) return null
210213

src/bridging/providers/bungee/getBridgingStatusFromEvents.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ export async function getBridgingStatusFromEvents(
1919
return { status: BridgeStatus.IN_PROGRESS }
2020
}
2121

22+
console.log('SDK getBridgingStatusFromEvents event ==>', event)
2223
// if srcTxStatus = completed & destTxStatus = pending,
2324
if (event.srcTxStatus === BungeeEventStatus.COMPLETED && event.destTxStatus === BungeeEventStatus.PENDING) {
25+
console.log('SDK getBridgingStatusFromEvents event.COMPLETED ==>', event.bridgeName)
26+
2427
// if bridgeName = across,
2528
if (event.bridgeName === BungeeBridgeName.ACROSS) {
2629
try {
@@ -37,12 +40,16 @@ export async function getBridgingStatusFromEvents(
3740
console.error('BungeeBridgeProvider get across status error', e)
3841
}
3942
}
43+
44+
console.log('SDK getBridgingStatusFromEvents is not across ==>', event.bridgeName)
4045
// if not across or across API fails, waiting for dest tx, return in_progress
4146
return { status: BridgeStatus.IN_PROGRESS, depositTxHash: event.srcTransactionHash }
4247
}
4348

4449
// if srcTxStatus = completed & destTxStatus = completed, return executed
4550
if (event.srcTxStatus === BungeeEventStatus.COMPLETED && event.destTxStatus === BungeeEventStatus.COMPLETED) {
51+
console.log('SDK getBridgingStatusFromEvents is completed ==>', event.bridgeName)
52+
4653
return {
4754
status: BridgeStatus.EXECUTED,
4855
depositTxHash: event.srcTransactionHash,

0 commit comments

Comments
 (0)