CI: more tests

This commit is contained in:
SChernykh
2025-06-22 23:18:36 +02:00
parent e5d487aa50
commit 1b863109f9
3 changed files with 11 additions and 1 deletions

View File

@@ -389,8 +389,8 @@ bool PoolBlock::get_pow_hash(RandomX_Hasher_Base* hasher, uint64_t height, const
root_hash tmp_root;
merkle_hash(m_transactions, tmp_root);
memcpy(blob + blob_size, tmp_root.h, HASH_SIZE);
blob_size += HASH_SIZE;
}
blob_size += HASH_SIZE;
writeVarint(count, [&blob, &blob_size](uint8_t b) { blob[blob_size++] = b; });

View File

@@ -88,6 +88,7 @@ TEST(block_template, update)
tx.weight = 1500;
mempool.add(tx);
}
ASSERT_EQ(mempool.size(), 512);
tpl.update(data, mempool, &wallet);
ASSERT_EQ(tpl.get_reward(), 612054770773ULL);
@@ -123,6 +124,7 @@ TEST(block_template, update)
transactions.push_back(tx);
}
mempool.swap(transactions);
ASSERT_EQ(mempool.size(), 10);
data.aux_chains.emplace_back(H("01f0cf665bd4cd31cbb2b2470236389c483522b350335e10a4a5dca34cb85990"), H("d9de1cfba7cdbd47f12f77addcb39b24c1ae7a16c35372bf28d6aee5d7579ee6"), difficulty_type(1000000));
@@ -160,6 +162,7 @@ TEST(block_template, update)
mempool.add(tx);
}
ASSERT_EQ(mempool.size(), 10000);
tpl.update(data, mempool, &wallet);
ASSERT_EQ(tpl.get_reward(), 619742028747ULL);

View File

@@ -69,6 +69,7 @@ TEST(pool_block, deserialize)
size_t header_size, miner_tx_size;
int outputs_offset, outputs_blob_size;
const std::vector<uint8_t> mainchain_data = b.serialize_mainchain_data(&header_size, &miner_tx_size, &outputs_offset, &outputs_blob_size);
const std::vector<uint8_t> sidechain_data = b.serialize_sidechain_data();
ASSERT_EQ(mainchain_data.size(), 1829U);
ASSERT_EQ(header_size, 43U);
@@ -116,6 +117,12 @@ TEST(pool_block, deserialize)
ASSERT_EQ(b.m_difficulty.check_pow(pow_hash), true);
// Test self-assignment
b = b;
ASSERT_EQ(b.serialize_mainchain_data(), mainchain_data);
ASSERT_EQ(b.serialize_sidechain_data(), sidechain_data);
destroy_crypto_cache();
}