Added BlockTemplate tests

This commit is contained in:
SChernykh
2022-11-24 21:38:15 +01:00
parent 9283677a2b
commit 4bb1982806
6 changed files with 133 additions and 22 deletions
+6 -3
View File
@@ -23,7 +23,8 @@
namespace p2pool {
class p2pool;
class SideChain;
class RandomX_Hasher_Base;
class Mempool;
class Wallet;
struct PoolBlock;
@@ -32,7 +33,7 @@ struct MinerShare;
class BlockTemplate
{
public:
explicit BlockTemplate(p2pool* pool);
explicit BlockTemplate(SideChain* sidechain, RandomX_Hasher_Base* hasher);
~BlockTemplate();
BlockTemplate(const BlockTemplate& b);
@@ -55,9 +56,11 @@ public:
void submit_sidechain_block(uint32_t template_id, uint32_t nonce, uint32_t extra_nonce);
FORCEINLINE const std::vector<MinerShare>& shares() const { return m_shares; }
FORCEINLINE const PoolBlock* pool_block_template() const { return m_poolBlockTemplate; }
private:
p2pool* m_pool;
SideChain* m_sidechain;
RandomX_Hasher_Base* m_hasher;
private:
int create_miner_tx(const MinerData& data, const std::vector<MinerShare>& shares, uint64_t max_reward_amounts_weight, bool dry_run);