feat: allow setting explicit fee payer for transaction (#13129)
This commit is contained in:
@@ -176,7 +176,7 @@ describe('load BPF Rust program', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('simulate transaction without signature verification', async () => {
|
||||
test('deprecated - simulate transaction without signature verification', async () => {
|
||||
const simulatedTransaction = new Transaction().add({
|
||||
keys: [
|
||||
{pubkey: payerAccount.publicKey, isSigner: true, isWritable: true},
|
||||
@@ -202,6 +202,33 @@ describe('load BPF Rust program', () => {
|
||||
);
|
||||
});
|
||||
|
||||
test('simulate transaction without signature verification', async () => {
|
||||
const simulatedTransaction = new Transaction({
|
||||
feePayer: payerAccount.publicKey,
|
||||
}).add({
|
||||
keys: [
|
||||
{pubkey: payerAccount.publicKey, isSigner: true, isWritable: true},
|
||||
],
|
||||
programId: program.publicKey,
|
||||
});
|
||||
|
||||
const {err, logs} = (
|
||||
await connection.simulateTransaction(simulatedTransaction)
|
||||
).value;
|
||||
expect(err).toBeNull();
|
||||
|
||||
if (logs === null) {
|
||||
expect(logs).not.toBeNull();
|
||||
return;
|
||||
}
|
||||
|
||||
expect(logs.length).toBeGreaterThanOrEqual(2);
|
||||
expect(logs[0]).toEqual(`Call BPF program ${program.publicKey.toBase58()}`);
|
||||
expect(logs[logs.length - 1]).toEqual(
|
||||
`BPF program ${program.publicKey.toBase58()} success`,
|
||||
);
|
||||
});
|
||||
|
||||
test('simulate transaction with bad programId', async () => {
|
||||
const simulatedTransaction = new Transaction().add({
|
||||
keys: [
|
||||
|
Reference in New Issue
Block a user