From 9e070870f4815849e99f19700d675638d3443b8f Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 4 Apr 2022 14:50:45 -0400 Subject: [PATCH] cli: update js/ts templates to use new `.methods` syntax (#1732) Co-authored-by: Nikhil B N --- CHANGELOG.md | 1 + cli/src/template.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d0f56fa16..c4f2c2018b 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 b3e82aaa59..378d023dc8 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); }}); }});