fix: do not modify transaction during simulation
This commit is contained in:
parent
aea17c35ae
commit
e13efa0883
@ -3878,7 +3878,14 @@ export class Connection {
|
|||||||
): Promise<RpcResponseAndContext<SimulatedTransactionResponse>> {
|
): Promise<RpcResponseAndContext<SimulatedTransactionResponse>> {
|
||||||
let transaction;
|
let transaction;
|
||||||
if (transactionOrMessage instanceof Transaction) {
|
if (transactionOrMessage instanceof Transaction) {
|
||||||
transaction = transactionOrMessage;
|
let originalTx: Transaction = transactionOrMessage;
|
||||||
|
transaction = new Transaction({
|
||||||
|
recentBlockhash: originalTx.recentBlockhash,
|
||||||
|
nonceInfo: originalTx.nonceInfo,
|
||||||
|
feePayer: originalTx.feePayer,
|
||||||
|
signatures: [...originalTx.signatures],
|
||||||
|
});
|
||||||
|
transaction.instructions = transactionOrMessage.instructions;
|
||||||
} else {
|
} else {
|
||||||
transaction = Transaction.populate(transactionOrMessage);
|
transaction = Transaction.populate(transactionOrMessage);
|
||||||
}
|
}
|
||||||
@ -3888,11 +3895,7 @@ export class Connection {
|
|||||||
} else {
|
} else {
|
||||||
let disableCache = this._disableBlockhashCaching;
|
let disableCache = this._disableBlockhashCaching;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (!transaction.recentBlockhash) {
|
transaction.recentBlockhash = await this._recentBlockhash(disableCache);
|
||||||
transaction.recentBlockhash = await this._recentBlockhash(
|
|
||||||
disableCache,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!signers) break;
|
if (!signers) break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user