Skip to content

enhancement: account state unit tests#2693

Merged
Trivo25 merged 3 commits intodevelop-3.0from
leon/develop-3.0/account-state-unit-tests
Jan 12, 2026
Merged

enhancement: account state unit tests#2693
Trivo25 merged 3 commits intodevelop-3.0from
leon/develop-3.0/account-state-unit-tests

Conversation

@bleepbloopsify
Copy link
Contributor

testing to see that we do support 32 account state fields, and reject anything above

closes #2669

@bleepbloopsify bleepbloopsify requested review from a team as code owners December 12, 2025 18:14
@bleepbloopsify bleepbloopsify requested a review from 0x471 December 12, 2025 18:14
@bleepbloopsify
Copy link
Contributor Author

o1js-small [develop-3.0] ♞  ./run src/lib/mina/v1/account-update-state.unit-test.ts
running /Users/leon/github/o1js-small/dist/node/lib/mina/v1/account-update-state.unit-test.js
▶ app state updates
  ✔ should succeed with spec: (fields: 1) (750.01975ms)
  ✔ should succeed with spec: (fields: 8) (430.418625ms)
  ✔ should succeed with spec: (fields: 32) (445.382541ms)
  ✔ should reject with spec: (fields: 33) (326.388041ms)
✔ app state updates (1952.968542ms)
ℹ tests 4
ℹ suites 1
ℹ pass 4
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 2491.93075

Looks like this

Mina.setActiveInstance(Local);
const [feePayer] = Local.testAccounts;

const tests: TestSpec[] = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while this checks if we can declare n state fields, it doesn't check that we actually properly allocate them becuse they are 0 by default anyway. we can do this in a different test but we should make sure that when we declare n state fields, we should also try to modify them

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! you can also define a field array Provable.Array(Field, 32) and play around with the number of fields and state changes etc..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the title mention account-update as well?

Mina.setActiveInstance(Local);
const [feePayer] = Local.testAccounts;

const tests: TestSpec[] = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree! you can also define a field array Provable.Array(Field, 32) and play around with the number of fields and state changes etc..

@Trivo25 Trivo25 merged commit f02cc33 into develop-3.0 Jan 12, 2026
6 of 11 checks passed
@Trivo25 Trivo25 deleted the leon/develop-3.0/account-state-unit-tests branch January 12, 2026 10:32
@Trivo25 Trivo25 restored the leon/develop-3.0/account-state-unit-tests branch January 12, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants