diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d0f56fa1..c4f2c2018 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/cli/src/template.rs b/cli/src/template.rs index b3e82aaa5..378d023dc 100644 --- a/cli/src/template.rs +++ b/cli/src/template.rs @@ -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); }}); }}); @@ -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); }}); }});