From b9c53af739e4d05bdf5f7ceeb95984b391598433 Mon Sep 17 00:00:00 2001 From: noel Date: Thu, 16 May 2024 14:04:52 +0900 Subject: [PATCH] test: queryMessageHashes --- contracts/test/MachServiceManager.t.sol | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/contracts/test/MachServiceManager.t.sol b/contracts/test/MachServiceManager.t.sol index e7d3a09..e514560 100644 --- a/contracts/test/MachServiceManager.t.sol +++ b/contracts/test/MachServiceManager.t.sol @@ -515,4 +515,17 @@ contract MachServiceManagerTest is BLSAVSDeployer { vm.expectRevert("Ownable: caller is not the owner"); serviceManager.removeAlert("foo"); } + + function test_QueryMessageHashes() public { + test_confirmAlert(); + bytes32[] memory results = serviceManager.queryMessageHashes(0, 2); + assertTrue(results.length == 1); + assertTrue(results[0] == "foo"); + } + + function test_QueryMessageHashes_RevertIfInvalidStartIndex() public { + test_confirmAlert(); + vm.expectRevert(InvalidStartIndex.selector); + bytes32[] memory results = serviceManager.queryMessageHashes(1, 2); + } }