Skip to content

Commit d94ccc4

Browse files
committed
fix: use undefined instead of -1
1 parent f7b5bb1 commit d94ccc4

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

apps/price_pusher/src/injective/injective.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import { Logger } from "pino";
2222

2323
const DEFAULT_GAS_PRICE = 160000000;
2424
const DEFAULT_GAS_MULTIPLIER = 1.05;
25-
const DEFAULT_PRICE_IDS_PROCESS_CHUNK_SIZE = -1;
2625
const INJECTIVE_TESTNET_CHAIN_ID = "injective-888";
2726

2827
type PriceQueryResponse = {
@@ -92,7 +91,9 @@ type InjectiveConfig = {
9291
chainId: string;
9392
gasMultiplier: number;
9493
gasPrice: number;
95-
priceIdsProcessChunkSize: number;
94+
// The number of price ids to process in a single chunk. If not provided,
95+
// all price ids will be processed in a single chunk.
96+
priceIdsProcessChunkSize: number | undefined;
9697
};
9798
export class InjectivePricePusher implements IPricePusher {
9899
private wallet: PrivateKey;
@@ -113,9 +114,7 @@ export class InjectivePricePusher implements IPricePusher {
113114
chainId: chainConfig?.chainId ?? INJECTIVE_TESTNET_CHAIN_ID,
114115
gasMultiplier: chainConfig?.gasMultiplier ?? DEFAULT_GAS_MULTIPLIER,
115116
gasPrice: chainConfig?.gasPrice ?? DEFAULT_GAS_PRICE,
116-
priceIdsProcessChunkSize:
117-
chainConfig?.priceIdsProcessChunkSize ??
118-
DEFAULT_PRICE_IDS_PROCESS_CHUNK_SIZE,
117+
priceIdsProcessChunkSize: chainConfig?.priceIdsProcessChunkSize,
119118
};
120119
}
121120

@@ -215,7 +214,7 @@ export class InjectivePricePusher implements IPricePusher {
215214
throw new Error("Invalid arguments");
216215

217216
const priceIdChunks =
218-
this.chainConfig.priceIdsProcessChunkSize === -1
217+
this.chainConfig.priceIdsProcessChunkSize === undefined
219218
? [priceIds]
220219
: splitArrayToChunks({
221220
array: priceIds,

0 commit comments

Comments
 (0)