Skip to content

Commit 6af3cda

Browse files
api fixes
1 parent 3291185 commit 6af3cda

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

web/packages/api/src/toEthereum.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,10 @@ export const trackSendProgressPolling = async (
669669
let eventData = event.event.toPrimitive().data
670670
if (
671671
bridgeHub.events.ethereumOutboundQueue.MessageAccepted.is(event.event) &&
672-
eventData[0].toLowerCase() === success?.messageId?.toLowerCase()
672+
eventData[0].toLowerCase() === paraIdToChannelId(success.plan.success?.assetHub.paraId ?? 1000).toLowerCase() &&
673+
eventData[1].toLowerCase() === success?.messageId?.toLowerCase()
673674
) {
674-
success.bridgeHub.nonce = BigInt(eventData[1])
675+
success.bridgeHub.nonce = BigInt(eventData[2])
675676
success.bridgeHub.extrinsicSuccess = true
676677
success.bridgeHub.messageAcceptedAtHash = blockHash.toHex()
677678
return true
@@ -768,7 +769,7 @@ export const trackSendProgressPolling = async (
768769
if (
769770
messageID.toLowerCase() === success.messageId?.toLowerCase() &&
770771
nonce === success.bridgeHub.nonce &&
771-
channelID.toLowerCase() ==
772+
channelID.toLowerCase() ===
772773
paraIdToChannelId(success.plan.success?.assetHub.paraId ?? 1000).toLowerCase()
773774
) {
774775
success.ethereum.transferBlockNumber = blockNumber

web/packages/api/src/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const fetchBeaconSlot = async (
9494
url += `eth/v2/beacon/blocks/${blockId}`
9595
let response = await fetch(url)
9696
if (!response.ok) {
97-
throw new Error(response.statusText)
97+
throw new Error(`${blockId}: ${response.statusText}`)
9898
}
9999
return await response.json()
100100
}

web/packages/operations/src/transfer_token.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ const monitor = async () => {
5858

5959
console.log("# Deposit and Approve WETH")
6060
{
61+
const deposit = BigInt(Number(amount)*2);
6162
const weth9 = WETH9__factory.connect(WETH_CONTRACT, ETHEREUM_ACCOUNT)
62-
const depositResult = await weth9.deposit({ value: amount })
63+
const depositResult = await weth9.deposit({ value: deposit })
6364
const depositReceipt = await depositResult.wait()
6465

65-
const approveResult = await weth9.approve(config.GATEWAY_CONTRACT, amount)
66+
const approveResult = await weth9.approve(config.GATEWAY_CONTRACT, deposit)
6667
const approveReceipt = await approveResult.wait()
6768

6869
console.log('deposit tx', depositReceipt?.hash, 'approve tx', approveReceipt?.hash)

web/packages/test/config/launch-config.toml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ default_args = [
1414
"archive",
1515
]
1616

17+
[relaychain.properties]
18+
tokenDecimals = 12
19+
tokenSymbol = "WND"
20+
1721
[[relaychain.nodes]]
1822
name = "westend01"
1923
rpc_port = 30444

0 commit comments

Comments
 (0)