Skip to content

Feat/tx cursor pagination #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 0 additions & 73 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/sdk-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"@injectivelabs/grpc-web": "^0.0.1",
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
"@injectivelabs/indexer-proto-ts": "1.13.9",
"@injectivelabs/indexer-proto-ts": "1.13.12",
"@injectivelabs/mito-proto-ts": "1.13.2",
"@injectivelabs/networks": "^1.15.2",
"@injectivelabs/olp-proto-ts": "1.13.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ExplorerValidator } from '../types/index.js'
import { IndexerGrpcExplorerApi } from './IndexerGrpcExplorerApi.js'

const injectiveAddress = mockFactory.injectiveAddress
const endpoints = getNetworkEndpoints(Network.MainnetSentry)
const endpoints = getNetworkEndpoints(Network.Devnet1)
const indexerGrpcExplorerApi = new IndexerGrpcExplorerApi(endpoints.indexer)

describe('IndexerGrpcExplorerApi', () => {
Expand Down Expand Up @@ -241,4 +241,66 @@ describe('IndexerGrpcExplorerApi', () => {
)
}
})

test.only('fetchTxsV2', async () => {
try {
const response = await indexerGrpcExplorerApi.fetchTxsV2({
perPage: 10,
type: 'cosmos.gov.v1beta1.MsgVote,cosmos.gov.v1.MsgVote',
})

const { data: txs } = response

expect(response).toBeDefined()

expect(txs).toBeDefined()
expect(txs).toEqual(expect.objectContaining<typeof txs>(txs))
} catch (e) {
console.error('IndexerGrpcExplorerApi.fetchTxV2 => ' + (e as any).message)
}
})
Comment on lines +245 to +261
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove .only from test

The test is currently set to run exclusively, which will skip all other tests. This is likely a development convenience but should be removed before merging.

-  test.only('fetchTxsV2', async () => {
+  test('fetchTxsV2', async () => {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
test.only('fetchTxsV2', async () => {
try {
const response = await indexerGrpcExplorerApi.fetchTxsV2({
perPage: 10,
type: 'cosmos.gov.v1beta1.MsgVote,cosmos.gov.v1.MsgVote',
})
const { data: txs } = response
expect(response).toBeDefined()
expect(txs).toBeDefined()
expect(txs).toEqual(expect.objectContaining<typeof txs>(txs))
} catch (e) {
console.error('IndexerGrpcExplorerApi.fetchTxV2 => ' + (e as any).message)
}
})
test('fetchTxsV2', async () => {
try {
const response = await indexerGrpcExplorerApi.fetchTxsV2({
perPage: 10,
type: 'cosmos.gov.v1beta1.MsgVote,cosmos.gov.v1.MsgVote',
})
const { data: txs } = response
expect(response).toBeDefined()
expect(txs).toBeDefined()
expect(txs).toEqual(expect.objectContaining<typeof txs>(txs))
} catch (e) {
console.error('IndexerGrpcExplorerApi.fetchTxV2 => ' + (e as any).message)
}
})
🧰 Tools
🪛 Biome (1.9.4)

[error] 245-245: Don't focus the test.

The 'only' method is often used for debugging or during implementation. It should be removed before deploying to production.
Consider removing 'only' to ensure all tests are executed.
Unsafe fix: Remove focus from test.

(lint/suspicious/noFocusedTests)

🤖 Prompt for AI Agents
In packages/sdk-ts/src/client/indexer/grpc/IndexerGrpcExplorerApi.spec.ts around
lines 245 to 261, the test case uses test.only which causes only this test to
run and skips all others. Remove the .only from the test declaration so that all
tests run normally during the test suite execution.


test('fetchAccountTxsV2', async () => {
try {
const response = await indexerGrpcExplorerApi.fetchAccountTxsV2({
address: 'inj17gkuet8f6pssxd8nycm3qr9d9y699rupv6397z',
perPage: 10,
})

expect(response).toBeDefined()
} catch (e) {
console.error(
'IndexerGrpcExplorerApi.fetchAccountTxsV2 => ' + (e as any).message,
)
}
})

test('fetchBlocksV2', async () => {
try {
const response = await indexerGrpcExplorerApi.fetchBlocksV2({
perPage: 10,
})

expect(response).toBeDefined()
} catch (e) {
console.error(
'IndexerGrpcExplorerApi.fetchBlocksV2 => ' + (e as any).message,
)
}
})

test('fetchContractTxsV2', async () => {
try {
const response = await indexerGrpcExplorerApi.fetchContractTxsV2({
contractAddress: 'inj1qk00h5atutpsv900x202pxx42npjr9thrzhgxn',
perPage: 10,
})

expect(response).toBeDefined()
} catch (e) {
console.error(
'IndexerGrpcExplorerApi.fetchContractTxsV2 => ' + (e as any).message,
)
}
})
})
Loading