Skip to content

Commit 2d2f942

Browse files
committed
ft_watcher: fix executeFastOrderLocal parser
Signed-off-by: bingyuyap <bingyu.yap.21@gmail.com>
1 parent bd0aac0 commit 2d2f942

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

watcher/src/watchers/FastTransferSolanaWatcher.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@solana/web3.js';
1313
import { findFromSignatureAndToSignature } from '../utils/solana';
1414
import { makeBlockKey } from '../databases/utils';
15-
import { BorshCoder, BorshInstructionCoder, Instruction } from '@coral-xyz/anchor';
15+
import { BorshCoder, Instruction } from '@coral-xyz/anchor';
1616
import { decodeTransferInstruction } from '@solana/spl-token';
1717

1818
import MATCHING_ENGINE_IDL from '../idls/matching_engine.json';
@@ -529,8 +529,8 @@ export class FastTransferSolanaWatcher extends SolanaWatcher {
529529
const accountKeys = res.transaction.message.getAccountKeys().staticAccountKeys;
530530
const accountKeyIndexes = instruction.accountKeyIndexes;
531531
const payerAccountPubkey = accountKeys[accountKeyIndexes[0]];
532-
const fastVaaAccountPubkey = accountKeys[accountKeyIndexes[3]];
533-
const auctionAccountPubkey = accountKeys[accountKeyIndexes[4]];
532+
const fastVaaAccountPubkey = accountKeys[accountKeyIndexes[2]];
533+
const auctionAccountPubkey = accountKeys[accountKeyIndexes[3]];
534534

535535
const { id, info } = await this.computeExecutionData(
536536
res,

watcher/src/watchers/__tests__/FastTransferSolanaWatcher.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ test('should parse improveOffer', async () => {
9898

9999
// TODO: solver is broken and not running after latest deployment,
100100
// will update tests when they are fixed and running
101-
test.skip('should parse executeFastOrderLocal', async () => {
101+
test('should parse executeFastOrderLocal', async () => {
102102
const watcher = new FastTransferSolanaWatcher('Testnet', true);
103103
const txHash =
104-
'wKDEbC56KnUFkbPgmnyxPRxwfZpAJ2vBLxeZif9VQWrWgLj1AByEBsDMdJm7rTeVmhiBGcB6PsGfmxKDcP978r9';
104+
'7AfmUeb6sM4HRLyw8ZmmaC5R2SFAzgQAH4YbD2fmnDmDPAcdxAk9Rhi3xktrGoE7bB2VHiBhs3JSvgiFzo6yUPr';
105105

106106
const tx = await watcher.getConnection().getTransaction(txHash, {
107107
maxSupportedTransactionVersion: 0,
@@ -116,11 +116,11 @@ test.skip('should parse executeFastOrderLocal', async () => {
116116
const info = await watcher.parseExecuteFastOrderLocal(tx, ix);
117117
expect(info).toEqual({
118118
status: 'executed',
119-
penalty: 0n,
120-
user_amount: 8000000n,
121-
execution_payer: 'gyVfT39y3tWQnfXwxY6Hj7ZeLFN2K8Z6heWEJ4zxYRB',
122-
execution_slot: 294811396n,
123-
execution_time: new Date('2024-04-26T14:38:17.000Z'),
119+
penalty: 439875n,
120+
user_amount: 8293250n,
121+
execution_payer: 'ToML4kX31x56WDnXW4mVzivUTgXk1kL53cmVTaNeaZi',
122+
execution_slot: 300868424n,
123+
execution_time: new Date('2024-05-23T15:58:23.000Z'),
124124
execution_tx_hash: txHash,
125125
});
126126
});

0 commit comments

Comments
 (0)