async function verifyTransaction(txHash, timeCapsule, provider) {
  // display link to etherscan
  displayMessage('#alert-success', `Capsule has been submitted, we will let you know when the transacction is confirmed. <a href="https://ropsten.etherscan.io/tx/${txHash}" target="_blank">View on Etherscan</a>`);

  const receipt = await provider.waitForTransaction(txHash);

  console.log("receipt:", receipt);
  let capsuleId;
  receipt.logs.forEach(log => {
    capsuleId = timeCapsule.interface.parseLog(log).args[0].toNumber();
  });

  // alert the user the transaction has been confirmed
  displayMessage('#alert-success', `Transaction confirmed. <a href="message.html?capsuleId=${capsuleId}">View Capsule</a>`);
}
/**
 * Veryfy the transaction and display confirmation message when needed
 * 
 * @param {string} txHash The transaction hash
 * @param {Contract} timeCapsule The contract from where to get the logs
 * @param {Web3Provider} provider The web3 provider
 */
Veryfy the transaction and display confirmation message when needed

@param {string} txHash The transaction hash
@param {Contract} timeCapsule The contract from where to get the logs
@param {Web3Provider} provider The web3 provider
Veryfy the transaction and display confirmation message when needed @param { string } txHash The transaction hash @param { Contract } timeCapsule The contract from where to get the logs @param { Web3Provider } provider The web3 provider
async function verifyTransaction(txHash, timeCapsule, provider) {
  displayMessage('#alert-success', `Capsule has been submitted, we will let you know when the transacction is confirmed. <a href="https://ropsten.etherscan.io/tx/${txHash}" target="_blank">View on Etherscan</a>`);
  const receipt = await provider.waitForTransaction(txHash);
  console.log("receipt:", receipt);
  let capsuleId;
  receipt.logs.forEach(log => {
    capsuleId = timeCapsule.interface.parseLog(log).args[0].toNumber();
  });
  displayMessage('#alert-success', `Transaction confirmed. <a href="message.html?capsuleId=${capsuleId}">View Capsule</a>`);
}
async function verifyTransaction ( txHash , timeCapsule , provider ) { displayMessage ( '#alert-success' , ` ${ txHash } ` ) ; const receipt = await provider . waitForTransaction ( txHash ) ; console . log ( "receipt:" , receipt ) ; let capsuleId ; receipt . logs . forEach ( log => { capsuleId = timeCapsule . interface . parseLog ( log ) . args [ 0 ] . toNumber ( ) ; } ) ; displayMessage ( '#alert-success' , ` ${ capsuleId } ` ) ; }
Veryfy the transaction and display confirmation message when needed
Veryfy the transaction and display confirmation message when needed
// display link to etherscan // alert the user the transaction has been confirmed