Skip to content

Commit

Permalink
Add TODO processing in integration tests (#309)
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Walworth <[email protected]>
  • Loading branch information
rwalworth authored May 16, 2023
1 parent 6cdd032 commit 01d859c
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions sdk/tests/integration/ContractUpdateTransactionIntegrationTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@
#include "ContractDeleteTransaction.h"
#include "ContractFunctionParameters.h"
#include "ContractId.h"
#include "ContractInfo.h"
#include "ContractInfoQuery.h"
#include "ContractUpdateTransaction.h"
#include "ED25519PrivateKey.h"
#include "FileCreateTransaction.h"
#include "FileDeleteTransaction.h"
#include "FileId.h"
#include "PrivateKey.h"
#include "PublicKey.h"
Expand Down Expand Up @@ -166,7 +169,14 @@ TEST_F(ContractUpdateTransactionIntegrationTest, ExecuteContractUpdateTransactio
.getReceipt(getTestClient()));

// Then
// TODO: ContractInfoQuery
ContractInfo contractInfo;
ASSERT_NO_THROW(contractInfo = ContractInfoQuery().setContractId(contractId).execute(getTestClient()));

ASSERT_NE(contractInfo.mAdminKey, nullptr);
EXPECT_EQ(contractInfo.mAdminKey->toBytesDer(), newAdminKey->getPublicKey()->toBytesDer());
EXPECT_EQ(contractInfo.mAutoRenewPeriod, newAutoRenewPeriod);
EXPECT_EQ(contractInfo.mMemo, newMemo);
EXPECT_TRUE(contractInfo.mStakingInfo.getDeclineReward());

// Clean up
ASSERT_NO_THROW(txReceipt = ContractDeleteTransaction()
Expand All @@ -176,7 +186,8 @@ TEST_F(ContractUpdateTransactionIntegrationTest, ExecuteContractUpdateTransactio
.sign(newAdminKey.get())
.execute(getTestClient())
.getReceipt(getTestClient()));
// TODO: FileDeleteTransaction
ASSERT_NO_THROW(txReceipt =
FileDeleteTransaction().setFileId(fileId).execute(getTestClient()).getReceipt(getTestClient()));
}

//-----
Expand Down Expand Up @@ -222,5 +233,6 @@ TEST_F(ContractUpdateTransactionIntegrationTest, CannotModifyImmutableContract)
ReceiptStatusException); // MODIFYING_IMMUTABLE_CONTRACT

// Clean up
// TODO: FileDeleteTransaction
ASSERT_NO_THROW(const TransactionReceipt txReceipt =
FileDeleteTransaction().setFileId(fileId).execute(getTestClient()).getReceipt(getTestClient()));
}

0 comments on commit 01d859c

Please sign in to comment.