Skip to content

Commit

Permalink
Merge pull request KomodoPlatform#573 from Asherda/release-v1.2.2-3
Browse files Browse the repository at this point in the history
Invalid memo exception fix
  • Loading branch information
Asherda authored Apr 11, 2024
2 parents f400715 + ddc1e18 commit 9a4031f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/key_io.cpp
Original file line number Diff line number Diff line change
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 9a4031f

Please sign in to comment.