sealengines throught init function

This commit is contained in:
Dimitry 2016-04-11 14:24:11 +04:00
parent 054bc2a6ac
commit 24120a726c

View File

@ -32,6 +32,8 @@
#include <libethereum/ChainParams.h> #include <libethereum/ChainParams.h>
#include <libsolidity/interface/CompilerStack.h> #include <libsolidity/interface/CompilerStack.h>
#include <libsolidity/interface/Exceptions.h> #include <libsolidity/interface/Exceptions.h>
#include <libethcore/BasicAuthority.h>
#include <libethcore/SealEngine.h>
namespace dev namespace dev
{ {
@ -45,6 +47,7 @@ class ExecutionFramework
{ {
public: public:
ExecutionFramework(): ExecutionFramework():
m_sealEngineInit(),
m_sealEngine(eth::ChainParams().createSealEngine()), m_sealEngine(eth::ChainParams().createSealEngine()),
m_state(0) m_state(0)
{ {
@ -236,6 +239,17 @@ public:
}; };
private: private:
struct sealEngineInit
{
sealEngineInit()
{
dev::eth::BasicAuthority::init();
dev::eth::NoProof::init();
}
};
sealEngineInit m_sealEngineInit;
template <class CppFunction, class... Args> template <class CppFunction, class... Args>
auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments)
-> typename std::enable_if<std::is_void<decltype(_cppFunction(_arguments...))>::value, bytes>::type -> typename std::enable_if<std::is_void<decltype(_cppFunction(_arguments...))>::value, bytes>::type