Skip to content

Commit

Permalink
feat: Programmatically Execute Indexer Locally (#908)
Browse files Browse the repository at this point in the history
This PR sets up a local indexer class which leverages the in memory dml
handler class and a no op indexer meta class to fully execute indexer
logic locally on a block. The class is responsible for downloading block
data and providing helper functions to abstract testing logic away. This
PR also sets up a core-indexers folder which is used to verify that the
created local indexer is actually capable of executing indexer code
locally. The core-indexers folder may be temporary as we do intend to
eventually publish a testing framework npm package. For the time being,
it uses relative imports to work.
  • Loading branch information
darunrs authored Jul 24, 2024
1 parent 38ac863 commit 2add172
Show file tree
Hide file tree
Showing 24 changed files with 7,365 additions and 122 deletions.
35 changes: 35 additions & 0 deletions core-indexers/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
parser: '@typescript-eslint/parser',
env: {
es2021: true,
node: true
},
overrides: [
{
files: ['.eslintrc.js', 'jest.config.js'],
parser: 'espree',
extends: ['standard'],
rules: {
semi: ['error', 'always'],
quotes: ['error', 'single'],
'array-callback-return': ['error', { allowImplicit: false }]
}
},
{
files: ['**/*.ts'],
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname
},
extends: [
'standard-with-typescript'
],
rules: {
'@typescript-eslint/semi': ['error', 'always'],
'@typescript-eslint/comma-dangle': ['error', 'only-multiline'],
'@typescript-eslint/strict-boolean-expressions': 'off',
'array-callback-return': ['error', { allowImplicit: false }]
}
}
]
};
6 changes: 6 additions & 0 deletions core-indexers/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testTimeout: 10000
};
Loading

0 comments on commit 2add172

Please sign in to comment.