MCPcopy Create free account
hub / github.com/subquery/subql / getSafe

Method getSafe

packages/node-core/src/utils/blockHeightMap.ts:35–41  ·  view source on GitHub ↗
(height: number)

Source from the content-addressed store, hash-verified

33
34 // Same as get but wont throw when there is nothing in the block range
35 getSafe(height: number): T | undefined {
36 try {
37 return this.get(height);
38 } catch (e) {
39 return undefined;
40 }
41 }
42
43 getDetails(height: number): GetRange<T> | undefined {
44 let result: GetRange<T> | undefined;

Callers 1

Calls 1

getMethod · 0.95

Tested by

no test coverage detected