Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API fixes #1278

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions web/packages/api/src/toEthereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,10 @@ export const trackSendProgressPolling = async (
let eventData = event.event.toPrimitive().data
if (
bridgeHub.events.ethereumOutboundQueue.MessageAccepted.is(event.event) &&
eventData[0].toLowerCase() === success?.messageId?.toLowerCase()
eventData[0].toLowerCase() === paraIdToChannelId(success.plan.success?.assetHub.paraId ?? 1000).toLowerCase() &&
eventData[1].toLowerCase() === success?.messageId?.toLowerCase()
) {
success.bridgeHub.nonce = BigInt(eventData[1])
success.bridgeHub.nonce = BigInt(eventData[2])
success.bridgeHub.extrinsicSuccess = true
success.bridgeHub.messageAcceptedAtHash = blockHash.toHex()
return true
Expand Down Expand Up @@ -768,7 +769,7 @@ export const trackSendProgressPolling = async (
if (
messageID.toLowerCase() === success.messageId?.toLowerCase() &&
nonce === success.bridgeHub.nonce &&
channelID.toLowerCase() ==
channelID.toLowerCase() ===
paraIdToChannelId(success.plan.success?.assetHub.paraId ?? 1000).toLowerCase()
) {
success.ethereum.transferBlockNumber = blockNumber
Expand Down
2 changes: 1 addition & 1 deletion web/packages/api/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const fetchBeaconSlot = async (
url += `eth/v2/beacon/blocks/${blockId}`
let response = await fetch(url)
if (!response.ok) {
throw new Error(response.statusText)
throw new Error(`${blockId}: ${response.statusText}`)
}
return await response.json()
}
Expand Down
5 changes: 3 additions & 2 deletions web/packages/operations/src/transfer_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ const monitor = async () => {

console.log("# Deposit and Approve WETH")
{
const deposit = BigInt(Number(amount)*2);
const weth9 = WETH9__factory.connect(WETH_CONTRACT, ETHEREUM_ACCOUNT)
const depositResult = await weth9.deposit({ value: amount })
const depositResult = await weth9.deposit({ value: deposit })
const depositReceipt = await depositResult.wait()

const approveResult = await weth9.approve(config.GATEWAY_CONTRACT, amount)
const approveResult = await weth9.approve(config.GATEWAY_CONTRACT, deposit)
const approveReceipt = await approveResult.wait()

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