Skip to content

Commit

Permalink
Fix get token default kyc status test for modularized (#10549)
Browse files Browse the repository at this point in the history
 Fix Then I call function with HederaTokenService getTokenDefaultKycStatus token FUNGIBLE for modularized services

Signed-off-by: Kristiyan Selveliev <[email protected]>
  • Loading branch information
kselveliev authored Mar 6, 2025
1 parent 6335082 commit 4ad4aef
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import com.hedera.mirror.test.e2e.acceptance.client.AccountClient.AccountNameEnum;
import com.hedera.mirror.test.e2e.acceptance.client.MirrorNodeClient;
import com.hedera.mirror.test.e2e.acceptance.client.TokenClient;
import com.hedera.mirror.test.e2e.acceptance.config.Web3Properties;
import com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId;
import io.cucumber.java.en.And;
import io.cucumber.java.en.Given;
Expand All @@ -73,6 +74,7 @@ public class CallFeature extends AbstractFeature {
private final AccountClient accountClient;
private final MirrorNodeClient mirrorClient;
private final TokenClient tokenClient;
private final Web3Properties web3Properties;
private DeployedContract deployedErcTestContract;
private DeployedContract deployedEstimatePrecompileContract;
private String ercContractAddress;
Expand Down Expand Up @@ -319,8 +321,14 @@ public void htsGetTokenDefaultFreezeStatus() {
public void htsGetTokenDefaultKycStatus() {
var data = encodeData(PRECOMPILE, HTS_GET_TOKEN_DEFAULT_KYC_STATUS_SELECTOR, asAddress(fungibleTokenId));
var response = callContract(data, precompileContractAddress);

assertThat(response.getResultAsBoolean()).isFalse();
boolean defaultKycStatus = false;
// In the modularized code, the status is now true when the token has a KycNotApplicable status,
// whereas the mono logic returns false. We need to toggle the status based on the modularized flag.
if (web3Properties.isModularizedServices()) {
defaultKycStatus = !defaultKycStatus;
}

assertThat(response.getResultAsBoolean()).isEqualTo(defaultKycStatus);
}

@Then("I call function with update and I expect return of the updated value")
Expand Down

0 comments on commit 4ad4aef

Please sign in to comment.