Wrap C++ Key object inside "bitcoin" namespace.

This commit is contained in:
Jeff Garzik 2013-07-09 10:53:04 -04:00
parent 7da3c3b969
commit 7e23e5ba0e
2 changed files with 9 additions and 1 deletions

View File

@ -53,6 +53,8 @@ int static inline EC_KEY_regenerate_key(EC_KEY *eckey, const BIGNUM *priv_key)
return(ok);
}
namespace bitcoin {
void Key::Generate()
{
if (!EC_KEY_generate_key(ec)) {
@ -562,10 +564,12 @@ Key::SignSync(const Arguments& args)
Persistent<FunctionTemplate> Key::s_ct;
}; // namespace bitcoin
extern "C" void
init (Handle<Object> target)
{
Key::Init(target);
bitcoin::Key::Init(target);
}
NODE_MODULE(native, init)

View File

@ -7,6 +7,8 @@
using namespace v8;
using namespace node;
namespace bitcoin {
class Key : ObjectWrap
{
private:
@ -90,4 +92,6 @@ public:
SignSync(const Arguments& args);
};
}; // namespace bitcoin
#endif