Skip to content

Commit

Permalink
bump C-API version
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni committed May 27, 2024
1 parent 1a03612 commit be5ccf0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class KnuthJsNative(ConanFile):
description = "Bitcoin full node as a Javascript library"
settings = "os", "compiler", "build_type", "arch"

requires = (("c-api/0.45.0"))
requires = (("c-api/0.46.0"))

def configure(self):
self.options["c-api/*"].march_id = "ZLm9Pjh"
2 changes: 1 addition & 1 deletion install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# import pandas as pd


capi_version = "0.45.0"
capi_version = "0.46.0"

def install(package):
print("Installing ")
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@knuth/bch-native",
"version": "1.2.0",
"version": "1.3.0",
"description": "Foundation library for @knuth/bch (Bitcoin Cash development platform for Javascript applications)",
"repository": {
"type": "git",
Expand Down
10 changes: 6 additions & 4 deletions src/config/blockchain_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,11 @@ Local<Object> config_blockchain_settings_to_js(Isolate* isolate, kth_blockchain_
setr = res->Set(ctx, string_to_js(isolate, "bchEuler"), Boolean::New(isolate, setts.bch_euler != 0));
setr = res->Set(ctx, string_to_js(isolate, "bchGauss"), Boolean::New(isolate, setts.bch_gauss != 0));
setr = res->Set(ctx, string_to_js(isolate, "bchDescartes"), Boolean::New(isolate, setts.bch_descartes != 0));
// setr = res->Set(ctx, string_to_js(isolate, "bchLobachevski"), Boolean::New(isolate, setts.bch_lobachevski != 0));
setr = res->Set(ctx, string_to_js(isolate, "bchLobachevski"), Boolean::New(isolate, setts.bch_lobachevski != 0));
// setr = res->Set(ctx, string_to_js(isolate, "bchGalois"), Boolean::New(isolate, setts.bch_galois != 0));

setr = res->Set(ctx, string_to_js(isolate, "lobachevskiActivationTime"), Number::New(isolate, setts.lobachevski_activation_time));
setr = res->Set(ctx, string_to_js(isolate, "galoisActivationTime"), Number::New(isolate, setts.galois_activation_time));
setr = res->Set(ctx, string_to_js(isolate, "leibnizActivationTime"), Number::New(isolate, setts.leibniz_activation_time));

setr = res->Set(ctx, string_to_js(isolate, "asertHalfLife"), Number::New(isolate, setts.asert_half_life));
return res;
Expand Down Expand Up @@ -167,10 +168,11 @@ kth_blockchain_settings config_blockchain_settings_to_cpp(Isolate* isolate, Loca
res.bch_euler = bool_to_cpp(isolate, setts->Get(ctx, string_to_js(isolate, "bchEuler")).ToLocalChecked());
res.bch_gauss = bool_to_cpp(isolate, setts->Get(ctx, string_to_js(isolate, "bchGauss")).ToLocalChecked());
res.bch_descartes = bool_to_cpp(isolate, setts->Get(ctx, string_to_js(isolate, "bchDescartes")).ToLocalChecked());
// res.bch_lobachevski = bool_to_cpp(isolate, setts->Get(ctx, string_to_js(isolate, "bchLobachevski")).ToLocalChecked());
res.bch_lobachevski = bool_to_cpp(isolate, setts->Get(ctx, string_to_js(isolate, "bchLobachevski")).ToLocalChecked());
// res.bch_galois = bool_to_cpp(isolate, setts->Get(ctx, string_to_js(isolate, "bchGalois")).ToLocalChecked());

res.lobachevski_activation_time = setts->Get(ctx, string_to_js(isolate, "lobachevskiActivationTime")).ToLocalChecked()->IntegerValue(ctx).ToChecked();
res.galois_activation_time = setts->Get(ctx, string_to_js(isolate, "galoisActivationTime")).ToLocalChecked()->IntegerValue(ctx).ToChecked();
res.leibniz_activation_time = setts->Get(ctx, string_to_js(isolate, "leibnizActivationTime")).ToLocalChecked()->IntegerValue(ctx).ToChecked();

res.asert_half_life = setts->Get(ctx, string_to_js(isolate, "asertHalfLife")).ToLocalChecked()->IntegerValue(ctx).ToChecked();

Expand Down
11 changes: 6 additions & 5 deletions tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ function print_settings(setts) {
console.log(setts.chain.bchEuler);
console.log(setts.chain.bchGauss);
console.log(setts.chain.bchDescartes);
// console.log(setts.chain.bchLobachevski);
console.log(setts.chain.bchLobachevski);
// console.log(setts.chain.bchGalois);

console.log(setts.chain.lobachevskiActivationTime);
console.log(setts.chain.galoisActivationTime);
console.log(setts.chain.leibnizActivationTime);

console.log(setts.chain.asertHalfLife);
// ------------------------------------------------------------------------------------
Expand Down Expand Up @@ -232,16 +233,16 @@ function testBIP44Addresses() {
}

async function main() {
testBIP44Addresses();
return;
// testBIP44Addresses();
// return;
// test_encoding();

const mainnet = 0;
const justChain = 1;
const setts = kth.config_settings_default(mainnet);
setts.database.dbMaxSize = 2 * 1024 * 1024; // 2MiB
// console.log(setts);
// print_settings(setts);
print_settings(setts);

let started = false
let node = kth.node_construct(setts, true);
Expand Down

0 comments on commit be5ccf0

Please sign in to comment.