danicoin/tests/IntegrationTestLib/RPCTestNode.h

40 lines
1.2 KiB
C
Raw Normal View History

// Copyright (c) 2011-2016 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include <stdint.h>
#include <System/Dispatcher.h>
#include "HTTP/HttpRequest.h"
#include "HTTP/HttpResponse.h"
2015-07-30 15:22:07 +00:00
#include "Rpc/HttpClient.h"
#include "TestNode.h"
2015-07-30 15:22:07 +00:00
using namespace CryptoNote;
namespace Tests {
2015-07-30 15:22:07 +00:00
class RPCTestNode : public TestNode {
public:
2015-07-30 15:22:07 +00:00
RPCTestNode(uint16_t port, System::Dispatcher& d);
virtual bool startMining(size_t threadsCount, const std::string& address) override;
virtual bool stopMining() override;
virtual bool stopDaemon() override;
2015-07-30 15:22:07 +00:00
virtual bool getBlockTemplate(const std::string& minerAddress, CryptoNote::Block& blockTemplate, uint64_t& difficulty) override;
virtual bool submitBlock(const std::string& block) override;
2015-07-30 15:22:07 +00:00
virtual bool getTailBlockId(Crypto::Hash& tailBlockId) override;
virtual bool makeINode(std::unique_ptr<CryptoNote::INode>& node) override;
2015-07-30 15:22:07 +00:00
virtual uint64_t getLocalHeight() override;
virtual ~RPCTestNode() { }
private:
uint16_t m_rpcPort;
System::Dispatcher& m_dispatcher;
2015-07-30 15:22:07 +00:00
CryptoNote::HttpClient m_httpClient;
};
}