diff --git a/src/sdk/main/src/AccountUpdateTransaction.cc b/src/sdk/main/src/AccountUpdateTransaction.cc index 3a21a5019..9280b66d8 100644 --- a/src/sdk/main/src/AccountUpdateTransaction.cc +++ b/src/sdk/main/src/AccountUpdateTransaction.cc @@ -258,7 +258,10 @@ proto::CryptoUpdateTransactionBody* AccountUpdateTransaction::build() const { auto body = std::make_unique(); - body->set_allocated_accountidtoupdate(mAccountId.toProtobuf().release()); + if (!(mAccountId == AccountId())) + { + body->set_allocated_accountidtoupdate(mAccountId.toProtobuf().release()); + } if (mKey) { diff --git a/src/sdk/tests/integration/AccountUpdateTransactionIntegrationTests.cc b/src/sdk/tests/integration/AccountUpdateTransactionIntegrationTests.cc index 3c21dfddf..47698a138 100644 --- a/src/sdk/tests/integration/AccountUpdateTransactionIntegrationTests.cc +++ b/src/sdk/tests/integration/AccountUpdateTransactionIntegrationTests.cc @@ -31,6 +31,7 @@ #include "TransactionReceipt.h" #include "TransactionResponse.h" #include "TransferTransaction.h" +#include "exceptions/PrecheckStatusException.h" #include "exceptions/ReceiptStatusException.h" #include @@ -158,7 +159,7 @@ TEST_F(AccountUpdateTransactionIntegrationTests, CannotUpdateAccountWithoutAccou .sign(privateKey) .execute(getTestClient()) .getReceipt(getTestClient()), - ReceiptStatusException); // ACCOUNT_ID_DOES_NOT_EXIST + PrecheckStatusException); // ACCOUNT_ID_DOES_NOT_EXIST // Clean up ASSERT_NO_THROW(AccountDeleteTransaction()