Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix C-API usage #34

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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