diff --git a/src/constants.ts b/src/constants.ts index 1b4e17f..b374813 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -29,10 +29,11 @@ export const COMPILER_AMD_REPOSITORY_URL = "https://github.com/iden3/circom/rele export const COMPILER_ARM_REPOSITORY_URL = "https://github.com/distributed-lab/circom/releases/download"; export const COMPILER_WASM_REPOSITORY_URL = "https://github.com/distributed-lab/circom-wasm/releases/download"; -export const LATEST_SUPPORTED_CIRCOM_VERSION = "2.1.9"; +export const LATEST_SUPPORTED_CIRCOM_VERSION = "2.2.0"; export const OLDEST_SUPPORTED_CIRCOM_VERSION = "2.0.5"; export const WASM_COMPILER_VERSIONING: { [key: string]: string } = { "2.1.8": "0.2.18-rc.3", "2.1.9": "0.2.19-rc.0", + "2.2.0": "0.2.20-rc.0", }; diff --git a/src/core/dependencies/parser/CircomTemplateInputsVisitor.ts b/src/core/dependencies/parser/CircomTemplateInputsVisitor.ts index eed0b7f..2640a19 100644 --- a/src/core/dependencies/parser/CircomTemplateInputsVisitor.ts +++ b/src/core/dependencies/parser/CircomTemplateInputsVisitor.ts @@ -1,4 +1,5 @@ import { + BusDeclarationContext, CircomValueType, CircomVisitor, ExpressionContext, @@ -143,6 +144,10 @@ export class CircomTemplateInputsVisitor extends CircomVisitor { throw new Error("INTERNAL ERROR: SignalIdentifier should have a SignalDeclarationContext as a parent of parent"); } + if (ctx.parentCtx!.parentCtx instanceof BusDeclarationContext) { + throw new Error("Buses are not supported"); + } + const signalDeclarationContext = ctx.parentCtx!.parentCtx as SignalDeclarationContext; let signalType = "intermediate"; diff --git a/test/unit/core/compile/circom-compiler-factory.test.ts b/test/unit/core/compile/circom-compiler-factory.test.ts index 7fedc0c..f192c25 100644 --- a/test/unit/core/compile/circom-compiler-factory.test.ts +++ b/test/unit/core/compile/circom-compiler-factory.test.ts @@ -38,7 +38,7 @@ describe("CircomCompilerFactory", () => { }); async function checkPlatformSpecificCompiler(osType: NodeJS.Platform) { - const compilerDir = path.join(os.homedir(), ".zkit", "compilers", LATEST_SUPPORTED_CIRCOM_VERSION); + const compilerDir = path.join(os.homedir(), ".zkit", "compilers"); fsExtra.rmSync(compilerDir, { recursive: true, force: true }); const platformStub = stub(os, "platform").callsFake(() => { @@ -55,7 +55,7 @@ describe("CircomCompilerFactory", () => { expect(compiler).to.be.instanceof(BinaryCircomCompiler); } - expect(fsExtra.readdirSync(compilerDir)).to.be.deep.equal([platform]); + expect(fsExtra.readdirSync(path.join(compilerDir, LATEST_SUPPORTED_CIRCOM_VERSION))).to.be.deep.equal([platform]); fsExtra.rmSync(compilerDir, { recursive: true, force: true }); platformStub.restore(); @@ -97,12 +97,12 @@ describe("CircomCompilerFactory", () => { it("should correctly throw error if pass invalid version", async function () { let invalidVersion = "2.1.10"; - let reason = `Unsupported Circom compiler version - ${invalidVersion}. Please provide another version.`; + let reason = `Unsupported WASM version - ${invalidVersion}`; createCircomCompilerFactory(); await expect(CircomCompilerFactory!.createCircomCompiler(invalidVersion, true)).to.be.rejectedWith(reason); - invalidVersion = "2.2.0"; + invalidVersion = "2.2.1"; reason = `Unsupported Circom compiler version - ${invalidVersion}. Please provide another version.`; await expect(CircomCompilerFactory!.createCircomCompiler(invalidVersion, false)).to.be.rejectedWith(reason);