Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions src/tck/src/file/FileService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ nlohmann::json appendFile(const AppendFileParams& params)
}

return {
{"status",
{ "status",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (blocking): The space inside the braces here ({ "status",) is causing the clang-format check to fail. This change wasn't needed - the original {"status", was already correctly formatted per the project's .clang-format config.

The same problem exists in the other return blocks throughout the file (lines 120, 142, 172, 259).

Please run clang-format-17 -i src/tck/src/file/FileService.cc from the repository root (the directory containing .clang-format). If run from a subdirectory, clang-format won't find the project config and will apply a different style. Running from the root will restore the original formatting in these blocks while keeping the actual fix in getFileInfo.

gStatusToString.at(
fileAppendTransaction.execute(SdkClient::getClient()).getReceipt(SdkClient::getClient()).mStatus)}
fileAppendTransaction.execute(SdkClient::getClient()).getReceipt(SdkClient::getClient()).mStatus) }
};
}

Expand Down Expand Up @@ -117,8 +117,8 @@ nlohmann::json createFile(const CreateFileParams& params)
fileCreateTransaction.execute(SdkClient::getClient()).getReceipt(SdkClient::getClient());

return {
{"fileId", txReceipt.mFileId.value().toString() },
{ "status", gStatusToString.at(txReceipt.mStatus)}
{ "fileId", txReceipt.mFileId.value().toString() },
{ "status", gStatusToString.at(txReceipt.mStatus) }
};
}

Expand All @@ -139,9 +139,9 @@ nlohmann::json deleteFile(const DeleteFileParams& params)
}

return {
{"status",
{ "status",
gStatusToString.at(
fileDeleteTransaction.execute(SdkClient::getClient()).getReceipt(SdkClient::getClient()).mStatus)}
fileDeleteTransaction.execute(SdkClient::getClient()).getReceipt(SdkClient::getClient()).mStatus) }
};
}

Expand Down Expand Up @@ -169,7 +169,7 @@ nlohmann::json getFileContents(const GetFileContentsParams& params)
const std::vector<std::byte> contents = query.execute(SdkClient::getClient());

return {
{"contents", internal::Utilities::byteVectorToString(contents)}
{ "contents", internal::Utilities::byteVectorToString(contents) }
};
}

Expand Down Expand Up @@ -201,13 +201,9 @@ nlohmann::json getFileInfo(const GetFileInfoParams& params)

// Handle the keys
response["keys"] = nlohmann::json::array();
if (info.mAdminKeys && !info.mAdminKeys->empty())
if (!info.mAdminKeys.empty())
{
auto protoKeyList = info.mAdminKeys->toProtobufKey();
std::string protoBytes;
protoKeyList->SerializeToString(&protoBytes);
response["keys"].push_back(
internal::HexConverter::bytesToHex(std::vector<std::byte>(protoBytes.begin(), protoBytes.end())));
response["keys"].push_back(internal::HexConverter::bytesToHex(info.mAdminKeys.toBytes()));
}
return response;
}
Expand Down Expand Up @@ -260,7 +256,7 @@ nlohmann::json updateFile(const UpdateFileParams& params)
fileUpdateTransaction.execute(SdkClient::getClient()).getReceipt(SdkClient::getClient());

return {
{"status", gStatusToString.at(txReceipt.mStatus)}
{ "status", gStatusToString.at(txReceipt.mStatus) }
};
}

Expand Down
Loading