Skip to content

ERR_UNHANDLED_REJECTION occurs in the method PosClient.isCheckPointed() #394

Description

@Spider-yuchen

Describe the bug
0x9cb0b04171ca692a156c174381c00f4ccebe543fcfcfbd865254f950f6778259
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#".
] {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v18.16.0

Hint

My code:
const posClient = await getBridgeClient()
console.log(transactionReceipt.transactionHash)
const isCheckPointed = await posClient.isCheckPointed(transactionReceipt.transactionHash);
console.log(hash: ${transactionReceipt.transactionHash} isCheckPointed: ${isCheckPointed})
if(isCheckPointed){
const erc20RootToken = await getERC20RootToken()
await erc20RootToken.withdrawExit(transactionReceipt.transactionHash)
console.log(${transactionReceipt.transactionHash} withdraw, txHash : ${transactionReceipt.transactionHash})
}

const getBridgeClient = async () : Promise => {
if (bridgeClient === null) {
bridgeClient = new POSClient()

const polygonConstructorArguments : any = {
  privateKeys: ['...........................'],
  providerOrUrl: '...................'
}

const etherConstructorArguments : any = {
  privateKeys: ['........................'],
  providerOrUrl: '...........'
}

await bridgeClient.init({
  network: 'testnet',
  version: 'mumbai',
  parent: {
    provider: new HDWalletProvider(polygonConstructorArguments)
    defaultConfig: {
      from: Parent.from
    }
  },
  child: {
    provider: new HDWalletProvider(etherConstructorArguments),
    defaultConfig: {
      from: Child.from
    }
  }
});

}

return bridgeClient
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions