Skip to content

Commit

Permalink
fix: latest swaps (#2019)
Browse files Browse the repository at this point in the history
* fix pick initial swap block height for latestSwaps

* chore: changeset

* fix: tests
  • Loading branch information
VanishMax authored Feb 4, 2025
1 parent 68b8f36 commit dd09e58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/curvy-buses-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@penumbra-zone/services': patch
---

Fix latestSwaps method by picking initial swap block height instead of claim height
1 change: 1 addition & 0 deletions packages/services/src/view-service/latest-swaps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ const getSwap = ({ account, to, from, height, input, output }: GetSwapOptions) =
claimAddress: getAddressByIndex(testFullViewingKey, account),
},
outputData: {
height: BigInt(height),
tradingPair: {
asset1: from.penumbraAssetId,
asset2: to.penumbraAssetId,
Expand Down
2 changes: 1 addition & 1 deletion packages/services/src/view-service/latest-swaps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const latestSwaps: Impl['latestSwaps'] = async function* (_req, ctx) {
counter++;
yield {
id: new TransactionId({ inner: swapRecord.source.source.value.id }),
blockHeight: swapRecord.heightClaimed,
blockHeight: swapRecord.outputData.height,
pair: new DirectedTradingPair({
start: swapRecord.outputData.tradingPair.asset1,
end: swapRecord.outputData.tradingPair.asset2,
Expand Down

0 comments on commit dd09e58

Please sign in to comment.