-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rob Walworth <[email protected]>
- Loading branch information
Showing
9 changed files
with
1,262 additions
and
1,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
#ifndef HIERO_TCK_CPP_PAUSE_TOKEN_PARAMS_H_ | ||
#define HIERO_TCK_CPP_PAUSE_TOKEN_PARAMS_H_ | ||
|
||
#include "common/CommonTransactionParams.h" | ||
#include "json/JsonUtils.h" | ||
|
||
#include <nlohmann/json.hpp> | ||
#include <optional> | ||
#include <string> | ||
|
||
namespace Hiero::TCK::TokenService | ||
{ | ||
/** | ||
* Struct to hold the arguments for a `pauseToken` JSON-RPC method call. | ||
*/ | ||
struct PauseTokenParams | ||
{ | ||
/** | ||
* The ID of the token to pause. | ||
*/ | ||
std::optional<std::string> mTokenId; | ||
|
||
/** | ||
* Any parameters common to all transaction types. | ||
*/ | ||
std::optional<CommonTransactionParams> mCommonTxParams; | ||
}; | ||
|
||
} // namespace Hiero::TCK::TokenService | ||
|
||
namespace nlohmann | ||
{ | ||
/** | ||
* JSON serializer template specialization required to convert PauseTokenParams arguments properly. | ||
*/ | ||
template<> | ||
struct [[maybe_unused]] adl_serializer<Hiero::TCK::TokenService::PauseTokenParams> | ||
{ | ||
/** | ||
* Convert a JSON object to a PauseTokenParams. | ||
* | ||
* @param jsonFrom The JSON object with which to fill the PauseTokenParams. | ||
* @param params The PauseTokenParams to fill with the JSON object. | ||
*/ | ||
static void from_json(const json& jsonFrom, Hiero::TCK::TokenService::PauseTokenParams& params) | ||
{ | ||
params.mTokenId = Hiero::TCK::getOptionalJsonParameter<std::string>(jsonFrom, "tokenId"); | ||
params.mCommonTxParams = | ||
Hiero::TCK::getOptionalJsonParameter<Hiero::TCK::CommonTransactionParams>(jsonFrom, "commonTransactionParams"); | ||
} | ||
}; | ||
|
||
} // namespace nlohmann | ||
|
||
#endif // HIERO_TCK_CPP_PAUSE_TOKEN_PARAMS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters