mirror of
https://github.com/monero-project/monero.git
synced 2025-05-08 10:15:04 -04:00
rct: rework serialization to avoid storing vector sizes
This commit is contained in:
parent
0ce79ef10e
commit
7d413f635f
6 changed files with 191 additions and 60 deletions
|
@ -589,6 +589,7 @@ TEST(Serialization, serializes_ringct_types)
|
|||
ASSERT_TRUE(serialization::parse_binary(blob, rg1));
|
||||
ASSERT_TRUE(!memcmp(&rg0, &rg1, sizeof(rg0)));
|
||||
|
||||
#if 0
|
||||
ASSERT_TRUE(serialization::dump_binary(s0, blob));
|
||||
ASSERT_TRUE(serialization::parse_binary(blob, s1));
|
||||
ASSERT_TRUE(s0.type == s1.type);
|
||||
|
@ -621,16 +622,18 @@ TEST(Serialization, serializes_ringct_types)
|
|||
// serialization only does the mask
|
||||
ASSERT_TRUE(!memcmp(&s0.outPk[n].mask, &s1.outPk[n].mask, sizeof(s0.outPk[n].mask)));
|
||||
}
|
||||
#endif
|
||||
|
||||
tx0.set_null();
|
||||
tx0.version = 2;
|
||||
cryptonote::txin_to_key txin_to_key1;
|
||||
txin_to_key1.key_offsets.resize(2);
|
||||
txin_to_key1.key_offsets.resize(4);
|
||||
cryptonote::txin_to_key txin_to_key2;
|
||||
txin_to_key2.key_offsets.resize(2);
|
||||
txin_to_key2.key_offsets.resize(4);
|
||||
tx0.vin.push_back(txin_to_key1);
|
||||
tx0.vin.push_back(txin_to_key2);
|
||||
tx0.vout.push_back(cryptonote::tx_out());
|
||||
tx0.vout.push_back(cryptonote::tx_out());
|
||||
tx0.rct_signatures = s0;
|
||||
ASSERT_EQ(tx0.rct_signatures.p.rangeSigs.size(), 2);
|
||||
ASSERT_TRUE(serialization::dump_binary(tx0, blob));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue