i added context destruction function named secp256k1_destroy_context to free resources after use, preventing memory leaks, which i thought it will be good contribution :)
implemented error handling: throws a RuntimeException in Java if context creation fails.
i also increased portability by using intptr_t for pointer casting to ensure compatibility across different architectures.
Refactoring makeTest:
i replaced all instances of var with const and let to align the code with modern JavaScript standards for improved scope safety and readability. No functional changes were made.
Changes:
secp256k1 JNI:
added context destruction function (secp256k1_destroy_context) to free resources after use.
implemented error handling to throw a RuntimeException if context creation fails.
replaced uintptr_t with intptr_t for pointer-to-integer casting for better portability.
makeTest refactor:
replaced var with const for variables that remain constant.
replaced var with let for variables that are reassigned during execution.
Tags:
Type: feat, refactor
Scope: core, secp256k1, makeTest
Checklist:
[x] added context destruction function secp256k1_destroy_context to free resources after use.
[x] implemented error handling for failed context creation, throwing a RuntimeException in Java.
[x] used intptr_t for pointer casting to ensure compatibility across different architectures.
[x] replaced var with let and const for better scoping and modern js best practices.
This pull request contains two key updates:
secp256k1 JNI integration:
secp256k1_destroy_context
to free resources after use, preventing memory leaks, which i thought it will be good contribution :)RuntimeException
in Java if context creation fails.intptr_t
for pointer casting to ensure compatibility across different architectures.Refactoring
makeTest
:var
withconst
andlet
to align the code with modern JavaScript standards for improved scope safety and readability. No functional changes were made.Changes:
secp256k1 JNI:
secp256k1_destroy_context
) to free resources after use.RuntimeException
if context creation fails.uintptr_t
withintptr_t
for pointer-to-integer casting for better portability.makeTest
refactor:var
withconst
for variables that remain constant.var
withlet
for variables that are reassigned during execution.Tags:
feat
,refactor
core
,secp256k1
,makeTest
Checklist:
secp256k1_destroy_context
to free resources after use.RuntimeException
in Java.intptr_t
for pointer casting to ensure compatibility across different architectures.var
withlet
andconst
for better scoping and modern js best practices.