Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
polarker committed Jun 3, 2024
1 parent 516acc9 commit e57069a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/deployment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import {
taskIdToVariable,
waitUserConfirmation
} from './utils'
import { groupOfAddress, waitTxConfirmed } from '@alephium/web3'
import { groupOfAddress, waitForTxConfirmation } from '@alephium/web3'
import { codegen, genLoadDeployments } from './codegen'
import { Project, ProjectArtifact } from './project'

Expand Down Expand Up @@ -380,7 +380,7 @@ function createDeployer<Settings = unknown>(
console.log(`Deploying contract ${taskId}`)
console.log(`Deployer - group ${signer.group} - ${signer.address}`)
const deployResult = await contractFactory.deploy(signer, params)
const confirmed = await waitTxConfirmed(deployResult.txId, confirmations, requestInterval)
const confirmed = await waitForTxConfirmation(deployResult.txId, confirmations, requestInterval)
const result: DeployContractExecutionResult = {
txId: deployResult.txId,
unsignedTx: deployResult.unsignedTx,
Expand Down Expand Up @@ -427,7 +427,7 @@ function createDeployer<Settings = unknown>(
}
console.log(`Executing script ${taskId}`)
const executeResult = await executableScript.execute(signer, params)
const confirmed = await waitTxConfirmed(executeResult.txId, confirmations, requestInterval)
const confirmed = await waitForTxConfirmation(executeResult.txId, confirmations, requestInterval)
const runScriptResult: RunScriptResult = {
...executeResult,
gasPrice: executeResult.gasPrice.toString(),
Expand Down
4 changes: 2 additions & 2 deletions packages/web3/src/transaction/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function isConfirmed(txStatus: node.TxStatus): txStatus is node.Confirmed {
return txStatus.type === 'Confirmed'
}

export async function waitTxConfirmed(
export async function waitForTxConfirmation(
txId: string,
confirmations: number,
requestInterval: number
Expand All @@ -34,5 +34,5 @@ export async function waitTxConfirmed(
return status
}
await new Promise((r) => setTimeout(r, requestInterval))
return waitTxConfirmed(txId, confirmations, requestInterval)
return waitForTxConfirmation(txId, confirmations, requestInterval)
}
8 changes: 4 additions & 4 deletions test/exchange.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
getALPHDepositInfo,
groupOfAddress,
BlockSubscription,
waitTxConfirmed
waitForTxConfirmation
} from '@alephium/web3'
import { EventEmitter } from 'stream'
import * as bip39 from 'bip39'
Expand All @@ -53,7 +53,7 @@ async function getGasFee(txIds: string[]): Promise<bigint> {
async function waitTxsConfirmed(txIds: string[]): Promise<void> {
const nodeProvider = web3.getCurrentNodeProvider()
for (const txId of txIds) {
await waitTxConfirmed(txId, 1, 1000)
await waitForTxConfirmation(txId, 1, 1000)
}
}

Expand Down Expand Up @@ -214,7 +214,7 @@ class Exchange {
throw new Error('Not enough balance')
}
const result = await transfer(this.wallet, user.address, ALPH_TOKEN_ID, amount)
await waitTxConfirmed(result.txId, 1, 1000)
await waitForTxConfirmation(result.txId, 1, 1000)
this.withdrawTxs.push(result.txId)
const remain = balance - (amount + WithdrawFee)
if (remain === 0n) {
Expand Down Expand Up @@ -313,7 +313,7 @@ describe('exchange', function () {
signerAddress: testWallet.address,
destinations
})
await waitTxConfirmed(result.txId, 1, 1000)
await waitForTxConfirmation(result.txId, 1, 1000)
poolRewardTxNumber += 1
}
}
Expand Down

0 comments on commit e57069a

Please sign in to comment.