Skip to content

Commit 5ae3488

Browse files
committed
feat: emits RecordSet events on setRecords
1 parent 5a6c8a8 commit 5ae3488

4 files changed

Lines changed: 1 addition & 19 deletions

File tree

src/contracts/L2Resolver.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ contract L2Resolver is IL2Resolver, IERC165 {
5858
/// @inheritdoc IL2Resolver
5959
function setRecord(bytes32 _node, string calldata _key, bytes calldata _value) external {
6060
_setRecord(_node, _key, _value);
61-
emit RecordSet(_node, _key, _value);
6261
}
6362

6463
/// @inheritdoc IL2Resolver
@@ -71,8 +70,6 @@ contract L2Resolver is IL2Resolver, IERC165 {
7170
for (uint256 i = 0; i < _length; i++) {
7271
_setRecord(_nodes[i], _keys[i], _values[i]);
7372
}
74-
75-
emit RecordsSet(_nodes, _keys, _values);
7673
}
7774

7875
/// @inheritdoc IL2Resolver
@@ -136,6 +133,7 @@ contract L2Resolver is IL2Resolver, IERC165 {
136133
}
137134

138135
records[_node][_key] = _value;
136+
emit RecordSet(_node, _key, _value);
139137
}
140138

141139
/**

src/interfaces/IL2Resolver.sol

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ interface IL2Resolver {
2121
*/
2222
event RecordSet(bytes32 indexed _node, string indexed _key, bytes _value);
2323

24-
/**
25-
* @notice Emitted when records are set in batch.
26-
* @param _nodes The ENS nodes to store the data for.
27-
* @param _keys The keys to store the data under.
28-
* @param _values The data to store under the keys.
29-
*/
30-
event RecordsSet(bytes32[] _nodes, string[] _keys, bytes[] _values);
31-
3224
/*///////////////////////////////////////////////////////////////
3325
ERRORS
3426
//////////////////////////////////////////////////////////////*/

test/unit/L2Resolver.t.sol

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -904,10 +904,7 @@ contract UnitL2Resolver is Test {
904904
_mockAndExpect(address(_ensRegistry), abi.encodeWithSelector(IENS.owner.selector, _nodes[i]), abi.encode(_caller));
905905
}
906906

907-
// it emits the RecordsSet event
908907
vm.prank(_caller);
909-
vm.expectEmit();
910-
emit IL2Resolver.RecordsSet(_nodes, _keys, _values);
911908
_l2Resolver.setRecords(_nodes, _keys, _values);
912909

913910
// it sets the records
@@ -937,10 +934,7 @@ contract UnitL2Resolver is Test {
937934
);
938935
}
939936

940-
// it emits the RecordsSet event
941937
vm.prank(_caller);
942-
vm.expectEmit();
943-
emit IL2Resolver.RecordsSet(_nodes, _keys, _values);
944938
_l2Resolver.setRecords(_nodes, _keys, _values);
945939

946940
// it sets the records

test/unit/L2Resolver.tree

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ UnitL2Resolver::resolve
108108

109109
UnitL2Resolver::setRecords
110110
├── when setting multiple records in batch
111-
│ ├── it emits the RecordsSet event
112111
│ └── it sets the records
113112
├── when setting multiple reverse lookup records in batch
114-
│ ├── it emits the RecordsSet event
115113
│ └── it sets the records
116114
└── when the parameters length does not match the records length
117115
└── it reverts

0 commit comments

Comments
 (0)