Skip to content

Commit 2dd6509

Browse files
committed
fix: integration tests
Signed-off-by: Rob Walworth <robert.walworth@swirldslabs.com>
1 parent 3a9ea8f commit 2dd6509

File tree

5 files changed

+66
-7
lines changed

5 files changed

+66
-7
lines changed

HieroApi.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
set(HAPI_VERSION_TAG "v0.72.0" CACHE STRING "Use the configured version tag for the Hiero API protobufs")
1+
set(HAPI_VERSION_TAG "v0.73.0-rc.1" CACHE STRING "Use the configured version tag for the Hiero API protobufs")
22
set(HAPI_COMMIT_HASH "" CACHE STRING "Use the configured commit hash for the Hiero API protobufs (overrides version tag if provided)")
33

44
if (HAPI_VERSION_TAG STREQUAL "")
5-
set(HAPI_VERSION_TAG "v0.72.0")
5+
set(HAPI_VERSION_TAG "v0.73.0-rc.1")
66
endif ()
77

88
# Use commit hash if provided, otherwise use version tag

src/sdk/main/include/Status.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2039,7 +2039,43 @@ enum class Status
20392039
/**
20402040
* The number of hook invocations exceeds the maximum allowed per transaction.
20412041
*/
2042-
TOO_MANY_HOOK_INVOCATIONS
2042+
TOO_MANY_HOOK_INVOCATIONS,
2043+
2044+
/**
2045+
* The registered node ID supplied does not exist or has been deleted.
2046+
*/
2047+
INVALID_REGISTERED_NODE_ID,
2048+
2049+
/**
2050+
* A registered service endpoint is invalid (malformed or missing required fields).
2051+
*/
2052+
INVALID_REGISTERED_ENDPOINT,
2053+
2054+
/**
2055+
* The number of registered service endpoints exceeds the maximum allowed.
2056+
*/
2057+
REGISTERED_ENDPOINTS_EXCEEDED_LIMIT,
2058+
2059+
/**
2060+
* A registered service endpoint has an invalid IP address or domain name.
2061+
*/
2062+
INVALID_REGISTERED_ENDPOINT_ADDRESS,
2063+
2064+
/**
2065+
* A registered service endpoint has an invalid or unrecognized endpoint type.
2066+
*/
2067+
INVALID_REGISTERED_ENDPOINT_TYPE,
2068+
2069+
/**
2070+
* The registered node cannot be deleted because it is still associated with one or more
2071+
* consensus nodes.
2072+
*/
2073+
REGISTERED_NODE_STILL_ASSOCIATED,
2074+
2075+
/**
2076+
* The maximum number of registered nodes has been reached.
2077+
*/
2078+
MAX_REGISTERED_NODES_EXCEEDED
20432079
};
20442080

20452081
/**

src/sdk/main/src/Status.cc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,13 @@ Status::INVALID_SERIALIZED_TX_MESSAGE_HASH_ALGORITHM },
426426
{ proto::ResponseCodeEnum::TRANSFER_TO_FEE_COLLECTION_ACCOUNT_NOT_ALLOWED,
427427
Status::TRANSFER_TO_FEE_COLLECTION_ACCOUNT_NOT_ALLOWED },
428428
{ proto::ResponseCodeEnum::TOO_MANY_HOOK_INVOCATIONS, Status::TOO_MANY_HOOK_INVOCATIONS },
429+
{ static_cast<proto::ResponseCodeEnum>(529), Status::INVALID_REGISTERED_NODE_ID },
430+
{ static_cast<proto::ResponseCodeEnum>(530), Status::INVALID_REGISTERED_ENDPOINT },
431+
{ static_cast<proto::ResponseCodeEnum>(531), Status::REGISTERED_ENDPOINTS_EXCEEDED_LIMIT },
432+
{ static_cast<proto::ResponseCodeEnum>(532), Status::INVALID_REGISTERED_ENDPOINT_ADDRESS },
433+
{ static_cast<proto::ResponseCodeEnum>(533), Status::INVALID_REGISTERED_ENDPOINT_TYPE },
434+
{ static_cast<proto::ResponseCodeEnum>(534), Status::REGISTERED_NODE_STILL_ASSOCIATED },
435+
{ static_cast<proto::ResponseCodeEnum>(535), Status::MAX_REGISTERED_NODES_EXCEEDED },
429436
};
430437

431438
//-----
@@ -845,6 +852,13 @@ const std::unordered_map<Status, proto::ResponseCodeEnum> gStatusToProtobufRespo
845852
{ Status::TRANSFER_TO_FEE_COLLECTION_ACCOUNT_NOT_ALLOWED,
846853
proto::ResponseCodeEnum::TRANSFER_TO_FEE_COLLECTION_ACCOUNT_NOT_ALLOWED },
847854
{ Status::TOO_MANY_HOOK_INVOCATIONS, proto::ResponseCodeEnum::TOO_MANY_HOOK_INVOCATIONS },
855+
{ Status::INVALID_REGISTERED_NODE_ID, static_cast<proto::ResponseCodeEnum>(529) },
856+
{ Status::INVALID_REGISTERED_ENDPOINT, static_cast<proto::ResponseCodeEnum>(530) },
857+
{ Status::REGISTERED_ENDPOINTS_EXCEEDED_LIMIT, static_cast<proto::ResponseCodeEnum>(531) },
858+
{ Status::INVALID_REGISTERED_ENDPOINT_ADDRESS, static_cast<proto::ResponseCodeEnum>(532) },
859+
{ Status::INVALID_REGISTERED_ENDPOINT_TYPE, static_cast<proto::ResponseCodeEnum>(533) },
860+
{ Status::REGISTERED_NODE_STILL_ASSOCIATED, static_cast<proto::ResponseCodeEnum>(534) },
861+
{ Status::MAX_REGISTERED_NODES_EXCEEDED, static_cast<proto::ResponseCodeEnum>(535) },
848862
};
849863

850864
//-----
@@ -1243,6 +1257,13 @@ const std::unordered_map<Status, std::string> gStatusToString = {
12431257
{ Status::TRANSFER_TO_FEE_COLLECTION_ACCOUNT_NOT_ALLOWED,
12441258
"TRANSFER_TO_FEE_COLLECTION_ACCOUNT_NOT_ALLOWED" },
12451259
{ Status::TOO_MANY_HOOK_INVOCATIONS, "TOO_MANY_HOOK_INVOCATIONS" },
1260+
{ Status::INVALID_REGISTERED_NODE_ID, "INVALID_REGISTERED_NODE_ID" },
1261+
{ Status::INVALID_REGISTERED_ENDPOINT, "INVALID_REGISTERED_ENDPOINT" },
1262+
{ Status::REGISTERED_ENDPOINTS_EXCEEDED_LIMIT, "REGISTERED_ENDPOINTS_EXCEEDED_LIMIT" },
1263+
{ Status::INVALID_REGISTERED_ENDPOINT_ADDRESS, "INVALID_REGISTERED_ENDPOINT_ADDRESS" },
1264+
{ Status::INVALID_REGISTERED_ENDPOINT_TYPE, "INVALID_REGISTERED_ENDPOINT_TYPE" },
1265+
{ Status::REGISTERED_NODE_STILL_ASSOCIATED, "REGISTERED_NODE_STILL_ASSOCIATED" },
1266+
{ Status::MAX_REGISTERED_NODES_EXCEEDED, "MAX_REGISTERED_NODES_EXCEEDED" },
12461267
};
12471268

12481269
} // namespace Hiero

src/sdk/tests/integration/RegisteredNodeDeleteTransactionIntegrationTests.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "TransactionReceipt.h"
1010
#include "TransactionResponse.h"
1111
#include "exceptions/PrecheckStatusException.h"
12+
#include "exceptions/ReceiptStatusException.h"
1213

1314
#include <gtest/gtest.h>
1415

@@ -82,7 +83,7 @@ TEST_F(RegisteredNodeDeleteTransactionIntegrationTests,
8283
.sign(adminKey)
8384
.execute(getTestClient())
8485
.getReceipt(getTestClient()),
85-
PrecheckStatusException);
86+
ReceiptStatusException);
8687
}
8788

8889
//-----
@@ -100,7 +101,7 @@ TEST_F(RegisteredNodeDeleteTransactionIntegrationTests,
100101
.sign(adminKey)
101102
.execute(getTestClient())
102103
.getReceipt(getTestClient()),
103-
PrecheckStatusException);
104+
ReceiptStatusException);
104105
}
105106

106107
//-----

src/sdk/tests/integration/RegisteredNodeUpdateTransactionIntegrationTests.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "TransactionReceipt.h"
99
#include "TransactionResponse.h"
1010
#include "exceptions/PrecheckStatusException.h"
11+
#include "exceptions/ReceiptStatusException.h"
1112

1213
#include <gtest/gtest.h>
1314

@@ -123,7 +124,7 @@ TEST_F(RegisteredNodeUpdateTransactionIntegrationTests,
123124
.sign(oldAdminKey) // only old key — should fail
124125
.execute(getTestClient())
125126
.getReceipt(getTestClient()),
126-
PrecheckStatusException);
127+
ReceiptStatusException);
127128
}
128129

129130
//-----
@@ -142,5 +143,5 @@ TEST_F(RegisteredNodeUpdateTransactionIntegrationTests,
142143
.sign(adminKey)
143144
.execute(getTestClient())
144145
.getReceipt(getTestClient()),
145-
PrecheckStatusException);
146+
ReceiptStatusException);
146147
}

0 commit comments

Comments
 (0)