Skip to content

Commit edbdabe

Browse files
committed
Changed the signature of react() to use a struct.
1 parent 95e7ead commit edbdabe

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

src/interfaces/IReactive.sol

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ import './IPayer.sol';
77
// @title Interface for reactive contracts.
88
// @notice Reactive contracts receive notifications about new events matching the criteria of their event subscriptions.
99
interface IReactive is IPayer {
10+
struct LogRecord {
11+
uint256 chain_id;
12+
address _contract;
13+
uint256 topic_0;
14+
uint256 topic_1;
15+
uint256 topic_2;
16+
uint256 topic_3;
17+
bytes data;
18+
uint256 block_number;
19+
uint256 op_code;
20+
uint256 block_hash;
21+
uint256 tx_hash;
22+
uint256 log_index;
23+
}
24+
1025
event Callback(
1126
uint256 indexed chain_id,
1227
address indexed _contract,
@@ -15,30 +30,5 @@ interface IReactive is IPayer {
1530
);
1631

1732
// @notice Entry point for handling new event notifications.
18-
// @param chain_id EIP155 source chain ID for the event (as a `uint256`).
19-
// @param _contract Address of the originating contract for the received event.
20-
// @param topic_0 Topic 0 of the event (or `0` for `LOG0`).
21-
// @param topic_1 Topic 1 of the event (or `0` for `LOG0` and `LOG1`).
22-
// @param topic_2 Topic 2 of the event (or `0` for `LOG0` .. `LOG2`).
23-
// @param topic_3 Topic 3 of the event (or `0` for `LOG0` .. `LOG3`).
24-
// @param data Event data as a byte array.
25-
// @param block_number Block number where the log record is located in its chain of origin.
26-
// @param op_code Number of topics in the log record (0 to 4).
27-
// @param origin_block_hash Origin block hash associated with the log record.
28-
// @param origin_tx_hash Origin transaction hash associated with the log record.
29-
// @param log_index Received log record's index.
30-
function react(
31-
uint256 chain_id,
32-
address _contract,
33-
uint256 topic_0,
34-
uint256 topic_1,
35-
uint256 topic_2,
36-
uint256 topic_3,
37-
bytes calldata data,
38-
uint256 block_number,
39-
uint256 op_code,
40-
uint256 origin_block_hash,
41-
uint256 origin_tx_hash,
42-
uint256 log_index
43-
) external;
33+
function react(LogRecord calldata log) external;
4434
}

0 commit comments

Comments
 (0)