diff --git a/lcov.info b/lcov.info index 8a67463..cf6d21e 100644 --- a/lcov.info +++ b/lcov.info @@ -476,33 +476,33 @@ DA:17,300 DA:18,300 DA:20,15 FN:23,StringAddressConversion.toAddress -FNDA:6,StringAddressConversion.toAddress -DA:24,6 -DA:25,6 -DA:26,6 -DA:28,6 +FNDA:8,StringAddressConversion.toAddress +DA:24,8 +DA:25,8 +DA:26,8 +DA:28,8 BRDA:28,0,0,4 -BRDA:28,0,1,2 -DA:30,2 -DA:31,79 -DA:33,79 -BRDA:33,1,0,- -BRDA:33,1,1,79 -DA:34,79 -BRDA:34,2,0,- +BRDA:28,0,1,4 +DA:30,4 +DA:31,159 +DA:33,159 +BRDA:33,1,0,40 +BRDA:33,1,1,119 +DA:34,119 +BRDA:34,2,0,40 BRDA:34,2,1,79 DA:35,79 BRDA:35,3,0,78 BRDA:35,3,1,1 DA:36,1 -DA:38,78 -DA:40,1 +DA:38,158 +DA:40,3 FNF:2 FNH:2 LF:22 LH:22 BRF:8 -BRH:6 +BRH:8 end_of_record TN: SF:src/adapters/wormhole/WormholeReceiverAdapter.sol @@ -1144,8 +1144,8 @@ FN:12,StringAddressConversionHelper.toString FNDA:1,StringAddressConversionHelper.toString DA:13,1 FN:16,StringAddressConversionHelper.toAddress -FNDA:6,StringAddressConversionHelper.toAddress -DA:17,6 +FNDA:8,StringAddressConversionHelper.toAddress +DA:17,8 FNF:2 FNH:2 LF:2 diff --git a/test/unit-tests/adapters/axelar/libraries/StringAddressConversion.t.sol b/test/unit-tests/adapters/axelar/libraries/StringAddressConversion.t.sol index 19ca2b1..7629aff 100644 --- a/test/unit-tests/adapters/axelar/libraries/StringAddressConversion.t.sol +++ b/test/unit-tests/adapters/axelar/libraries/StringAddressConversion.t.sol @@ -96,4 +96,22 @@ contract StringAddressConversionTest is Test { vm.expectRevert(selector); conversionHelper.toAddress(invalidCharacterAddressString); } + + /// @dev tests conversion of string with lowercase hex characters to address + function testLowercaseHexCharacterToAddress() public { + string memory testString = "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"; + address result = conversionHelper.toAddress(testString); + address expected = address(0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD); + + assertTrue(result == expected, "Converted address with lowercase hex characters does not match expected value"); + } + + /// @dev tests conversion of string with uppercase hex characters to address + function testUppercaseHexCharacterToAddress() public { + string memory testString = "0xABCDEFABCDEFABCDEFABCDEFABCDEFABCDEFABCD"; + address result = conversionHelper.toAddress(testString); + address expected = address(0xABcdEFABcdEFabcdEfAbCdefabcdeFABcDEFabCD); + + assertTrue(result == expected, "Converted address with uppercase hex characters does not match expected value"); + } } diff --git a/test/unit-tests/libraries/EIP5164/ExecutorAware.t.sol b/test/unit-tests/libraries/EIP5164/ExecutorAware.t.sol index d98e9cc..94aef56 100644 --- a/test/unit-tests/libraries/EIP5164/ExecutorAware.t.sol +++ b/test/unit-tests/libraries/EIP5164/ExecutorAware.t.sol @@ -60,7 +60,7 @@ contract ExecutorAwareTest is Test { executorAware.addTrustedExecutor(executor2); address[] memory executors = executorAware.getTrustedExecutors(); - + assertTrue(executors.length == 2, "There should be two trusted executors"); assertTrue(executors[0] == executor1 || executors[1] == executor1, "Executor1 should be in the returned list"); assertTrue(executors[0] == executor2 || executors[1] == executor2, "Executor2 should be in the returned list"); @@ -74,7 +74,7 @@ contract ExecutorAwareTest is Test { executorAware.addTrustedExecutor(executor2); uint256 count = executorAware.trustedExecutorsCount(); - + assertTrue(count == 2, "There should be two trusted executors"); } }