solana.js: fix lease fund logic
This commit is contained in:
parent
1695adf6f8
commit
395a6b8656
|
@ -506,8 +506,8 @@ export class QueueAccount extends Account<types.OracleQueueAccountData> {
|
||||||
const leaseInit = (
|
const leaseInit = (
|
||||||
await LeaseAccount.createInstructions(this.program, payer, {
|
await LeaseAccount.createInstructions(this.program, payer, {
|
||||||
loadAmount: params.fundAmount,
|
loadAmount: params.fundAmount,
|
||||||
funderTokenAccount: params.funderTokenAccount,
|
funderTokenAccount: params.funderTokenAccount ?? userTokenAddress,
|
||||||
funderAuthority: params.funderAuthority,
|
funderAuthority: params.funderAuthority ?? undefined,
|
||||||
aggregatorAccount: aggregatorAccount,
|
aggregatorAccount: aggregatorAccount,
|
||||||
queueAccount: this,
|
queueAccount: this,
|
||||||
jobAuthorities: [], // create lease before adding jobs to skip this step
|
jobAuthorities: [], // create lease before adding jobs to skip this step
|
||||||
|
@ -646,7 +646,9 @@ export class QueueAccount extends Account<types.OracleQueueAccountData> {
|
||||||
params
|
params
|
||||||
);
|
);
|
||||||
|
|
||||||
const signatures = await this.program.signAndSendAll(txns);
|
const signatures = await this.program.signAndSendAll(txns, {
|
||||||
|
skipPreflight: true,
|
||||||
|
});
|
||||||
|
|
||||||
return [aggregatorAccount, signatures];
|
return [aggregatorAccount, signatures];
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,10 +243,15 @@ export class TransactionObject implements ITransactionObject {
|
||||||
): Transaction {
|
): Transaction {
|
||||||
const txn = this.toTxn(blockhash);
|
const txn = this.toTxn(blockhash);
|
||||||
const allSigners = [...this.signers];
|
const allSigners = [...this.signers];
|
||||||
|
|
||||||
if (signers) {
|
if (signers) {
|
||||||
allSigners.push(...signers);
|
allSigners.push(...signers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (allSigners.length) {
|
||||||
txn.sign(...allSigners);
|
txn.sign(...allSigners);
|
||||||
|
}
|
||||||
|
|
||||||
return txn;
|
return txn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue