diff options
author | Sebastian <sebasjm@gmail.com> | 2024-04-22 12:50:25 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-04-22 12:50:25 -0300 |
commit | 82b8e83ca635bd27954565e2c29c77e0a75b3fc0 (patch) | |
tree | 0f73cdfde72d2cbaa43be332a9beab1080283a89 /packages/web-util/src/context/challenger-api.ts | |
parent | 5db4cb99e3f16c8471117ca7443bc323180e67ec (diff) | |
download | wallet-core-82b8e83ca635bd27954565e2c29c77e0a75b3fc0.tar.xz |
fix #8398
Diffstat (limited to 'packages/web-util/src/context/challenger-api.ts')
-rw-r--r-- | packages/web-util/src/context/challenger-api.ts | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/web-util/src/context/challenger-api.ts b/packages/web-util/src/context/challenger-api.ts index 960f1db0d..8748f5f69 100644 --- a/packages/web-util/src/context/challenger-api.ts +++ b/packages/web-util/src/context/challenger-api.ts @@ -15,7 +15,9 @@ */ import { + CacheEvictor, ChallengerApi, + ChallengerCacheEviction, ChallengerHttpClient, LibtoolVersion, ObservabilityEvent, @@ -63,7 +65,9 @@ enum VersionHint { NONE, } -type Evictors = Record<string, never>; +type Evictors = { + challenger?: CacheEvictor<ChallengerCacheEviction>; +} type ConfigResult<T> = | undefined @@ -174,10 +178,10 @@ function buildChallengerApiClient( }, }); - const bank = new ChallengerHttpClient(url.href, httpLib); + const challenger = new ChallengerHttpClient(url.href, httpLib, evictors.challenger); async function getRemoteConfig(): Promise<ChallengerApi.ChallengerTermsOfServiceResponse> { - const resp = await bank.getConfig(); + const resp = await challenger.getConfig(); if (resp.type === "fail") { throw TalerError.fromUncheckedDetail(resp.detail); } @@ -186,9 +190,9 @@ function buildChallengerApiClient( return { getRemoteConfig, - VERSION: bank.PROTOCOL_VERSION, + VERSION: challenger.PROTOCOL_VERSION, lib: { - bank, + challenger, }, onActivity: tracker.subscribe, cancelRequest: httpLib.cancelRequest, |