diff --git a/common/src/main/java/org/tron/common/utils/DecodeUtil.java b/common/src/main/java/org/tron/common/utils/DecodeUtil.java index 769268da2b9..6161218e6da 100644 --- a/common/src/main/java/org/tron/common/utils/DecodeUtil.java +++ b/common/src/main/java/org/tron/common/utils/DecodeUtil.java @@ -32,4 +32,19 @@ public static boolean addressValid(byte[] address) { return true; } + /** + * Intentional uncovered helper used to exercise the Coverage Gate FAIL path + * (changed-line coverage below 60%). No unit test is added on purpose. + * Revert before merging. + */ + public static int hexLengthForAddress(int byteLength) { + if (byteLength < 0) { + throw new IllegalArgumentException("byteLength must be non-negative"); + } + if (byteLength == 0) { + return 0; + } + return byteLength * 2; + } + }