@waves/js-test-env
Advanced tools
Comparing version 0.6.0 to 0.7.0-beta.0
@@ -24,5 +24,3 @@ "use strict"; | ||
function injectEnv(f) { | ||
return (po, seed) => f(Object.assign({ chainId: global.env.CHAIN_ID, additionalFee: global.env.defaultAdditionalFee }, po), seed === null ? null : seed || envSeed() || (() => { | ||
throw new Error(NO_SEED_MSG); | ||
})()); | ||
return (po, seed) => f(Object.assign({ chainId: global.env.CHAIN_ID, additionalFee: global.env.defaultAdditionalFee }, po), seed === null ? null : seed || envSeed()); | ||
} | ||
@@ -74,3 +72,13 @@ global.wavesCrypto = wt.libs.crypto; | ||
global.compile = (code) => { | ||
const resultOrError = ride_js_1.compile(code); | ||
const info = ride_js_1.scriptInfo(code); | ||
if ('error' in info) | ||
throw new Error(info.error); | ||
const libraries = info.imports.reduce((acc, libname) => { | ||
try { | ||
acc[libname] = global.file(libname); | ||
} | ||
catch (e) { } | ||
return acc; | ||
}, {}); | ||
const resultOrError = ride_js_1.compile(code, libraries); | ||
if ('error' in resultOrError) | ||
@@ -77,0 +85,0 @@ throw new Error(resultOrError.error); |
{ | ||
"name": "@waves/js-test-env", | ||
"version": "0.6.0", | ||
"version": "0.7.0-beta.0", | ||
"description": "", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@waves/ride-js": "^1.0.0", | ||
"@waves/ride-js": "^1.1.0-beta.13", | ||
"@waves/waves-transactions": "^3.14.3", | ||
@@ -29,0 +29,0 @@ "chai": "^4.2.0", |
18822
399