Debug.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include <libethereum/Executive.h>
  3. #include "DebugFace.h"
  4. namespace dev
  5. {
  6. namespace eth
  7. {
  8. class Client;
  9. }
  10. namespace rpc
  11. {
  12. class SessionManager;
  13. class Debug: public DebugFace
  14. {
  15. public:
  16. explicit Debug(eth::Client const& _eth);
  17. virtual RPCModules implementedModules() const override
  18. {
  19. return RPCModules{RPCModule{"debug", "1.0"}};
  20. }
  21. virtual Json::Value debug_traceTransaction(std::string const& _txHash, Json::Value const& _json) override;
  22. virtual Json::Value debug_traceCall(Json::Value const& _call, std::string const& _blockNumber, Json::Value const& _options) override;
  23. virtual Json::Value debug_traceBlockByNumber(int _blockNumber, Json::Value const& _json) override;
  24. virtual Json::Value debug_traceBlockByHash(std::string const& _blockHash, Json::Value const& _json) override;
  25. virtual Json::Value debug_storageRangeAt(std::string const& _blockHashOrNumber, int _txIndex, std::string const& _address, std::string const& _begin, std::string const& _end, int _maxResults) override;
  26. virtual Json::Value debug_traceBlock(std::string const& _blockRlp, Json::Value const& _json);
  27. private:
  28. eth::Client const& m_eth;
  29. h256 blockHash(std::string const& _blockHashOrNumber) const;
  30. Json::Value traceTransaction(dev::eth::Executive& _e, dev::eth::Transaction const& _t, Json::Value const& _json);
  31. Json::Value traceBlock(dev::eth::Block const& _block, Json::Value const& _json);
  32. };
  33. }
  34. }