Skip to content

Commit

Permalink
api fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair-singh committed Aug 30, 2024
1 parent 49420df commit 9d656ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
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
4 changes: 4 additions & 0 deletions web/packages/test/config/launch-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ default_args = [
"archive",
]

[relaychain.properties]
tokenDecimals = 12
tokenSymbol = "WND"

[[relaychain.nodes]]
name = "westend01"
rpc_port = 30444
Expand Down

0 comments on commit 9d656ed

Please sign in to comment.