Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Release 0.9.0 #426

Merged
merged 8 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.2] - 2023-05-12
## [0.9.0] - 2023-06-06

- Clean up deploy and log full errors to the console. [#408](https://github.com/o1-labs/zkapp-cli/pull/408)
### Changed

- Release `0.9.0` [#426](https://github.com/o1-labs/zkapp-cli/pull/426)
- SnarkyJS minor version dependency updated in cli package.json to 0.11.*.
- SnarkyJS minor version peer dependency updated in template/example contract package.json to 0.11.*.
- Replace deprecated `Circuit.if` with `Provable.if` in the `tictactoe` example.
- Replace deprecated `Circuit.array` with `Provable.Array` in the `sudoku` example.

## [0.8.2] - 2023-05-12

### Changed

- Clean up deploy and log full errors to the console. [#408](https://github.com/o1-labs/zkapp-cli/pull/408)

## [0.8.1] - 2023-05-03

### Changed
Expand Down
4 changes: 2 additions & 2 deletions examples/sudoku/ts/src/sudoku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import {
State,
Poseidon,
Struct,
Circuit,
Provable,
} from 'snarkyjs';

export { Sudoku, SudokuZkApp };

class Sudoku extends Struct({
value: Circuit.array(Circuit.array(Field, 9), 9),
value: Provable.Array(Provable.Array(Field, 9), 9),
}) {
static from(value: number[][]) {
return new Sudoku({ value: value.map((row) => row.map(Field)) });
Expand Down
29 changes: 17 additions & 12 deletions examples/tictactoe/ts/src/tictactoe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,29 @@ import {
state,
method,
Bool,
Circuit,
Provable,
Signature,
Struct,
} from 'snarkyjs';

export { Board, TicTacToe };

class Optional<T> {
isSome: Bool;
value: T;
function Optional<T>(type: Provable<T>) {
return class Optional_ extends Struct({ isSome: Bool, value: type }) {
constructor(isSome: boolean | Bool, value: T) {
super({ isSome: Bool(isSome), value });
}

constructor(isSome: Bool, value: T) {
this.isSome = isSome;
this.value = value;
}
toFields() {
return Optional_.toFields(this);
}
};
}

class OptionalBool extends Optional(Bool) {}

class Board {
board: Optional<Bool>[][];
board: OptionalBool[][];

constructor(serializedBoard: Field) {
const bits = serializedBoard.toBits(18);
Expand All @@ -37,7 +42,7 @@ class Board {
for (let j = 0; j < 3; j++) {
const isPlayed = bits[i * 3 + j];
const player = bits[i * 3 + j + 9];
row.push(new Optional(isPlayed, player));
row.push(new OptionalBool(isPlayed, player));
}
board.push(row);
}
Expand Down Expand Up @@ -66,9 +71,9 @@ class Board {
toUpdate.and(this.board[i][j].isSome).assertEquals(false);

// copy the board (or update if this is the cell the player wants to play)
this.board[i][j] = Circuit.if(
this.board[i][j] = Provable.if(
toUpdate,
new Optional(new Bool(true), playerToken),
new OptionalBool(true, playerToken),
this.board[i][j]
);
}
Expand Down
18 changes: 9 additions & 9 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.8.2",
"version": "0.9.0",
"description": "CLI to create a zkApp (\"zero-knowledge app\") for Mina Protocol.",
"keywords": [
"cli",
Expand Down Expand Up @@ -59,7 +59,7 @@
"mina-signer": "^1.1.0",
"ora": "^5.4.1",
"shelljs": "^0.8.5",
"snarkyjs": "0.10.*",
"snarkyjs": "0.11.*",
"table": "^6.8.0",
"yargs": "^17.5.1"
},
Expand Down
4 changes: 3 additions & 1 deletion templates/project-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
"typescript": "^4.7.2"
},
"peerDependencies": {
"snarkyjs": "0.10.*"
"snarkyjs": "0.11.*"
}
}