async function enqueueUpdateToReplica(
  chainDetails,
  latestUpdateOnOriginChain,
  homeDomain,
  replicaDomain,
) {
  const replica = getReplica(chainDetails, replicaDomain, homeDomain);

  const { startRoot, finalRoot, signature } = latestUpdateOnOriginChain;

  await expect(replica.update(startRoot, finalRoot, signature))
    .to.emit(replica, 'Update')
    .withArgs(homeDomain, startRoot, finalRoot, signature);

  expect(await replica.queueEnd()).to.equal(finalRoot);

  return finalRoot;
}
/*
 * Enqueue a signed update to the Replica contract
 *
 * @param chainDetails - ChainDetails type containing every deployed domain
 * @param latestUpdateOnOriginChain - Update type, the last Update submitted to the Home chain for this Replica
 * @param homeDomain - domain of the Home contract from which the update originated
 * @param replicaDomain - domain of the Replica contract where the update will be submitted
 *
 * @return finalRoot - updated state root enqueued to the Replica
 */
Enqueue a signed update to the Replica contract
@param chainDetails - ChainDetails type containing every deployed domain
@param latestUpdateOnOriginChain - Update type, the last Update submitted to the Home chain for this Replica
@param homeDomain - domain of the Home contract from which the update originated
@param replicaDomain - domain of the Replica contract where the update will be submitted

@return finalRoot - updated state root enqueued to the Replica
Enqueue a signed update to the Replica contract @param chainDetails - ChainDetails type containing every deployed domain @param latestUpdateOnOriginChain - Update type the last Update submitted to the Home chain for this Replica @param homeDomain - domain of the Home contract from which the update originated @param replicaDomain - domain of the Replica contract where the update will be submitted @return finalRoot - updated state root enqueued to the Replica
async function enqueueUpdateToReplica(
  chainDetails,
  latestUpdateOnOriginChain,
  homeDomain,
  replicaDomain,
) {
  const replica = getReplica(chainDetails, replicaDomain, homeDomain);
  const { startRoot, finalRoot, signature } = latestUpdateOnOriginChain;
  await expect(replica.update(startRoot, finalRoot, signature))
    .to.emit(replica, 'Update')
    .withArgs(homeDomain, startRoot, finalRoot, signature);
  expect(await replica.queueEnd()).to.equal(finalRoot);
  return finalRoot;
}
async function enqueueUpdateToReplica ( chainDetails , latestUpdateOnOriginChain , homeDomain , replicaDomain , ) { const replica = getReplica ( chainDetails , replicaDomain , homeDomain ) ; const { startRoot , finalRoot , signature } = latestUpdateOnOriginChain ; await expect ( replica . update ( startRoot , finalRoot , signature ) ) . to . emit ( replica , 'Update' ) . withArgs ( homeDomain , startRoot , finalRoot , signature ) ; expect ( await replica . queueEnd ( ) ) . to . equal ( finalRoot ) ; return finalRoot ; }
Enqueue a signed update to the Replica contract
 @param chainDetails - ChainDetails type containing every deployed domain
 @param latestUpdateOnOriginChain - Update type, the last Update submitted to the Home chain for this Replica
 @param homeDomain - domain of the Home contract from which the update originated
 @param replicaDomain - domain of the Replica contract where the update will be submitted
Enqueue a signed update to the Replica contract @param chainDetails - ChainDetails type containing every deployed domain @param latestUpdateOnOriginChain - Update type the last Update submitted to the Home chain for this Replica @param homeDomain - domain of the Home contract from which the update originated @param replicaDomain - domain of the Replica contract where the update will be submitted