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: update js/ts template to use new .methods syntax #1732

Merged
merged 4 commits into from
Apr 4, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The minor version will be incremented upon a breaking change and the patch versi
* lang: Add return values to CPI client ([#1598](https://github.com/project-serum/anchor/pull/1598)).
* ts: Add view functions ([#1695](https://github.com/project-serum/anchor/pull/1695)).
* avm: New `avm update` command to update the Anchor CLI to the latest version ([#1670](https://github.com/project-serum/anchor/pull/1670)).
* cli: Update js/ts templates to use new `program.methods` syntax ([#1732](https://github.com/project-serum/anchor/pull/1732)).

### Fixes

Expand Down
4 changes: 2 additions & 2 deletions cli/src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ describe("{}", () => {{
it("Is initialized!", async () => {{
// Add your test here.
const program = anchor.workspace.{};
const tx = await program.rpc.initialize();
const tx = await program.methods.initialize().rpc();
console.log("Your transaction signature", tx);
}});
}});
Expand Down Expand Up @@ -262,7 +262,7 @@ describe("{}", () => {{

it("Is initialized!", async () => {{
// Add your test here.
const tx = await program.rpc.initialize({{}});
const tx = await program.methods.initialize().rpc();
console.log("Your transaction signature", tx);
}});
}});
Expand Down