replace getRecentBlockhash to getLatestBlockhash (#2205)
This commit is contained in:
parent
43ab991852
commit
e8618a588f
|
@ -388,7 +388,7 @@ async function signTransactions({
|
||||||
wallet,
|
wallet,
|
||||||
connection,
|
connection,
|
||||||
}) {
|
}) {
|
||||||
const blockhash = (await connection.getRecentBlockhash("finalized"))
|
const blockhash = (await connection.getLatestBlockhash("finalized"))
|
||||||
.blockhash;
|
.blockhash;
|
||||||
transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
|
transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
|
||||||
transaction.recentBlockhash = blockhash;
|
transaction.recentBlockhash = blockhash;
|
||||||
|
|
|
@ -459,7 +459,7 @@ async function signTransactions({
|
||||||
wallet,
|
wallet,
|
||||||
connection,
|
connection,
|
||||||
}) {
|
}) {
|
||||||
const blockhash = (await connection.getRecentBlockhash("finalized"))
|
const blockhash = (await connection.getLatestBlockhash("finalized"))
|
||||||
.blockhash;
|
.blockhash;
|
||||||
transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
|
transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
|
||||||
transaction.recentBlockhash = blockhash;
|
transaction.recentBlockhash = blockhash;
|
||||||
|
|
|
@ -134,7 +134,7 @@ export class AnchorProvider implements Provider {
|
||||||
|
|
||||||
tx.feePayer = this.wallet.publicKey;
|
tx.feePayer = this.wallet.publicKey;
|
||||||
tx.recentBlockhash = (
|
tx.recentBlockhash = (
|
||||||
await this.connection.getRecentBlockhash(opts.preflightCommitment)
|
await this.connection.getLatestBlockhash(opts.preflightCommitment)
|
||||||
).blockhash;
|
).blockhash;
|
||||||
|
|
||||||
tx = await this.wallet.signTransaction(tx);
|
tx = await this.wallet.signTransaction(tx);
|
||||||
|
@ -180,7 +180,7 @@ export class AnchorProvider implements Provider {
|
||||||
if (opts === undefined) {
|
if (opts === undefined) {
|
||||||
opts = this.opts;
|
opts = this.opts;
|
||||||
}
|
}
|
||||||
const blockhash = await this.connection.getRecentBlockhash(
|
const blockhash = await this.connection.getLatestBlockhash(
|
||||||
opts.preflightCommitment
|
opts.preflightCommitment
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue