Skip to content

Commit

Permalink
refactor(contracts & test): rm try catch within checkHashWithThreshol…
Browse files Browse the repository at this point in the history
…dFromAdapters & _getThresholdHash
  • Loading branch information
allemanfredi committed Feb 27, 2024
1 parent d1a057d commit 2362a45
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions packages/evm/contracts/Hashi.sol
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ contract Hashi is IHashi {

bytes32[] memory hashes = new bytes32[](adapters.length);
for (uint256 i = 0; i < adapters.length; ) {
try adapters[i].getHash(domain, id) returns (bytes32 hash) {
hashes[i] = hash;
} catch {} // solhint-disable no-empty-blocks
hashes[i] = adapters[i].getHash(domain, id);
unchecked {
++i;
}
Expand Down
4 changes: 1 addition & 3 deletions packages/evm/contracts/ownable/ShuSo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ abstract contract ShuSo is IShuSho, OwnableUpgradeable {

bytes32[] memory hashes = new bytes32[](adapters.length);
for (uint256 i = 0; i < adapters.length; i++) {
try adapters[i].getHash(domain, id) returns (bytes32 currentHash) {
hashes[i] = currentHash;
} catch {} // solhint-disable no-empty-blocks
hashes[i] = adapters[i].getHash(domain, id);
}

for (uint256 i = 0; i < hashes.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion packages/evm/test/05_Yaru.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("Yaru", () => {
pingPong1.address,
"0x01",
[reporter1.address, reporter2.address, reporter3.address],
[adapter1.address, adapter2.address, reporter3.address],
[adapter1.address, adapter2.address, adapter3.address],
)
const [message] = Message.fromReceipt(await tx.wait(1))
const hash = await yaho.calculateMessageHash(message.serialize())
Expand Down

0 comments on commit 2362a45

Please sign in to comment.