@@ -160,7 +160,9 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
160
160
address notOwner = address (0x123 );
161
161
vm.startPrank (notOwner);
162
162
163
- vm.expectRevert (abi.encodeWithSignature ("OwnableUnauthorizedAccount(address) " , notOwner));
163
+ vm.expectRevert (
164
+ abi.encodeWithSelector (OwnableUpgradeable.OwnableUnauthorizedAccount.selector , notOwner)
165
+ );
164
166
nttManager.transferOwnership (address (0x456 ));
165
167
}
166
168
@@ -178,18 +180,26 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
178
180
address notOwner = address (0x123 );
179
181
vm.startPrank (notOwner);
180
182
181
- vm.expectRevert (abi.encodeWithSignature ("OwnableUnauthorizedAccount(address) " , notOwner));
183
+ vm.expectRevert (
184
+ abi.encodeWithSelector (OwnableUpgradeable.OwnableUnauthorizedAccount.selector , notOwner)
185
+ );
182
186
nttManager.setTransceiver (address (e));
183
187
184
- vm.expectRevert (abi.encodeWithSignature ("OwnableUnauthorizedAccount(address) " , notOwner));
188
+ vm.expectRevert (
189
+ abi.encodeWithSelector (OwnableUpgradeable.OwnableUnauthorizedAccount.selector , notOwner)
190
+ );
185
191
nttManager.removeTransceiver (address (e));
186
192
}
187
193
188
194
function test_cantEnableTransceiverTwice () public {
189
195
DummyTransceiver e = new DummyTransceiver (address (nttManager));
190
196
nttManager.setTransceiver (address (e));
191
197
192
- vm.expectRevert (abi.encodeWithSignature ("TransceiverAlreadyEnabled(address) " , address (e)));
198
+ vm.expectRevert (
199
+ abi.encodeWithSelector (
200
+ TransceiverRegistry.TransceiverAlreadyEnabled.selector , address (e)
201
+ )
202
+ );
193
203
nttManager.setTransceiver (address (e));
194
204
}
195
205
@@ -256,7 +266,7 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
256
266
257
267
function test_cantSetThresholdTooHigh () public {
258
268
// no transceivers set, so can't set threshold to 1
259
- vm.expectRevert (abi.encodeWithSignature ( " ThresholdTooHigh(uint256,uint256) " , 1 , 0 ));
269
+ vm.expectRevert (abi.encodeWithSelector (INttManagerState. ThresholdTooHigh. selector , 1 , 0 ));
260
270
nttManager.setThreshold (1 );
261
271
}
262
272
@@ -275,15 +285,17 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
275
285
DummyTransceiver e = new DummyTransceiver (address (nttManager));
276
286
nttManager.setTransceiver (address (e));
277
287
278
- vm.expectRevert (abi.encodeWithSignature ( " ZeroThreshold() " ));
288
+ vm.expectRevert (abi.encodeWithSelector (INttManagerState. ZeroThreshold. selector ));
279
289
nttManager.setThreshold (0 );
280
290
}
281
291
282
292
function test_onlyOwnerCanSetThreshold () public {
283
293
address notOwner = address (0x123 );
284
294
vm.startPrank (notOwner);
285
295
286
- vm.expectRevert (abi.encodeWithSignature ("OwnableUnauthorizedAccount(address) " , notOwner));
296
+ vm.expectRevert (
297
+ abi.encodeWithSelector (OwnableUpgradeable.OwnableUnauthorizedAccount.selector , notOwner)
298
+ );
287
299
nttManager.setThreshold (1 );
288
300
}
289
301
@@ -317,7 +329,9 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
317
329
0 , bytes32 (0 ), peer, toWormholeFormat (address (nttManagerOther)), abi.encode ("payload " )
318
330
);
319
331
320
- vm.expectRevert (abi.encodeWithSignature ("CallerNotTransceiver(address) " , address (e1)));
332
+ vm.expectRevert (
333
+ abi.encodeWithSelector (TransceiverRegistry.CallerNotTransceiver.selector , address (e1))
334
+ );
321
335
e1.receiveMessage (transceiverMessage);
322
336
}
323
337
@@ -335,8 +349,8 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
335
349
);
336
350
337
351
vm.expectRevert (
338
- abi.encodeWithSignature (
339
- " InvalidPeer(uint16,bytes32) " , TransceiverHelpersLib.SENDING_CHAIN_ID, peer
352
+ abi.encodeWithSelector (
353
+ INttManagerState. InvalidPeer. selector , TransceiverHelpersLib.SENDING_CHAIN_ID, peer
340
354
)
341
355
);
342
356
e1.receiveMessage (transceiverMessage);
@@ -386,7 +400,7 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
386
400
387
401
e1.receiveMessage (transceiverMessage);
388
402
vm.expectRevert (
389
- abi.encodeWithSignature ( " TransceiverAlreadyAttestedToMessage(bytes32) " , hash)
403
+ abi.encodeWithSelector (INttManager. TransceiverAlreadyAttestedToMessage. selector , hash)
390
404
);
391
405
e1.receiveMessage (transceiverMessage);
392
406
@@ -499,8 +513,8 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
499
513
// replay protection for transceiver
500
514
vm.recordLogs ();
501
515
vm.expectRevert (
502
- abi.encodeWithSignature (
503
- " TransceiverAlreadyAttestedToMessage(bytes32) " ,
516
+ abi.encodeWithSelector (
517
+ INttManager. TransceiverAlreadyAttestedToMessage. selector ,
504
518
TransceiverStructs.nttManagerMessageDigest (
505
519
TransceiverHelpersLib.SENDING_CHAIN_ID, m
506
520
)
@@ -568,8 +582,8 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
568
582
token.approve (address (nttManager), amountWithDust);
569
583
570
584
vm.expectRevert (
571
- abi.encodeWithSignature (
572
- " TransferAmountHasDust(uint256,uint256) " , amountWithDust, dustAmount
585
+ abi.encodeWithSelector (
586
+ INttManager. TransferAmountHasDust. selector , amountWithDust, dustAmount
573
587
)
574
588
);
575
589
nttManager.transfer (amountWithDust, chainId, toWormholeFormat (to), false , new bytes (1 ));
0 commit comments