Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix(query): separate sort key and block height into separate state at…
Browse files Browse the repository at this point in the history
…tributes
  • Loading branch information
dtfiedler committed Nov 30, 2023
1 parent 305a9e6 commit 1c237f2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/routes/contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from '../types';
import { getContractReadInteraction, getContractState } from '../api/warp';
import { getWalletInteractionsForContract } from '../api/graphql';
import { NotFoundError } from '../errors';
import { BadRequestError, NotFoundError } from '../errors';
import { mismatchedInteractionCount } from '../metrics';

export async function contractHandler(ctx: KoaContext) {
Expand Down Expand Up @@ -54,6 +54,12 @@ export async function contractInteractionsHandler(ctx: KoaContext) {
const { arweave, logger, warp, sortKey, blockHeight } = ctx.state;
const { contractTxId, address } = ctx.params;

if (sortKey) {
throw new BadRequestError(
'Sort key is not supported for contract interactions',
);
}

logger.debug('Fetching all contract interactions', {
contractTxId,
});
Expand All @@ -69,7 +75,10 @@ export async function contractInteractionsHandler(ctx: KoaContext) {
getWalletInteractionsForContract(arweave, {
address,
contractTxId,
<<<<<<< HEAD
sortKey,
=======
>>>>>>> b504466 (fix(query): separate sort key and block height into separate state attributes)
blockHeight,
}),
]);
Expand Down

0 comments on commit 1c237f2

Please sign in to comment.