Skip to content

Commit

Permalink
fix: rollup contract test
Browse files Browse the repository at this point in the history
  • Loading branch information
berzanorg committed Apr 30, 2024
1 parent 115eee2 commit 93c0c1d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions rollup-contract/tests/rollup-contract.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createStateUtil, proofGenerator } from "nacho-proof-generator"
import { describe, it } from "node:test"
import { RollupContract } from "../src/index.js"
import { AccountUpdate, Bool, Field, Mina, UInt64 } from "o1js"
import { AccountUpdate, Bool, Field, Mina, Provable, UInt64 } from "o1js"
import { generateKeypair } from "./utils.js"
import { StateRoots } from "nacho-common-o1js"
import assert from "assert"
Expand All @@ -28,7 +28,7 @@ describe("rollup contract", async () => {
await tx.prove()
await tx.send()

rollupContract.stateRoots.getAndRequireEquals().assertEquals(StateRoots.empty())
rollupContract.stateRoots.get().assertEquals(StateRoots.empty())
})

it("generates create genesis proof", async () => {
Expand Down Expand Up @@ -76,8 +76,8 @@ describe("rollup contract", async () => {
await tx.prove()
await tx.send()

stateUtil.setBalance(0n, john.publicKey, Field(0), UInt64.from(42))
rollupContract.stateRoots.getAndRequireEquals().assertEquals(stateUtil.stateRoots)
stateUtil.setBalance(0n, john.publicKey, Field(1), UInt64.from(42))
rollupContract.stateRoots.get().assertEquals(stateUtil.stateRoots)
})

it("doesn't settle old proofs to rollup contract", async () => {
Expand All @@ -89,10 +89,7 @@ describe("rollup contract", async () => {
await tx.prove()
await tx.send()
} catch (error) {
assert.equal(
(error as Error).message,
'Transaction failed with errors:\n- [[],[["Account_app_state_precondition_unsatisfied",0]]]',
)
assert.equal((error as Error).message, "Bool.assertTrue(): false != true")
}
})
})

0 comments on commit 93c0c1d

Please sign in to comment.