MCPcopy
hub / github.com/subquery/subql / TestBlockchainService

Class TestBlockchainService

packages/node-core/src/indexer/fetch.service.spec.ts:67–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67class TestBlockchainService implements IBlockchainService {
68 finalizedHeight = 1000;
69 bestHeight = 20;
70 blockHandlerKind = '';
71 packageVersion = '1.0.0';
72 // eslint-disable-next-line @typescript-eslint/promise-function-async
73 fetchBlocks(blockNums: number[]): Promise<IBlock<any>[]> {
74 throw new Error('Method not implemented.');
75 }
76 // eslint-disable-next-line @typescript-eslint/promise-function-async
77 fetchBlockWorker(
78 worker: IBaseIndexerWorker,
79 blockNum: number,
80 context: {workers: IBaseIndexerWorker[]}
81 ): Promise<Header> {
82 throw new Error('Method not implemented.');
83 }
84 async getFinalizedHeader(): Promise<Header> {
85 return Promise.resolve({
86 blockHeight: this.finalizedHeight,
87 blockHash: '0xxx',
88 parentHash: '0xxx',
89 timestamp: new Date(),
90 });
91 }
92 async getBestHeight(): Promise<number> {
93 return Promise.resolve(this.bestHeight);
94 }
95 async getChainInterval(): Promise<number> {
96 return Promise.resolve(CHAIN_INTERVAL);
97 }
98 getBlockSize(block: IBlock): number {
99 throw new Error('Not implemented');
100 }
101 // eslint-disable-next-line @typescript-eslint/promise-function-async
102 getHeaderForHash(hash: string): Promise<Header> {
103 throw new Error('Method not implemented.');
104 }
105 // eslint-disable-next-line @typescript-eslint/promise-function-async
106 getHeaderForHeight(height: number): Promise<Header> {
107 throw new Error('Method not implemented.');
108 }
109 // eslint-disable-next-line @typescript-eslint/promise-function-async
110 updateDynamicDs(
111 params: DatasourceParams,
112 template: BaseDataSource | (BaseCustomDataSource & BaseDataSource)
113 ): Promise<void> {
114 throw new Error('Method not implemented.');
115 }
116 isCustomDs(x: BaseDataSource | (BaseCustomDataSource & BaseDataSource)): x is BaseCustomDataSource {
117 throw new Error('Method not implemented.');
118 }
119 isRuntimeDs(x: BaseDataSource | (BaseCustomDataSource & BaseDataSource)): x is BaseDataSource {
120 throw new Error('Method not implemented.');
121 }
122 // eslint-disable-next-line @typescript-eslint/promise-function-async
123 getSafeApi(block: any): Promise<any> {
124 throw new Error('Method not implemented.');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected