Skip to content

Commit 66898fa

Browse files
committed
test: adds emit event
1 parent 5ae3488 commit 66898fa

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

test/unit/L2Resolver.t.sol

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

907+
// it emits the RecordSet event
907908
vm.prank(_caller);
909+
vm.expectEmit();
910+
emit IL2Resolver.RecordSet(_nodes[0], _keys[0], _values[0]);
908911
_l2Resolver.setRecords(_nodes, _keys, _values);
909912

910913
// it sets the records
@@ -934,7 +937,10 @@ contract UnitL2Resolver is Test {
934937
);
935938
}
936939

940+
// it emits the RecordsSet event
937941
vm.prank(_caller);
942+
vm.expectEmit();
943+
emit IL2Resolver.RecordSet(_nodes[0], _keys[0], _values[0]);
938944
_l2Resolver.setRecords(_nodes, _keys, _values);
939945

940946
// it sets the records
@@ -952,7 +958,9 @@ contract UnitL2Resolver is Test {
952958
_keysLength = bound(_keysLength, 1, _BATCH_RECORDS);
953959
_valuesLength = bound(_valuesLength, 1, _BATCH_RECORDS);
954960

955-
vm.assume(_nodesLength != _keysLength && _nodesLength != _valuesLength && _keysLength != _valuesLength);
961+
vm.assume(_nodesLength != _keysLength);
962+
vm.assume(_nodesLength != _valuesLength);
963+
vm.assume(_keysLength != _valuesLength);
956964

957965
// it reverts
958966
vm.expectRevert(abi.encodeWithSelector(IL2Resolver.InvalidDataLength.selector));

test/unit/L2Resolver.tree

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

109109
UnitL2Resolver::setRecords
110110
├── when setting multiple records in batch
111+
│ ├── it emits the RecordSet event
111112
│ └── it sets the records
112113
├── when setting multiple reverse lookup records in batch
114+
│ ├── it emits the RecordSet event
113115
│ └── it sets the records
114116
└── when the parameters length does not match the records length
115117
└── it reverts

0 commit comments

Comments
 (0)