@@ -9,6 +9,7 @@ import "../src/interfaces/INttManager.sol";
9
9
import "../src/interfaces/IRateLimiter.sol " ;
10
10
import "../src/interfaces/INttManagerEvents.sol " ;
11
11
import "../src/interfaces/IRateLimiterEvents.sol " ;
12
+ import "../src/NttManager/TransceiverRegistry.sol " ;
12
13
import {Utils} from "./libraries/Utils.sol " ;
13
14
14
15
import "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol " ;
@@ -226,6 +227,27 @@ contract TestNttManager is Test, INttManagerEvents, IRateLimiterEvents {
226
227
nttManager.setTransceiver (address (0x123 ));
227
228
}
228
229
230
+ function test_maxOutTransceivers () public {
231
+ // Let's register a transceiver and then disable it
232
+ DummyTransceiver e = new DummyTransceiver (address (nttManager));
233
+ nttManager.setTransceiver (address (e));
234
+ nttManager.removeTransceiver (address (e));
235
+
236
+ // We should be able to register 64 transceivers total
237
+ for (uint256 i = 0 ; i < 63 ; ++ i) {
238
+ DummyTransceiver d = new DummyTransceiver (address (nttManager));
239
+ nttManager.setTransceiver (address (d));
240
+ }
241
+
242
+ // Registering a new transceiver should fail as we've hit the cap
243
+ DummyTransceiver c = new DummyTransceiver (address (nttManager));
244
+ vm.expectRevert (TransceiverRegistry.TooManyTransceivers.selector );
245
+ nttManager.setTransceiver (address (c));
246
+
247
+ // We should be able to renable an already registered transceiver at the cap
248
+ nttManager.setTransceiver (address (e));
249
+ }
250
+
229
251
// == threshold
230
252
231
253
function test_cantSetThresholdTooHigh () public {
0 commit comments