From d90e90af3e9904f780ebda7c90ea858fdca4c61c Mon Sep 17 00:00:00 2001 From: D <51912515+adaki2004@users.noreply.github.com> Date: Wed, 21 Feb 2024 11:28:52 +0530 Subject: [PATCH] feat(protocol): extend SignalService interface (#15969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Keszey Dániel Co-authored-by: Daniel Wang <99078276+dantaik@users.noreply.github.com> --- .../protocol/contracts/signal/ISignalService.sol | 16 ++++++++++++++++ .../protocol/contracts/signal/SignalService.sol | 1 + .../test/team/airdrop/ERC20Airdrop.t.sol | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/protocol/contracts/signal/ISignalService.sol b/packages/protocol/contracts/signal/ISignalService.sol index 02623fa2024..9dcc5db9c29 100644 --- a/packages/protocol/contracts/signal/ISignalService.sol +++ b/packages/protocol/contracts/signal/ISignalService.sol @@ -93,6 +93,7 @@ interface ISignalService { returns (bool); /// @notice Returns the given block's chain data. + /// @param chainId Indenitifer of the chainId. /// @param kind A value to mark the data type. /// @param blockId The chain data's corresponding block id. If this value is 0, use the top /// block id. @@ -106,4 +107,19 @@ interface ISignalService { external view returns (uint64 _blockId, bytes32 _chainData); + + /// @notice Returns the data to be used for caching slot generation. + /// @param chainId Indenitifer of the chainId. + /// @param kind A value to mark the data type. + /// @param blockId The chain data's corresponding block id. If this value is 0, use the top + /// block id. + /// @return signal The signal used for caching slot creation. + function signalForChainData( + uint64 chainId, + bytes32 kind, + uint64 blockId + ) + external + pure + returns (bytes32 signal); } diff --git a/packages/protocol/contracts/signal/SignalService.sol b/packages/protocol/contracts/signal/SignalService.sol index b5b43af525f..ad17b0a1996 100644 --- a/packages/protocol/contracts/signal/SignalService.sol +++ b/packages/protocol/contracts/signal/SignalService.sol @@ -194,6 +194,7 @@ contract SignalService is EssentialContract, ISignalService { } } + /// @inheritdoc ISignalService function signalForChainData( uint64 chainId, bytes32 kind, diff --git a/packages/protocol/test/team/airdrop/ERC20Airdrop.t.sol b/packages/protocol/test/team/airdrop/ERC20Airdrop.t.sol index 4d712ef18fd..705c166c780 100644 --- a/packages/protocol/test/team/airdrop/ERC20Airdrop.t.sol +++ b/packages/protocol/test/team/airdrop/ERC20Airdrop.t.sol @@ -91,7 +91,7 @@ contract TestERC20Airdrop is TaikoTest { // 2. Need to add it to the AddressManager (below here i'm just mocking it) so that we can // mint TKO. Basically this step only required in this test. Only thing we need to be sure - // on testnet/mainnet. Vault (which Aridrop transfers from) HAVE tokens. + // on testnet/mainnet. Vault (which Airdrop transfers from) HAVE tokens. addressManager = new MockAddressManager(address(vault)); // 3. Deploy a bridged TKO token (but on mainnet it will be just a bridged token from L1 to