Skip to content

Commit

Permalink
fix(core): LIT-2706 - Tell TS that we've provided defaults for everyt…
Browse files Browse the repository at this point in the history
…hing on `this.config` except `litNetwork` when using `LitNodeClientConfig` inside of `core`.
  • Loading branch information
MaximusHaximus authored and Ansonhkg committed Mar 22, 2024
1 parent f902a49 commit 519bff7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/core/src/lib/lit-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,28 @@ interface EpochCache {
lastUpdateTime: null | number;
}

export type LitNodeClientConfigWithDefaults = Required<
Pick<
LitNodeClientConfig,
| 'bootstrapUrls'
| 'alertWhenUnauthorized'
| 'debug'
| 'connectTimeout'
| 'checkNodeAttestation'
| 'litNetwork'
| 'minNodeCount'
| 'retryTolerance'
>
> &
Partial<Pick<LitNodeClientConfig, 'storageProvider' | 'contractContext'>>;

// On epoch change, we wait this many seconds for the nodes to update to the new epoch before using the new epoch #
const EPOCH_PROPAGATION_DELAY = 30_000;
// This interval is responsible for keeping latest block hash up to date
const NETWORK_SYNC_INTERVAL = 30_000;

export class LitCore {
config: LitNodeClientConfig = {
config: LitNodeClientConfigWithDefaults = {
alertWhenUnauthorized: false,
debug: true,
connectTimeout: 20000,
Expand Down

0 comments on commit 519bff7

Please sign in to comment.