Skip to content

Commit

Permalink
Invalid memo exception fix
Browse files Browse the repository at this point in the history
  • Loading branch information
miketout committed Apr 11, 2024
1 parent aa53dc0 commit ddc1e18
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/key_io.cpp
Expand Up @@ -987,6 +987,16 @@ std::vector<unsigned char> VectorEncodeVDXFUni(const UniValue &_obj)

UniValue obj = _obj;

if (!obj.isObject())
{
std::string objStr = uni_get_str(obj);
if (IsHex(objStr))
{
return ParseHex(objStr);
}
return std::vector<unsigned char>(objStr.begin(), objStr.end());
}

std::string serializedHex = uni_get_str(find_value(obj, "serializedhex"));
if (!serializedHex.empty())
{
Expand All @@ -1010,16 +1020,6 @@ std::vector<unsigned char> VectorEncodeVDXFUni(const UniValue &_obj)
return std::vector<unsigned char>(serializedMessage.begin(), serializedMessage.end());
}

if (obj.isStr())
{
std::string objStr = uni_get_str(obj);
if (IsHex(objStr))
{
return ParseHex(objStr);
}
return std::vector<unsigned char>(objStr.begin(), objStr.end());
}

// this should be an object with "vdxfkey" as the key and {object} as the json object to serialize
auto oneValKeys = obj.getKeys();
auto oneValValues = obj.getValues();
Expand Down

0 comments on commit ddc1e18

Please sign in to comment.