Przeglądaj źródła

replace getRecentBlockhash to getLatestBlockhash (#2205)

Deep Mehta 2 lat temu
rodzic
commit
e8618a588f

+ 1 - 1
tests/cfo/tests/utils/index.js

@@ -388,7 +388,7 @@ async function signTransactions({
   wallet,
   connection,
 }) {
-  const blockhash = (await connection.getRecentBlockhash("finalized"))
+  const blockhash = (await connection.getLatestBlockhash("finalized"))
     .blockhash;
   transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
     transaction.recentBlockhash = blockhash;

+ 1 - 1
tests/swap/tests/utils/index.js

@@ -459,7 +459,7 @@ async function signTransactions({
   wallet,
   connection,
 }) {
-  const blockhash = (await connection.getRecentBlockhash("finalized"))
+  const blockhash = (await connection.getLatestBlockhash("finalized"))
     .blockhash;
   transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
     transaction.recentBlockhash = blockhash;

+ 2 - 2
ts/packages/anchor/src/provider.ts

@@ -134,7 +134,7 @@ export class AnchorProvider implements Provider {
 
     tx.feePayer = this.wallet.publicKey;
     tx.recentBlockhash = (
-      await this.connection.getRecentBlockhash(opts.preflightCommitment)
+      await this.connection.getLatestBlockhash(opts.preflightCommitment)
     ).blockhash;
 
     tx = await this.wallet.signTransaction(tx);
@@ -180,7 +180,7 @@ export class AnchorProvider implements Provider {
     if (opts === undefined) {
       opts = this.opts;
     }
-    const blockhash = await this.connection.getRecentBlockhash(
+    const blockhash = await this.connection.getLatestBlockhash(
       opts.preflightCommitment
     );