Skip to content

Commit e18fdc8

Browse files
committed
address review feedback
Signed-off-by: Xin Li <xin@hashgraph.com>
1 parent c161a9e commit e18fdc8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

common/src/main/java/org/hiero/mirror/common/util/DomainUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,8 @@ public static byte[] trim(final byte[] data) {
341341
}
342342

343343
public static ByteString trim(final ByteString data) {
344-
if (data == null) {
345-
return null;
344+
if (data == null || data.isEmpty() || data.byteAt(0) != 0) {
345+
return data;
346346
}
347347

348348
final byte[] value = DomainUtils.toBytes(data);

common/src/test/java/org/hiero/mirror/common/util/DomainUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
import org.junit.jupiter.params.provider.NullAndEmptySource;
4545
import org.junit.jupiter.params.provider.ValueSource;
4646

47-
class DomainUtilsTest {
47+
final class DomainUtilsTest {
4848

4949
private static final String ED25519_KEY = "60beee88a761e079f71b03b5fe041979369e96450a7455b203a2578c8a7d4852";
5050
private static final String ECDSA_384_KEY = "0000001365636473612d736861322d6e69737470333834000000086e697374703338"

importer/src/test/java/org/hiero/mirror/importer/parser/domain/BlockTransactionBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ private ByteString getEvmAddress(ContractID contractId) {
885885
}
886886

887887
private ByteString leftPad(ByteString value) {
888-
if (random.nextInt() % 2 == 0) {
888+
if (random.nextBoolean()) {
889889
return value;
890890
}
891891

0 commit comments

Comments
 (0)