Skip to content

Commit 5c53c80

Browse files
cli: Fix using deprecated commitment recent in migration scripts (solana-foundation#3725)
1 parent 11842e6 commit 5c53c80

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

CHANGELOG.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ The minor version will be incremented upon a breaking change and the patch versi
1010

1111
## [Unreleased]
1212

13-
-
14-
1513
### Features
1614

1715
### Fixes
1816

19-
- docker: Upgrade `node` to 20.18.0 LTS ([#3179](https://github.com/solana-foundation/anchor/pull/3687)).
17+
- docker: Upgrade `node` to 20.18.0 LTS ([#3687](https://github.com/solana-foundation/anchor/pull/3687)).
18+
- cli: Fix using deprecated commitment `recent` in migration scripts ([#3725](https://github.com/coral-xyz/anchor/pull/3725)).
2019

2120
### Breaking
2221

cli/src/rust_template.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,12 @@ const anchor = require('@coral-xyz/anchor');
256256
const userScript = require("{script_path}");
257257
258258
async function main() {{
259-
const url = "{cluster_url}";
260-
const preflightCommitment = 'recent';
261-
const connection = new anchor.web3.Connection(url, preflightCommitment);
259+
const connection = new anchor.web3.Connection(
260+
"{cluster_url}",
261+
anchor.AnchorProvider.defaultOptions().commitment
262+
);
262263
const wallet = anchor.Wallet.local();
263-
264-
const provider = new anchor.AnchorProvider(connection, wallet, {{
265-
preflightCommitment,
266-
commitment: 'recent',
267-
}});
264+
const provider = new anchor.AnchorProvider(connection, wallet);
268265
269266
// Run the user's deploy script.
270267
userScript(provider);
@@ -282,15 +279,12 @@ pub fn deploy_ts_script_host(cluster_url: &str, script_path: &str) -> String {
282279
const userScript = require("{script_path}");
283280
284281
async function main() {{
285-
const url = "{cluster_url}";
286-
const preflightCommitment = 'recent';
287-
const connection = new anchor.web3.Connection(url, preflightCommitment);
282+
const connection = new anchor.web3.Connection(
283+
"{cluster_url}",
284+
anchor.AnchorProvider.defaultOptions().commitment
285+
);
288286
const wallet = anchor.Wallet.local();
289-
290-
const provider = new anchor.AnchorProvider(connection, wallet, {{
291-
preflightCommitment,
292-
commitment: 'recent',
293-
}});
287+
const provider = new anchor.AnchorProvider(connection, wallet);
294288
295289
// Run the user's deploy script.
296290
userScript(provider);

0 commit comments

Comments
 (0)