From 674c0ceb69d410096f76168f22d80f465ee0c715 Mon Sep 17 00:00:00 2001 From: Xin Li <59580070+xin-hedera@users.noreply.github.com> Date: Mon, 22 Jul 2024 11:11:09 -0500 Subject: [PATCH] Update unlimited associations proto version to 0.53 in web3 (#8847) - Update unlimited associations proto version to 0.53 in web3 Signed-off-by: Xin Li --- .../mirror/common/domain/transaction/RecordFile.java | 2 +- .../services/txns/crypto/AbstractAutoCreationLogic.java | 2 +- .../services/txns/crypto/AutoCreationLogicTest.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hedera-mirror-common/src/main/java/com/hedera/mirror/common/domain/transaction/RecordFile.java b/hedera-mirror-common/src/main/java/com/hedera/mirror/common/domain/transaction/RecordFile.java index 91517e17384..09ea586f300 100644 --- a/hedera-mirror-common/src/main/java/com/hedera/mirror/common/domain/transaction/RecordFile.java +++ b/hedera-mirror-common/src/main/java/com/hedera/mirror/common/domain/transaction/RecordFile.java @@ -49,7 +49,7 @@ public class RecordFile implements StreamFile { public static final Version HAPI_VERSION_0_27_0 = new Version(0, 27, 0); public static final Version HAPI_VERSION_0_47_0 = new Version(0, 47, 0); public static final Version HAPI_VERSION_0_49_0 = new Version(0, 49, 0); - public static final Version HAPI_VERSION_0_52_0 = new Version(0, 52, 0); + public static final Version HAPI_VERSION_0_53_0 = new Version(0, 53, 0); @ToString.Exclude private byte[] bytes; diff --git a/hedera-mirror-web3/src/main/java/com/hedera/services/txns/crypto/AbstractAutoCreationLogic.java b/hedera-mirror-web3/src/main/java/com/hedera/services/txns/crypto/AbstractAutoCreationLogic.java index 7cdaa9fc367..e77b5973d1d 100644 --- a/hedera-mirror-web3/src/main/java/com/hedera/services/txns/crypto/AbstractAutoCreationLogic.java +++ b/hedera-mirror-web3/src/main/java/com/hedera/services/txns/crypto/AbstractAutoCreationLogic.java @@ -157,7 +157,7 @@ public Pair create( private int getMaxAutoAssociations(final ByteString alias, final List changes) { var recordFile = ContractCallContext.get().getRecordFile(); - if (recordFile != null && recordFile.getHapiVersion().isGreaterThanOrEqualTo(RecordFile.HAPI_VERSION_0_52_0)) { + if (recordFile != null && recordFile.getHapiVersion().isGreaterThanOrEqualTo(RecordFile.HAPI_VERSION_0_53_0)) { return Account.UNLIMITED_AUTO_ASSOCIATIONS; } diff --git a/hedera-mirror-web3/src/test/java/com/hedera/services/txns/crypto/AutoCreationLogicTest.java b/hedera-mirror-web3/src/test/java/com/hedera/services/txns/crypto/AutoCreationLogicTest.java index 3390378c785..1ac7281cfcd 100644 --- a/hedera-mirror-web3/src/test/java/com/hedera/services/txns/crypto/AutoCreationLogicTest.java +++ b/hedera-mirror-web3/src/test/java/com/hedera/services/txns/crypto/AutoCreationLogicTest.java @@ -167,9 +167,9 @@ void cannotCreateAccountFromUnaliasedChange() { @SneakyThrows @ParameterizedTest @CsvSource(textBlock = """ + 54, -1 53, -1 - 52, -1 - 51, 0 + 52, 0 """) void hollowAccountWithHbarChangeWorks(int hapiMinorVersion, int expectedMaxAutoAssociations) { final var jKey = mapKey(Key.parseFrom(ECDSA_PUBLIC_KEY)); @@ -209,9 +209,9 @@ void hollowAccountWithHbarChangeWorks(int hapiMinorVersion, int expectedMaxAutoA @SneakyThrows @ParameterizedTest @CsvSource(textBlock = """ + 54, -1 53, -1 - 52, -1 - 51, 1 + 52, 1 """) void happyPathWithFungibleTokenChangeWorks(int hapiMinorVersion, int expectedMaxAutoAssociations) { Key aPrimitiveKey = Key.newBuilder()