diff --git a/CHANGELOG.md b/CHANGELOG.md index f89592148..46f96c522 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,8 +22,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm -`ZkProgram` to support non-pure provable types as inputs and outputs https://github.com/o1-labs/o1js/pull/1828 - Add `enforceTransactionLimits` parameter on Network https://github.com/o1-labs/o1js/issues/1910 - - Method for optional types to assert none https://github.com/o1-labs/o1js/pull/1922 +- Increased maximum supported amount of methods in a `SmartContract` or `ZkProgram` to 30. https://github.com/o1-labs/o1js/pull/1918 ### Fixed diff --git a/src/bindings b/src/bindings index 2c62a9a75..34a05bc88 160000 --- a/src/bindings +++ b/src/bindings @@ -1 +1 @@ -Subproject commit 2c62a9a755f1b128f89cc2131814df7157f68109 +Subproject commit 34a05bc8888eb577aa73852dab5df90c7cae1050 diff --git a/src/lib/proof-system/zkprogram.unit-test.ts b/src/lib/proof-system/zkprogram.unit-test.ts new file mode 100644 index 000000000..0b36bef28 --- /dev/null +++ b/src/lib/proof-system/zkprogram.unit-test.ts @@ -0,0 +1,33 @@ +import { Field } from '../provable/wrapped.js'; +import { ZkProgram } from './zkprogram.js'; + +const methodCount = 30; + +let MyProgram = ZkProgram({ + name: 'large-program', + publicOutput: Field, + methods: nMethods(methodCount), +}); + +function nMethods(i: number) { + let methods: Record = {}; + for (let j = 0; j < i; j++) { + methods['method' + j] = { + privateInputs: [Field], + async method(a: Field) { + return { + publicOutput: a.mul(1), + }; + }, + }; + } + return methods; +} + +try { + await MyProgram.compile(); +} catch (error) { + throw Error( + `Could not compile zkProgram with ${methodCount} branches: ${error}` + ); +}