Skip to content

Commit

Permalink
Fix runtime service tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stwiname committed Feb 5, 2025
1 parent 3887587 commit 0c07ced
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/node/src/indexer/runtime/runtime.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,11 @@ describe('Runtime service', () => {
let dictionaryService: SubstrateDictionaryService;
let apiService: ApiService;

beforeEach(async () => {
beforeEach(() => {
dictionaryService = getDictionaryService();
apiService = getApiService();

runtimeService = new RuntimeService(apiService);
await runtimeService.init(0, 50_000, dictionaryService);
});

it('doesnt refetch metadata when spec version doesnt change', async () => {
Expand Down Expand Up @@ -117,7 +116,8 @@ describe('Runtime service', () => {
it('use dictionary and specVersionMap to get block specVersion', async () => {
(dictionaryService as any).useDictionary = (height: number) => true;

// This is called in fetchService.preLoopHook
// This is called in init.ts to bootsrap the application
await runtimeService.init(0, 29233, dictionaryService);
await runtimeService.syncDictionarySpecVersions();

const metaSpy = jest.spyOn(apiService.api.rpc.state, 'getRuntimeVersion');
Expand All @@ -129,6 +129,7 @@ describe('Runtime service', () => {

it('getSpecVersion will fetch the spec version if its not in the map', async () => {
(dictionaryService as any).useDictionary = (height: number) => true;
(runtimeService as any).dictionaryService = dictionaryService;

const height = 3967204;

Expand Down

0 comments on commit 0c07ced

Please sign in to comment.