mirror of
https://github.com/monero-project/monero.git
synced 2025-05-06 14:55:03 -04:00
Change ZMQ-JSON txextra to hex and remove unnecessary base fields
This commit is contained in:
parent
7e78da7772
commit
4e2377995d
5 changed files with 48 additions and 6 deletions
|
@ -94,7 +94,7 @@ namespace
|
|||
|
||||
rapidjson::Document doc;
|
||||
doc.Parse(reinterpret_cast<const char*>(buffer.data()), buffer.size());
|
||||
if (doc.HasParseError() || !doc.IsObject())
|
||||
if (doc.HasParseError())
|
||||
{
|
||||
throw cryptonote::json::PARSE_FAIL();
|
||||
}
|
||||
|
@ -105,6 +105,21 @@ namespace
|
|||
}
|
||||
} // anonymous
|
||||
|
||||
TEST(JsonSerialization, VectorBytes)
|
||||
{
|
||||
EXPECT_EQ(std::vector<std::uint8_t>{}, test_json(std::vector<std::uint8_t>{}));
|
||||
EXPECT_EQ(std::vector<std::uint8_t>{0x00}, test_json(std::vector<std::uint8_t>{0x00}));
|
||||
}
|
||||
|
||||
TEST(JsonSerialization, InvalidVectorBytes)
|
||||
{
|
||||
rapidjson::Document doc;
|
||||
doc.SetString("1");
|
||||
|
||||
std::vector<std::uint8_t> out;
|
||||
EXPECT_THROW(cryptonote::json::fromJsonValue(doc, out), cryptonote::json::BAD_INPUT);
|
||||
}
|
||||
|
||||
TEST(JsonSerialization, MinerTransaction)
|
||||
{
|
||||
cryptonote::account_base acct;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue