Skip to content

Commit

Permalink
fix C-API usage (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni authored Feb 3, 2024
1 parent 7343726 commit 83d6d9f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/kth/js-native/wallet/payment_address.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace kth::js_native {

void wallet_payment_address_construct_from_string(v8::FunctionCallbackInfo<v8::Value> const& args);
void wallet_payment_address_construct_from_hash(v8::FunctionCallbackInfo<v8::Value> const& args);
void wallet_payment_address_construct_from_short_hash(v8::FunctionCallbackInfo<v8::Value> const& args);
void wallet_payment_address_construct_from_public(v8::FunctionCallbackInfo<v8::Value> const& args);
void wallet_payment_address_construct_from_script(v8::FunctionCallbackInfo<v8::Value> const& args);
void wallet_payment_address_destruct(v8::FunctionCallbackInfo<v8::Value> const& args);
Expand Down
2 changes: 1 addition & 1 deletion src/kth-native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ void init(v8::Local<v8::Object> exports) {
NODE_SET_METHOD(exports, "wallet_hd_public_derive_public", wallet_hd_public_derive_public);

NODE_SET_METHOD(exports, "wallet_payment_address_construct_from_string", wallet_payment_address_construct_from_string);
NODE_SET_METHOD(exports, "wallet_payment_address_construct_from_hash", wallet_payment_address_construct_from_hash);
NODE_SET_METHOD(exports, "wallet_payment_address_construct_from_short_hash", wallet_payment_address_construct_from_short_hash);
NODE_SET_METHOD(exports, "wallet_payment_address_construct_from_public", wallet_payment_address_construct_from_public);
NODE_SET_METHOD(exports, "wallet_payment_address_construct_from_script", wallet_payment_address_construct_from_script);
NODE_SET_METHOD(exports, "wallet_payment_address_destruct", wallet_payment_address_destruct);
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/payment_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void wallet_payment_address_construct_from_string(v8::FunctionCallbackInfo<v8::V
args.GetReturnValue().Set(External::New(isolate, res));
}

void wallet_payment_address_construct_from_hash(v8::FunctionCallbackInfo<v8::Value> const& args) {
void wallet_payment_address_construct_from_short_hash(v8::FunctionCallbackInfo<v8::Value> const& args) {
Isolate* isolate = args.GetIsolate();

if (args.Length() != 2) {
Expand Down Expand Up @@ -80,7 +80,7 @@ void wallet_payment_address_construct_from_hash(v8::FunctionCallbackInfo<v8::Val
// uint8_t version = static_cast<uint8_t>(args[1]->NumberValue(isolate->GetCurrentContext()).ToChecked());
uint32_t version = args[1]->IntegerValue(isolate->GetCurrentContext()).ToChecked();

kth_payment_address_t res = kth_wallet_payment_address_construct_from_hash(&hash, version);
kth_payment_address_t res = kth_wallet_payment_address_construct_from_short_hash(&hash, version);
args.GetReturnValue().Set(External::New(isolate, res));
}

Expand Down

0 comments on commit 83d6d9f

Please sign in to comment.