final modifications to adding endpoints import_encrypted_key_images and export_encrypted_key_images

This commit is contained in:
who asks? 2024-07-18 21:18:56 -06:00
parent c5822d77ce
commit 75c14c8b45
2 changed files with 1 additions and 13 deletions

View File

@ -3021,19 +3021,7 @@ bool wallet_rpc_server::on_import_encrypted_key_images(const wallet_rpc::COMMAND
return false;
}
std::cout << "encrypted_key_images_blob: " << req.encrypted_key_images_blob << std::endl;
std::cout << "data: " << data << std::endl;
// Debug: Print the first few bytes of the decoded data
std::cout << "First 32 bytes of decoded data: ";
for (size_t i = 0; i < std::min(data.size(), size_t(32)); ++i) {
std::cout << std::hex << std::setw(2) << std::setfill('0') << (int)(unsigned char)data[i];
}
std::cout << std::endl;
const size_t magiclen = strlen(KEY_IMAGE_EXPORT_FILE_MAGIC);
std::cout << "Magic length: " << magiclen << std::endl;
std::cout << "Expected magic: ";
if (data.size() < magiclen || memcmp(data.data(), KEY_IMAGE_EXPORT_FILE_MAGIC, magiclen))
{
er.code = WALLET_RPC_ERROR_CODE_WRONG_KEY_IMAGE;

View File

@ -1858,7 +1858,7 @@ namespace tools
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_OPT(offset, (uint32_t)0)
KV_SERIALIZE_OPT(encrypted_key_images_blob, "WTF")
KV_SERIALIZE(encrypted_key_images_blob)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;