Skip to content

Commit

Permalink
o1js reflected changes. (#595)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Minkov <[email protected]>
  • Loading branch information
shimkiv and MartinMinkov authored Mar 6, 2024
1 parent 06c8736 commit 80e1cb5
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 143 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## Unreleased

## [0.18.0](https://github.com/o1-labs/zkapp-cli/compare/v17.2...v18.0) - 2024-03-06

### Breaking changes

- Lightnet error and edge cases handling. [#597](https://github.com/o1-labs/zkapp-cli/pull/597)
Expand Down
218 changes: 95 additions & 123 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zkapp-cli",
"version": "0.17.2",
"version": "0.18.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.16.*",
"o1js": "^0.17.*",
"opener": "^1.5.2",
"ora": "^8.0.1",
"semver": "^7.6.0",
Expand All @@ -78,8 +78,8 @@
"@shimkiv/cli-testing-library": "^0.1.7",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-plugin-o1js": "^0.4.0",
Expand Down
3 changes: 3 additions & 0 deletions src/bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ function getCustomizedStrings() {
other: chalk.red('Unknown commands: %s'),
},
'Invalid values:': chalk.red('Invalid values:'),
'Argument: %s, Given: %s, Choices: %s': chalk.red(
'Argument: %s, Given: %s, Choices: %s'
),
'Argument check failed: %s': chalk.red('Argument check failed: %s'),
'Implications failed:': chalk.red('Missing dependent arguments:'),
'Not enough arguments following: %s': chalk.red(
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.16.*"
"o1js": "0.17.*"
}
}
22 changes: 11 additions & 11 deletions templates/project-ts/src/interact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,31 @@ let feepayerAddress = feepayerKey.toPublicKey();
let zkAppAddress = zkAppKey.toPublicKey();
let zkApp = new Add(zkAppAddress);

let sentTx;
// compile the contract to create prover keys
console.log('compile the contract...');
await Add.compile();

try {
// call update() and send transaction
console.log('build transaction and create proof...');
let tx = await Mina.transaction({ sender: feepayerAddress, fee }, () => {
zkApp.update();
});
await tx.prove();

console.log('send transaction...');
sentTx = await tx.sign([feepayerKey]).send();
const sentTx = await tx.sign([feepayerKey]).send();
if (sentTx.status === 'pending') {
console.log(
'\nSuccess! Update transaction sent.\n' +
'\nYour smart contract state will be updated' +
'\nas soon as the transaction is included in a block:' +
`\n${getTxnUrl(config.url, sentTx.hash)}`
);
}
} catch (err) {
console.log(err);
}
if (sentTx?.hash() !== undefined) {
console.log(`
Success! Update transaction sent.
Your smart contract state will be updated
as soon as the transaction is included in a block:
${getTxnUrl(config.url, sentTx.hash())}
`);
}

function getTxnUrl(graphQlUrl: string, txnHash: string | undefined) {
const txnBroadcastServiceName = new URL(graphQlUrl).hostname
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/example.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ test.describe('zkApp-CLI', () => {

expect(code).toBeGreaterThan(0);
expect(stderr.at(-1)).toContain(
`name was "test". Must be one of: ${getArrayValuesAsString(
`Argument: name, Given: "test", Choices: ${getArrayValuesAsString(
Constants.exampleTypes
)}.`
)}`
);
} finally {
await cleanup();
Expand Down
4 changes: 2 additions & 2 deletions tests/cli/project.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ test.describe('zkApp-CLI', () => {

expect(code).toBeGreaterThan(0);
expect(stderr.at(-1)).toContain(
`ui was "test". Must be one of: ${getArrayValuesAsString(
`Argument: ui, Given: "test", Choices: ${getArrayValuesAsString(
Constants.uiTypes
)}.`
)}`
);
} finally {
await cleanup();
Expand Down

0 comments on commit 80e1cb5

Please sign in to comment.