|
1 | 1 | import env from "./utils/env";
|
2 | 2 | import loggerFactory from "./utils/logger";
|
3 |
| -import { BigNumber } from "ethers"; |
4 | 3 | import hre = require("hardhat");
|
5 | 4 | import {
|
6 | 5 | KlerosCore,
|
@@ -63,17 +62,19 @@ export default async function main(
|
63 | 62 | logger.info(
|
64 | 63 | `CrossChainDisputeOutgoing: ${foreignBlockHash} ${foreignArbitrable} ${foreignDisputeID} ${choices} ${extraData}`
|
65 | 64 | );
|
66 |
| - // logger.info(`tx receipt: ${JSON.stringify(txReceipt)}`); |
| 65 | + logger.debug(`tx receipt: ${JSON.stringify(txReceipt)}`); |
67 | 66 |
|
68 | 67 | // txReceipt is missing the full logs for this tx so we need to request it here
|
69 | 68 | const fullTxReceipt = await foreignChainProvider.getTransactionReceipt(txReceipt.transactionHash);
|
70 | 69 |
|
71 | 70 | // Retrieve the DisputeRequest event
|
72 |
| - const disputeRequest = fullTxReceipt.logs |
| 71 | + const disputeRequests: DisputeRequestEventObject[] = fullTxReceipt.logs |
73 | 72 | .filter((log) => log.topics[0] === arbitrableInterface.getEventTopic("DisputeRequest"))
|
74 |
| - .map((log) => arbitrableInterface.parseLog(log).args as unknown as DisputeRequestEventObject)[0]; |
| 73 | + .map((log) => arbitrableInterface.parseLog(log).args as unknown as DisputeRequestEventObject); |
| 74 | + logger.warn(`More than 1 DisputeRequest event: not supported yet, skipping the others events.`); |
| 75 | + |
| 76 | + const disputeRequest = disputeRequests[0]; |
75 | 77 | logger.info(`tx events DisputeRequest: ${JSON.stringify(disputeRequest)}`);
|
76 |
| - // TODO: log a warning if there are multiple DisputeRequest events |
77 | 78 |
|
78 | 79 | const relayCreateDisputeParams = {
|
79 | 80 | foreignBlockHash: foreignBlockHash,
|
|
0 commit comments