Merge pull request #102 from ChainSafe/dapplion/register

Add register script
This commit is contained in:
Cayman 2021-08-23 12:45:58 -05:00 committed by GitHub
commit f830b41ecc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 4 deletions

View File

@ -13,10 +13,8 @@
"lib/**/*.js", "lib/**/*.js",
"lib/**/*.js.map", "lib/**/*.js.map",
"lib/**/*.d.ts", "lib/**/*.d.ts",
"blst-native.*", "*.d.ts",
"browser.*", "*.js"
"herumi.*",
"node."
], ],
"keywords": [ "keywords": [
"ethereum", "ethereum",

14
register.js Normal file
View File

@ -0,0 +1,14 @@
const {init} = require("./lib");
// -----------------------------------------
// To be used in NodeJS testing environments
// node -r @chainsafe/bls/register
// -----------------------------------------
// blst-native initialization is syncronous
// Initialize bls here instead of in before() so it's available inside describe() blocks
init("blst-native").catch((e) => {
// eslint-disable-next-line no-console
console.error(e);
process.exit(1);
});