diff --git a/src/sdk/main/include/impl/EntityIdHelper.h b/src/sdk/main/include/impl/EntityIdHelper.h index af0874535..f9e2a32b1 100644 --- a/src/sdk/main/include/impl/EntityIdHelper.h +++ b/src/sdk/main/include/impl/EntityIdHelper.h @@ -109,14 +109,6 @@ template */ [[nodiscard]] std::string checksum(std::string_view address, const LedgerId& ledgerId); -/** - * Determine if the input byte array could represent a long-zero address. - * - * @param address The byte array to determine if it could be a long-zero address. - * @return \c TRUE if the input byte array could represent a long-zero address, otherwise \c FALSE. - */ -[[nodiscard]] bool isLongZeroAddress(const std::vector& address); - /** * Decode a Solidity address contained in a string to a byte array. * diff --git a/src/sdk/main/src/AccountId.cc b/src/sdk/main/src/AccountId.cc index cd478a1e7..4e656c42c 100644 --- a/src/sdk/main/src/AccountId.cc +++ b/src/sdk/main/src/AccountId.cc @@ -146,15 +146,7 @@ AccountId AccountId::fromEvmAddress(const EvmAddress& evmAddress, uint64_t shard //----- AccountId AccountId::fromSolidityAddress(std::string_view address) { - const std::vector bytes = internal::EntityIdHelper::decodeSolidityAddress(address); - if (internal::EntityIdHelper::isLongZeroAddress(bytes)) - { - return internal::EntityIdHelper::fromSolidityAddress(bytes); - } - else - { - return fromEvmAddress(address); - } + return fromEvmAddress(address); } //----- @@ -262,7 +254,7 @@ AccountId& AccountId::populateAccountEvmAddress(const Client& client) } // build url for Mirror Node - std::string url = "https://" + mirrorNetworks.front() + "/api/v1/accounts/0.0." + std::to_string(mAccountNum.value()); + std::string url = "https://" + mirrorNetworks.front() + "/api/v1/accounts/" + toString(); // fetch account data for this account from Mirror Node std::string response = internal::HttpClient::invokeREST(url, "GET"); diff --git a/src/sdk/main/src/ContractId.cc b/src/sdk/main/src/ContractId.cc index 63a4bc740..9e34e6803 100644 --- a/src/sdk/main/src/ContractId.cc +++ b/src/sdk/main/src/ContractId.cc @@ -103,15 +103,7 @@ ContractId ContractId::fromEvmAddress(const EvmAddress& evmAddress, uint64_t sha //----- ContractId ContractId::fromSolidityAddress(std::string_view address) { - const std::vector bytes = internal::EntityIdHelper::decodeSolidityAddress(address); - if (internal::EntityIdHelper::isLongZeroAddress(bytes)) - { - return internal::EntityIdHelper::fromSolidityAddress(bytes); - } - else - { - return fromEvmAddress(address); - } + return fromEvmAddress(address); } //----- diff --git a/src/sdk/main/src/impl/EntityIdHelper.cc b/src/sdk/main/src/impl/EntityIdHelper.cc index c66ca439b..649603c7b 100644 --- a/src/sdk/main/src/impl/EntityIdHelper.cc +++ b/src/sdk/main/src/impl/EntityIdHelper.cc @@ -160,21 +160,6 @@ std::string checksum(std::string_view address, const LedgerId& ledgerId) return checksumStr; } -//----- -bool isLongZeroAddress(const std::vector& address) -{ - // The address is a possible long-zero address if the first 12 bytes are zeros. - for (int i = 0; i < 12; ++i) - { - if (address.at(i) != std::byte(0x0)) - { - return false; - } - } - - return true; -} - //----- std::vector decodeSolidityAddress(std::string_view address) { diff --git a/src/sdk/tests/integration/AccountCreateTransactionIntegrationTests.cc b/src/sdk/tests/integration/AccountCreateTransactionIntegrationTests.cc index 10e1babdc..0e931e2d1 100644 --- a/src/sdk/tests/integration/AccountCreateTransactionIntegrationTests.cc +++ b/src/sdk/tests/integration/AccountCreateTransactionIntegrationTests.cc @@ -28,18 +28,6 @@ using namespace Hiero; class AccountCreateTransactionIntegrationTests : public BaseIntegrationTest { -protected: - bool isLongZero(const std::vector address) - { - for (int i = 0; i < 12; i++) - { - if (address[i] != std::byte{ 0 }) - { - return false; - } - } - return true; - } }; //----- @@ -656,10 +644,4 @@ TEST_F(AccountCreateTransactionIntegrationTests, CreateTransactionWithAliasAndKe EXPECT_NO_THROW(txReceipt = txResponse.getReceipt(getTestClient())); ASSERT_EQ(txReceipt.mAccountId.has_value(), true); - AccountId accountId = txReceipt.mAccountId.value(); - - AccountInfo accountInfo; - EXPECT_NO_THROW(accountInfo = AccountInfoQuery().setAccountId(accountId).execute(getTestClient())); - - EXPECT_FALSE(isLongZero(internal::HexConverter::hexToBytes(accountInfo.mContractAccountId))); }