Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc committed Jul 10, 2024
1 parent e4db674 commit 1244894
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 221 deletions.
2 changes: 1 addition & 1 deletion packages/arb-token-bridge-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"private": true,
"dependencies": {
"@apollo/client": "^3.7.11",
"@arbitrum/sdk": "^4.0.0-alpha.8",
"@arbitrum/sdk": "^4.0.0-alpha.9",
"@ethersproject/providers": "^5.7.0",
"@headlessui/react": "^1.7.8",
"@headlessui/tailwindcss": "^0.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,10 @@ export async function getUpdatedEthDeposit(
status: isDeposited
? ParentToChildMessageStatus.FUNDS_DEPOSITED_ON_CHILD
: ParentToChildMessageStatus.NOT_YET_CREATED,
retryableCreationTxID: (l1ToL2Msg as EthDepositMessage)
.childDepositTxHash,
retryableCreationTxID: (l1ToL2Msg as EthDepositMessage).childTxHash,
// Only show `l2TxID` after the deposit is confirmed
l2TxID: isDeposited
? (l1ToL2Msg as EthDepositMessage).childDepositTxHash
? (l1ToL2Msg as EthDepositMessage).childTxHash
: undefined
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function useRedeemRetryable(
await updatePendingTransaction({
...tx,
l1ToL2MsgData: {
l2TxID: successfulRedeem.txReceipt.transactionHash,
l2TxID: successfulRedeem.childTxReceipt.transactionHash,
status,
retryableCreationTxID: retryableTicket.retryableCreationId,
fetchingUpdate: false
Expand Down
13 changes: 8 additions & 5 deletions packages/arb-token-bridge-ui/src/hooks/useRedeemTeleporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@ const redeemRetryable = async (retryable: ParentToChildMessageWriter) => {
)
}

const redeemReceipt = (await retryable.getSuccessfulRedeem()) as unknown as {
status: ParentToChildMessageStatus.REDEEMED
txReceipt: TransactionReceipt
const successfulRedeem = await retryable.getSuccessfulRedeem()

if (successfulRedeem.status !== ParentToChildMessageStatus.REDEEMED) {
throw new Error(
`Unexpected status for retryable ticket (creation id ${retryable.retryableCreationId}), expected ${ParentToChildMessageStatus.REDEEMED} but got ${successfulRedeem.status}`
)
}

return redeemReceipt
return successfulRedeem
}

// this will try to redeem - 1. L1L2Retryable 2. L2ForwarderRetryable
Expand Down Expand Up @@ -132,7 +135,7 @@ const redeemTeleporterSecondLeg = async ({
// update the teleport tx in the UI
const l2ToL3MsgData: L2ToL3MessageData = {
...tx.l2ToL3MsgData,
l3TxID: redemptionReceipt.txReceipt.transactionHash,
l3TxID: redemptionReceipt.childTxReceipt.transactionHash,
status: ParentToChildMessageStatus.REDEEMED,
retryableCreationTxID: l2L3Retryable.retryableCreationId
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class Erc20DepositStarter extends BridgeTransferStarter {
const address = await getAddressFromSigner(signer)

const erc20Bridger = await this.getBridger()
const l2Network = erc20Bridger.childChain
const l2Network = erc20Bridger.childNetwork

if (typeof l2Network.nativeToken === 'undefined') {
return false // native currency doesn't require approval
Expand Down Expand Up @@ -161,7 +161,7 @@ export class Erc20DepositStarter extends BridgeTransferStarter {

const erc20Bridger = await this.getBridger()

const l2Network = erc20Bridger.childChain
const l2Network = erc20Bridger.childNetwork

if (typeof l2Network.nativeToken === 'undefined') {
throw Error('Network does not have a custom native token')
Expand Down
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/src/util/TokenDepositUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export async function depositTokenEstimateGas(
)

return fetchTokenFallbackGasEstimates({
inboxAddress: erc20Bridger.childChain.ethBridge.inbox,
inboxAddress: erc20Bridger.childNetwork.ethBridge.inbox,
parentChainErc20Address,
parentChainProvider,
childChainProvider
Expand Down Expand Up @@ -185,7 +185,7 @@ export async function depositTokenEstimateGas(
Sentry.captureException(error)

return fetchTokenFallbackGasEstimates({
inboxAddress: erc20Bridger.childChain.ethBridge.inbox,
inboxAddress: erc20Bridger.childNetwork.ethBridge.inbox,
parentChainErc20Address,
parentChainProvider,
childChainProvider
Expand Down
4 changes: 2 additions & 2 deletions packages/arb-token-bridge-ui/src/util/deposits/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const updateETHDepositStatusData = async ({
const status = await ethDepositMessage.status()
const isDeposited = status === EthDepositMessageStatus.DEPOSITED

const retryableCreationTxID = ethDepositMessage.childDepositTxHash
const retryableCreationTxID = ethDepositMessage.childTxHash

const l2BlockNum = isDeposited
? (await l2Provider.getTransaction(retryableCreationTxID)).blockNumber
Expand All @@ -160,7 +160,7 @@ const updateETHDepositStatusData = async ({
: ParentToChildMessageStatus.NOT_YET_CREATED,
retryableCreationTxID,
// Only show `l2TxID` after the deposit is confirmed
l2TxID: isDeposited ? ethDepositMessage.childDepositTxHash : undefined,
l2TxID: isDeposited ? ethDepositMessage.childTxHash : undefined,
fetchingUpdate: false
}
}
Expand Down
Loading

0 comments on commit 1244894

Please sign in to comment.