1
0
Fork 0
mirror of synced 2025-09-23 12:18:44 +00:00

update wrapper.js

This commit is contained in:
dark64 2021-09-29 16:11:34 +02:00
parent e30678f558
commit 2fff71d49f

View file

@ -36,15 +36,12 @@ module.exports = (dep) => {
return {
compile: (source, options = {}) => {
const createConfig = (config) => ({
allow_unconstrained_variables: false,
...config
});
const { location = "main.zok", resolveCallback = () => null, config = {} } = options;
console.log(config);
const callback = (currentLocation, importLocation) => {
return resolveFromStdlib(currentLocation, importLocation) || resolveCallback(currentLocation, importLocation);
};
const { program, abi } = zokrates.compile(source, location, callback, createConfig(config));
const { program, abi } = zokrates.compile(source, location, callback, config);
return {
program: new Uint8Array(program),
abi