Browse Source

libjsonconsole fix

cl-refactor
Marek Kotewicz 10 years ago
parent
commit
44c3e7b914
  1. 2
      eth/main.cpp
  2. 5
      libjsconsole/JSConsole.cpp
  3. 4
      libjsconsole/JSConsole.h

2
eth/main.cpp

@ -1765,7 +1765,7 @@ int main(int argc, char** argv)
if (useConsole) if (useConsole)
{ {
#if ETH_JSCONSOLE #if ETH_JSCONSOLE
JSConsole console(web3, vector<KeyPair>({sigKey})); JSConsole console(web3, make_shared<SimpleAccountHolder>([&](){return web3.ethereum();}, getAccountPassword, keyManager));
while (!g_exit) while (!g_exit)
{ {
console.repl(); console.repl();

5
libjsconsole/JSConsole.cpp

@ -25,7 +25,6 @@
#include <libweb3jsonrpc/WebThreeStubServer.h> #include <libweb3jsonrpc/WebThreeStubServer.h>
#include "JSConsole.h" #include "JSConsole.h"
#include "JSV8Connector.h" #include "JSV8Connector.h"
#include "libjsconsole/JSConsoleResources.hpp"
// TODO! make readline optional! // TODO! make readline optional!
#include <readline/readline.h> #include <readline/readline.h>
@ -35,12 +34,12 @@ using namespace std;
using namespace dev; using namespace dev;
using namespace dev::eth; using namespace dev::eth;
JSConsole::JSConsole(WebThreeDirect& _web3, std::vector<dev::KeyPair> const& _accounts): JSConsole::JSConsole(WebThreeDirect& _web3, shared_ptr<AccountHolder> const& _accounts):
m_engine(), m_engine(),
m_printer(m_engine) m_printer(m_engine)
{ {
m_jsonrpcConnector.reset(new JSV8Connector(m_engine)); m_jsonrpcConnector.reset(new JSV8Connector(m_engine));
m_jsonrpcServer.reset(new WebThreeStubServer(*m_jsonrpcConnector.get(), _web3, _accounts)); m_jsonrpcServer.reset(new WebThreeStubServer(*m_jsonrpcConnector.get(), _web3, _accounts, vector<KeyPair>()));
} }
JSConsole::~JSConsole() {} JSConsole::~JSConsole() {}

4
libjsconsole/JSConsole.h

@ -33,10 +33,12 @@ namespace dev
namespace eth namespace eth
{ {
class AccountHolder;
class JSConsole class JSConsole
{ {
public: public:
JSConsole(WebThreeDirect& _web3, std::vector<dev::KeyPair> const& _accounts); JSConsole(WebThreeDirect& _web3, std::shared_ptr<AccountHolder> const& _accounts);
~JSConsole(); ~JSConsole();
void repl() const; void repl() const;

Loading…
Cancel
Save