Skip to content

Commit

Permalink
chore: temporary override chain-history version to support pre-p2p ba…
Browse files Browse the repository at this point in the history
…ck-end

pre-p2p back-ends accept maximum 3.0.1 chain-history provider version.
Override the `3.1.0` default version, so that requests can be used
against `3.0.1` back-ends.
  • Loading branch information
mirceahasegan committed Jun 19, 2024
1 parent d979d7b commit 822ed97
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ export const useChainHistoryProvider = ({ chainName }: UseChainHistoryProviderAr
const baseCardanoServicesUrl = getBaseUrlForChain(chainName);

return useMemo(
() => chainHistoryHttpProvider({ adapter: axiosFetchAdapter, baseUrl: baseCardanoServicesUrl, logger }),
() =>
chainHistoryHttpProvider({
adapter: axiosFetchAdapter,
baseUrl: baseCardanoServicesUrl,
logger,
// TODO: remove apiVersion override once the back-ends are all updated to P2P (Node 8.9.2)
apiVersion: '3.0.1'
}),
[baseCardanoServicesUrl]
);
};
3 changes: 2 additions & 1 deletion packages/cardano/src/wallet/lib/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export const createProviders = ({
txSubmitProvider: createTxSubmitProvider(httpProviderConfig, customSubmitTxUrl),
stakePoolProvider: stakePoolHttpProvider(httpProviderConfig),
utxoProvider: utxoHttpProvider(httpProviderConfig),
chainHistoryProvider: chainHistoryHttpProvider(httpProviderConfig),
// TODO: remove apiVersion override once the back-ends are all updated to P2P (Node 8.9.2)
chainHistoryProvider: chainHistoryHttpProvider({ ...httpProviderConfig, apiVersion: '3.0.1' }),
rewardsProvider: rewardsHttpProvider(httpProviderConfig)
};
};

0 comments on commit 822ed97

Please sign in to comment.