Skip to content

Commit 6a990c2

Browse files
Rename 'claimed' to 'processed' because it represents claims and cancellations
1 parent d7af0b3 commit 6a990c2

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/protocol/ETHBridge.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {ReentrancyGuardTransient} from "@openzeppelin/contracts/utils/Reentrancy
99
/// address on both chains. This is because it is designed so that each rollup has its own independent bridge contract,
1010
/// and they may furthermore decide to deploy a new version of the bridge in the future.
1111
contract ETHBridge is IETHBridge, ReentrancyGuardTransient {
12-
mapping(bytes32 id => bool claimed) private _claimed;
12+
mapping(bytes32 id => bool processed) private _processed;
1313

1414
/// Incremental nonce to generate unique deposit IDs.
1515
uint256 private _globalDepositNonce;
@@ -36,8 +36,8 @@ contract ETHBridge is IETHBridge, ReentrancyGuardTransient {
3636
}
3737

3838
/// @inheritdoc IETHBridge
39-
function claimed(bytes32 id) public view returns (bool) {
40-
return _claimed[id];
39+
function processed(bytes32 id) public view returns (bool) {
40+
return _processed[id];
4141
}
4242

4343
/// @inheritdoc IETHBridge
@@ -88,11 +88,11 @@ contract ETHBridge is IETHBridge, ReentrancyGuardTransient {
8888
bytes memory proof
8989
) internal returns (bytes32 id) {
9090
id = _generateId(ethDeposit);
91-
require(!claimed(id), AlreadyClaimed());
91+
require(!processed(id), AlreadyClaimed());
9292

9393
signalService.verifySignal(height, trustedCommitmentPublisher, counterpart, id, proof);
9494

95-
_claimed[id] = true;
95+
_processed[id] = true;
9696
_sendETH(to, ethDeposit.amount, data);
9797
}
9898

src/protocol/IETHBridge.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ interface IETHBridge {
4848
/// @dev Only canceler can cancel a deposit.
4949
error OnlyCanceler();
5050

51-
/// @dev Whether the deposit identified by `id` has been claimed.
51+
/// @dev Whether the deposit identified by `id` has been claimed or cancelled.
5252
/// @param id The deposit id
53-
function claimed(bytes32 id) external view returns (bool);
53+
function processed(bytes32 id) external view returns (bool);
5454

5555
/// @dev ETH Deposit identifier.
5656
/// @param ethDeposit The ETH deposit struct

test/ETHBridge/ClaimableScenarios.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ abstract contract DepositIsClaimable is CrossChainDepositExists {
1717
bytes memory proof = abi.encode(sampleDepositProof.getDepositSignalProof(_depositIdx()));
1818
(, bytes32 id) = sampleDepositProof.getDepositInternals(_depositIdx());
1919

20-
assertFalse(bridge.claimed(id), "deposit already marked as claimed");
20+
assertFalse(bridge.processed(id), "deposit already marked as claimed");
2121
bridge.claimDeposit(deposit, HEIGHT, proof);
22-
assertTrue(bridge.claimed(id), "deposit not marked as claimed");
22+
assertTrue(bridge.processed(id), "deposit not marked as claimed");
2323
}
2424

2525
function test_claimDeposit_shouldEmitEvent() public {

0 commit comments

Comments
 (0)