Skip to content

Commit a30dfda

Browse files
committed
fix max AU tests
1 parent 1b927ae commit a30dfda

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

src/lib/mina/v1/mina.network.unit-test.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { UInt64, Mina, AccountUpdate, PublicKey, Field, TokenId, PrivateKey } from 'o1js';
2-
import { describe, it, before, beforeEach, afterEach } from 'node:test';
31
import { expect } from 'expect';
2+
import { afterEach, before, beforeEach, describe, it } from 'node:test';
3+
import { AccountUpdate, Field, Mina, PrivateKey, PublicKey, TokenId, UInt64 } from 'o1js';
4+
import { TransactionLimits } from './constants.js';
45

56
const defaultNetwork = Mina.Network({
67
networkId: 'testnet',
@@ -69,7 +70,11 @@ describe('Test default network', () => {
6970

7071
it('More than limit account update', async () => {
7172
let txn = await Mina.transaction(async () => {
72-
for (let index = 0; index < 12; index++) {
73+
for (
74+
let index = 0;
75+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
76+
index++
77+
) {
7378
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
7479
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
7580
accountUpdateBob.balance.addInPlace(UInt64.one);
@@ -114,7 +119,11 @@ describe('Test enforced network', () => {
114119

115120
it('More than limit account update', async () => {
116121
let txn = await Mina.transaction(async () => {
117-
for (let index = 0; index < 12; index++) {
122+
for (
123+
let index = 0;
124+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
125+
index++
126+
) {
118127
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
119128
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
120129
accountUpdateBob.balance.addInPlace(UInt64.one);
@@ -159,7 +168,11 @@ describe('Test unlimited network', () => {
159168

160169
it('More than limit account update', async () => {
161170
let txn = await Mina.transaction(async () => {
162-
for (let index = 0; index < 12; index++) {
171+
for (
172+
let index = 0;
173+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
174+
index++
175+
) {
163176
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
164177
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
165178
accountUpdateBob.balance.addInPlace(UInt64.one);
@@ -252,7 +265,11 @@ describe('Test network with headers', () => {
252265

253266
it('More than limit account update', async () => {
254267
let txn = await Mina.transaction(async () => {
255-
for (let index = 0; index < 12; index++) {
268+
for (
269+
let index = 0;
270+
index < TransactionLimits.MAX_ZKAPP_SEGMENT_PER_TRANSACTION + 1;
271+
index++
272+
) {
256273
const accountUpdateBob = AccountUpdate.create(bobAccount, Field.from(index));
257274
accountUpdateBob.account.balance.requireEquals(UInt64.zero);
258275
accountUpdateBob.balance.addInPlace(UInt64.one);

0 commit comments

Comments
 (0)