Skip to content

Commit

Permalink
Release 0.20.0 (#623)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymekuria authored Apr 22, 2024
1 parent 48d7b37 commit 9c1b954
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 36 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## Unreleased

## [0.19.0](https://github.com/o1-labs/zkapp-cli/compare/v18.0...v19.0) - 2024-03-06
## [0.20.0](https://github.com/o1-labs/zkapp-cli/compare/v19.0...v20.0) - 2024-04-22

- The CLI, templates, and examples have been updated to be compatible with the latest version `1.0.0` of `o1js`. This includes updating all instances of Mina.LocalBlochain() and Proof.fromJSON() to be async. [#623](https://github.com/o1-labs/zkapp-cli/pull/623)

## [0.19.0](https://github.com/o1-labs/zkapp-cli/compare/v18.0...v19.0) - 2024-04-09

### Breaking changes

Expand Down
5 changes: 3 additions & 2 deletions examples/sudoku/ts/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ import { cloneSudoku, generateSudoku, solveSudoku } from './sudoku-lib.js';
import { AccountUpdate, Mina, PrivateKey } from 'o1js';

// setup
const Local = Mina.LocalBlockchain();
const Local = await Mina.LocalBlockchain();
Mina.setActiveInstance(Local);

const { privateKey: senderKey, publicKey: sender } = Local.testAccounts[0];
const sender = Local.testAccounts[0];
const senderKey = sender.key;
const sudoku = generateSudoku(0.5);
const zkAppPrivateKey = PrivateKey.random();
const zkAppAddress = zkAppPrivateKey.toPublicKey();
Expand Down
8 changes: 4 additions & 4 deletions examples/sudoku/ts/src/sudoku.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ describe('sudoku', () => {
zkAppPrivateKey: PrivateKey,
zkAppAddress: PublicKey,
sudoku: number[][],
sender: PublicKey,
sender: Mina.TestPublicKey,
senderKey: PrivateKey;

beforeEach(async () => {
let Local = Mina.LocalBlockchain({ proofsEnabled: false });
let Local = await Mina.LocalBlockchain({ proofsEnabled: false });
Mina.setActiveInstance(Local);
sender = Local.testAccounts[0].publicKey;
senderKey = Local.testAccounts[0].privateKey;
sender = Local.testAccounts[0];
senderKey = sender.key;
zkAppPrivateKey = PrivateKey.random();
zkAppAddress = zkAppPrivateKey.toPublicKey();
zkApp = new SudokuZkApp(zkAppAddress);
Expand Down
10 changes: 4 additions & 6 deletions examples/tictactoe/ts/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ import {
} from 'o1js';
import { TicTacToe, Board } from './tictactoe.js';

let Local = Mina.LocalBlockchain({ proofsEnabled: false });
let Local = await Mina.LocalBlockchain({ proofsEnabled: false });
Mina.setActiveInstance(Local);
const [
{ publicKey: player1, privateKey: player1Key },
{ publicKey: player2, privateKey: player2Key },
] = Local.testAccounts;

const [player1, player2] = Local.testAccounts;
const player1Key = player1.key;
const player2Key = player2.key;
const zkAppPrivateKey = PrivateKey.random();
const zkAppPublicKey = zkAppPrivateKey.toPublicKey();
const zkApp = new TicTacToe(zkAppPublicKey);
Expand Down
12 changes: 7 additions & 5 deletions examples/tictactoe/ts/src/tictactoe.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,19 @@ import {
} from 'o1js';

describe('tictactoe', () => {
let player1: PublicKey,
let player1: Mina.TestPublicKey,
player1Key: PrivateKey,
player2: PublicKey,
player2: Mina.TestPublicKey,
zkAppAddress: PublicKey,
zkAppPrivateKey: PrivateKey;

beforeEach(async () => {
let Local = Mina.LocalBlockchain({ proofsEnabled: false });
let Local = await Mina.LocalBlockchain({ proofsEnabled: false });
Mina.setActiveInstance(Local);
[{ publicKey: player1, privateKey: player1Key }, { publicKey: player2 }] =
Local.testAccounts;

[player1, player2] = Local.testAccounts;
player1Key = player1.key;

zkAppPrivateKey = PrivateKey.random();
zkAppAddress = zkAppPrivateKey.toPublicKey();
});
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkapp-cli",
"version": "0.19.0",
"version": "0.20.0",
"description": "CLI to create zkApps (zero-knowledge apps) for Mina Protocol",
"homepage": "https://github.com/o1-labs/zkapp-cli/",
"keywords": [
Expand Down Expand Up @@ -65,7 +65,7 @@
"fs-extra": "^11.2.0",
"gittar": "^0.1.1",
"mina-signer": "^3.0.4",
"o1js": "^0.18.*",
"o1js": "^1.0.*",
"opener": "^1.5.2",
"ora": "^8.0.1",
"semver": "^7.6.0",
Expand Down
2 changes: 1 addition & 1 deletion templates/project-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
"typescript": "^4.7.2"
},
"peerDependencies": {
"o1js": "0.18.*"
"o1js": "1.0.*"
}
}
16 changes: 8 additions & 8 deletions templates/project-ts/src/Add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { Field, Mina, PrivateKey, PublicKey, AccountUpdate } from 'o1js';
let proofsEnabled = false;

describe('Add', () => {
let deployerAccount: PublicKey,
let deployerAccount: Mina.TestPublicKey,
deployerKey: PrivateKey,
senderAccount: PublicKey,
senderAccount: Mina.TestPublicKey,
senderKey: PrivateKey,
zkAppAddress: PublicKey,
zkAppPrivateKey: PrivateKey,
Expand All @@ -23,13 +23,13 @@ describe('Add', () => {
if (proofsEnabled) await Add.compile();
});

beforeEach(() => {
const Local = Mina.LocalBlockchain({ proofsEnabled });
beforeEach(async () => {
const Local = await Mina.LocalBlockchain({ proofsEnabled });
Mina.setActiveInstance(Local);
({ privateKey: deployerKey, publicKey: deployerAccount } =
Local.testAccounts[0]);
({ privateKey: senderKey, publicKey: senderAccount } =
Local.testAccounts[1]);
[deployerAccount, senderAccount] = Local.testAccounts;
deployerKey = deployerAccount.key;
senderKey = senderAccount.key;

zkAppPrivateKey = PrivateKey.random();
zkAppAddress = zkAppPrivateKey.toPublicKey();
zkApp = new Add(zkAppAddress);
Expand Down

0 comments on commit 9c1b954

Please sign in to comment.