From d108b6d0a58de7ac8b9e6ce7decf565d68a3804d Mon Sep 17 00:00:00 2001 From: Michael Heinrichs Date: Thu, 6 Jun 2024 21:48:25 +0200 Subject: [PATCH] fix: Cherry-pick: Enable tokens.balancesInQueries.enabled (#13718) Signed-off-by: Michael Heinrichs --- hedera-node/configuration/mainnet/application.properties | 1 + .../main/java/com/hedera/node/config/data/TokensConfig.java | 2 +- .../impl/test/handlers/CryptoGetAccountInfoHandlerTest.java | 6 ++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hedera-node/configuration/mainnet/application.properties b/hedera-node/configuration/mainnet/application.properties index f4a1eac9185f..4971c147fc44 100644 --- a/hedera-node/configuration/mainnet/application.properties +++ b/hedera-node/configuration/mainnet/application.properties @@ -3,3 +3,4 @@ # hedera-config), this requirement will no longer be valid. # It's used by modular code for property overrides, taking hedera-config/ as the base, # with overrides from this file (configuration/mainnet/application.properties). +ledger.id=0x00 \ No newline at end of file diff --git a/hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/TokensConfig.java b/hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/TokensConfig.java index 53419df82ec9..142341cc366b 100644 --- a/hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/TokensConfig.java +++ b/hedera-node/hedera-config/src/main/java/com/hedera/node/config/data/TokensConfig.java @@ -50,7 +50,7 @@ public record TokensConfig( @ConfigProperty(value = "autoCreations.isEnabled", defaultValue = "true") @NetworkProperty boolean autoCreationsIsEnabled, @ConfigProperty(value = "maxMetadataBytes", defaultValue = "100") @NetworkProperty int tokensMaxMetadataBytes, - @ConfigProperty(value = "balancesInQueries.enabled", defaultValue = "false") @NetworkProperty + @ConfigProperty(value = "balancesInQueries.enabled", defaultValue = "true") @NetworkProperty boolean balancesInQueriesEnabled, @ConfigProperty(value = "nfts.maxBatchSizeUpdate", defaultValue = "10") @NetworkProperty int nftsMaxBatchSizeUpdate) {} diff --git a/hedera-node/hedera-token-service-impl/src/test/java/com/hedera/node/app/service/token/impl/test/handlers/CryptoGetAccountInfoHandlerTest.java b/hedera-node/hedera-token-service-impl/src/test/java/com/hedera/node/app/service/token/impl/test/handlers/CryptoGetAccountInfoHandlerTest.java index 48965edae510..9ef5fba96548 100644 --- a/hedera-node/hedera-token-service-impl/src/test/java/com/hedera/node/app/service/token/impl/test/handlers/CryptoGetAccountInfoHandlerTest.java +++ b/hedera-node/hedera-token-service-impl/src/test/java/com/hedera/node/app/service/token/impl/test/handlers/CryptoGetAccountInfoHandlerTest.java @@ -484,10 +484,8 @@ private void setupStakingRewardsStore() { private void setupConfig(boolean balancesInQueriesEnabled) { final var configBuilder = HederaTestConfigBuilder.create() .withValue("tokens.maxRelsPerInfoQuery", 2) - .withValue("ledger.id", "0x03"); - if (balancesInQueriesEnabled) { - configBuilder.withValue("tokens.balancesInQueries.enabled", true); - } + .withValue("ledger.id", "0x03") + .withValue("tokens.balancesInQueries.enabled", balancesInQueriesEnabled); given(context.configuration()).willReturn(configBuilder.getOrCreateConfig()); }