Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Aug 8, 2022
1 parent f970221 commit 38d254b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/examples/zkapps/hello_world/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ txn = await Mina.transaction(feePayer1, () => {

txn.send();

const initialState =
Mina.getAccount(zkAppAddress).zkapp?.appState[0].toString();
const initialState = Mina.getAccount(zkAppAddress).appState?.[0].toString();

let currentState;

Expand All @@ -45,7 +44,7 @@ txn = await Mina.transaction(feePayer1, () => {

txn.send();

currentState = Mina.getAccount(zkAppAddress).zkapp?.appState[0].toString();
currentState = Mina.getAccount(zkAppAddress).appState?.[0].toString();

if (currentState !== '4') {
throw Error(
Expand Down Expand Up @@ -135,7 +134,7 @@ txn2 = await Mina.transaction({ feePayerKey: feePayer2, fee: '2' }, () => {

txn2.send();

currentState = Mina.getAccount(zkAppAddress).zkapp?.appState[0].toString();
currentState = Mina.getAccount(zkAppAddress).appState?.[0].toString();

if (currentState !== '16') {
throw Error(
Expand All @@ -153,7 +152,7 @@ txn3 = await Mina.transaction({ feePayerKey: feePayer3, fee: '1' }, () => {

txn3.send();

currentState = Mina.getAccount(zkAppAddress).zkapp?.appState[0].toString();
currentState = Mina.getAccount(zkAppAddress).appState?.[0].toString();

if (currentState !== '256') {
throw Error(
Expand Down Expand Up @@ -190,7 +189,7 @@ if (!correctlyFails) {
*/

function handleError(error: any, errorMessage: string) {
currentState = Mina.getAccount(zkAppAddress).zkapp?.appState[0].toString();
currentState = Mina.getAccount(zkAppAddress).appState?.[0].toString();

if (error.message.includes(errorMessage)) {
correctlyFails = true;
Expand Down

0 comments on commit 38d254b

Please sign in to comment.