1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

fix failing tests

This commit is contained in:
dark64 2022-05-11 23:54:17 +02:00
parent e2bd653944
commit 07adc21dec
4 changed files with 13 additions and 13 deletions

View file

@ -2084,7 +2084,7 @@ dependencies = [
[[package]]
name = "zokrates_abi"
version = "0.1.6"
version = "0.1.7"
dependencies = [
"serde",
"serde_derive",
@ -2099,7 +2099,7 @@ version = "0.1.0"
[[package]]
name = "zokrates_core"
version = "0.6.11"
version = "0.6.12"
dependencies = [
"ark-bls12-377",
"ark-bw6-761",
@ -2184,7 +2184,7 @@ dependencies = [
[[package]]
name = "zokrates_js"
version = "1.0.41"
version = "1.0.42"
dependencies = [
"console_error_panic_hook",
"indexmap",

View file

@ -1,6 +1,6 @@
{
"name": "zokrates-js",
"version": "1.0.41",
"version": "1.0.42",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -19,7 +19,7 @@ describe("tests", function () {
it("should compile", () => {
assert.doesNotThrow(() => {
const artifacts = zokratesProvider.compile(
"def main() -> field: return 42"
"def main() -> field { return 42; }"
);
assert.ok(artifacts !== undefined);
});
@ -34,7 +34,7 @@ describe("tests", function () {
assert.doesNotThrow(() => {
const code = `import "${
Object.keys(stdlib)[0]
}" as func\ndef main(): return`;
}" as func; def main() { return; }`;
zokratesProvider.compile(code);
});
});
@ -42,11 +42,11 @@ describe("tests", function () {
it("should resolve user module", () => {
assert.doesNotThrow(() => {
const code =
'import "test" as test\ndef main() -> field: return test()';
'import "test" as test; def main() -> field { return test(); }';
const options = {
resolveCallback: (_, path) => {
return {
source: "def main() -> (field): return 1",
source: "def main() -> field { return 1; }",
location: path,
};
},
@ -58,7 +58,7 @@ describe("tests", function () {
it("should throw on unresolved module", () => {
assert.throws(() => {
const code =
'import "test" as test\ndef main() -> field: return test()';
'import "test" as test; def main() -> field { return test(); }';
zokratesProvider.compile(code);
});
});
@ -67,7 +67,7 @@ describe("tests", function () {
describe("computation", () => {
it("should compute with valid inputs", () => {
assert.doesNotThrow(() => {
const code = "def main(private field a) -> field: return a * a";
const code = "def main(private field a) -> field { return a * a; }";
const artifacts = zokratesProvider.compile(code);
const result = zokratesProvider.computeWitness(artifacts, ["2"]);
@ -78,7 +78,7 @@ describe("tests", function () {
it("should throw on invalid input count", () => {
assert.throws(() => {
const code = "def main(private field a) -> field: return a * a";
const code = "def main(private field a) -> field { return a * a; }";
const artifacts = zokratesProvider.compile(code);
zokratesProvider.computeWitness(artifacts, ["1", "2"]);
});
@ -86,7 +86,7 @@ describe("tests", function () {
it("should throw on invalid input type", () => {
assert.throws(() => {
const code = "def main(private field a) -> field: return a * a";
const code = "def main(private field a) -> field { return a * a; }";
const artifacts = zokratesProvider.compile(code);
zokratesProvider.computeWitness(artifacts, [true]);
});
@ -108,7 +108,7 @@ describe("tests", function () {
it("compile", () => {
assert.doesNotThrow(() => {
const code =
"def main(private field a, field b) -> bool: return a * a == b";
"def main(private field a, field b) -> bool { return a * a == b; }";
artifacts = provider.compile(code);
});
});