diff --git a/packages/near-sdk-js/builder/builder.c b/packages/near-sdk-js/builder/builder.c index 27c31b76d..47c3de721 100644 --- a/packages/near-sdk-js/builder/builder.c +++ b/packages/near-sdk-js/builder/builder.c @@ -1054,7 +1054,6 @@ static JSValue near_uint8array_to_utf8_string(JSContext *ctx, JSValueConst this_ return JS_NewStringLen(ctx, (const char *)data_ptr, data_len); } -#ifdef NIGHTLY static JSValue near_alt_bn128_g1_multiexp(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) { uint64_t register_id; @@ -1104,7 +1103,6 @@ static JSValue near_alt_bn128_pairing_check(JSContext *ctx, JSValueConst this_va ret = alt_bn128_pairing_check(data_len, (uint64_t)data_ptr); return JS_NewBigUint64(ctx, ret); } -#endif static void js_add_near_host_functions(JSContext* ctx) { JSValue global_obj, env; @@ -1165,13 +1163,9 @@ static void js_add_near_host_functions(JSContext* ctx) { JS_SetPropertyStr(ctx, env, "storage_has_key", JS_NewCFunction(ctx, near_storage_has_key, "storage_has_key", 2)); JS_SetPropertyStr(ctx, env, "validator_stake", JS_NewCFunction(ctx, near_validator_stake, "validator_stake", 2)); JS_SetPropertyStr(ctx, env, "validator_total_stake", JS_NewCFunction(ctx, near_validator_total_stake, "validator_total_stake", 1)); - #ifdef NIGHTLY - // as of Jun 24, 2022, alt_bn128 is not a nightly protocol feature any more. It's part of protocol version 55. But, testnet -// is at protocol version 54 and mainnet is at protocol version 53. We'll enable and add alt_bn128 as they in testnet. JS_SetPropertyStr(ctx, env, "alt_bn128_g1_multiexp", JS_NewCFunction(ctx, near_alt_bn128_g1_multiexp, "alt_bn128_g1_multiexp", 2)); JS_SetPropertyStr(ctx, env, "alt_bn128_g1_sum", JS_NewCFunction(ctx, near_alt_bn128_g1_sum, "alt_bn128_g1_sum", 2)); JS_SetPropertyStr(ctx, env, "alt_bn128_pairing_check", JS_NewCFunction(ctx, near_alt_bn128_pairing_check, "alt_bn128_pairing_check", 1)); - #endif JS_SetPropertyStr(ctx, env, "latin1_string_to_uint8array", JS_NewCFunction(ctx, near_latin1_string_to_uint8array, "latin1_string_to_uint8array", 1)); JS_SetPropertyStr(ctx, env, "utf8_string_to_uint8array", JS_NewCFunction(ctx, near_utf8_string_to_uint8array, "utf8_string_to_uint8array", 1)); diff --git a/tests/__tests__/test_math_api.ava.js b/tests/__tests__/test_math_api.ava.js index 3c287e364..298f352e9 100644 --- a/tests/__tests__/test_math_api.ava.js +++ b/tests/__tests__/test_math_api.ava.js @@ -92,6 +92,4 @@ test("ecrecover", async (t) => { ); }); -// As of Jun 24, 2022, near-sandbox is using 97c0410de519ecaca369aaee26f0ca5eb9e7de06, in which alt_bn256 is still -// under nightly protocol feature. As near-sandbox is built without nightly protocol feature, alt_bn256 operations -// cannot be tested yet +// TODO add test for alt_bn256 functions