Skip to content

Commit

Permalink
fix: tests and copy logic
Browse files Browse the repository at this point in the history
  • Loading branch information
elatoskinas committed Sep 13, 2024
1 parent f0ec0d2 commit 4a0b46d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contracts/src/v0.8/ccip/capability/CCIPConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,15 @@ contract CCIPConfig is ITypeAndVersion, ICapabilityConfiguration, OwnerIsCreator
ocr3Config.offchainConfig = newOcr3Config.offchainConfig;

// Remove all excess nodes
for (uint256 j = newOcr3Config.nodes.length; j < ocr3Config.nodes.length; ++j) {
while (ocr3Config.nodes.length > newOcr3Config.nodes.length) {
ocr3Config.nodes.pop();
}

// Assign nodes
for (uint256 j = 0; j < newOcr3Config.nodes.length; ++j) {
ocr3Config.nodes[j] = newOcr3Config.nodes[j];
if (j >= ocr3Config.nodes.length) {
ocr3Config.nodes.push(newOcr3Config.nodes[j]);
}
}
}

Expand Down
1 change: 1 addition & 0 deletions contracts/src/v0.8/ccip/test/capability/CCIPConfig.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ contract CCIPConfig_validateConfig is CCIPConfigSetup {
nodes[i].transmitterKey = bytes("");
}

config.nodes = nodes;
vm.expectRevert(abi.encodeWithSelector(CCIPConfig.NotEnoughTransmitters.selector, numberOfTransmitters, 4));
s_ccipCC.validateConfig(config);
}
Expand Down

0 comments on commit 4a0b46d

Please sign in to comment.