Skip to content

Commit

Permalink
cli: update js/ts templates to use new .methods syntax (#1732)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikhil B N <nikhilbn365@gmail.com>
  • Loading branch information
paul-schaaf and NBNARADHYA committed Apr 4, 2022
1 parent ddb344b commit 9e07087
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit 9e07087

Please sign in to comment.