Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

LL-6794 Add ability to overrides plugins + be chainId ready #658

Merged
merged 4 commits into from
Sep 16, 2021
Merged

Conversation

gre
Copy link
Contributor

@gre gre commented Sep 16, 2021

  • added a way to disable the baseURL fetching of plugin
  • added a way to explicitely provide the plugins data instead of fetching it
  • add test to cover the new mechanism
    • disable fully the baseURL should disable plugin
    • disable the baseURL + hardcoded plugin config should enable plugin
  • update the "importer" to split per chainId too can't do this until this happens in CAL

gist

const eth = new Eth(transport);
eth.setPluginsLoadConfig({
  baseURL: null, // disable fully the data fetching
  extraPlugins: { ...some plugins... } // specify extra plugins to be added
})
eth.setPluginsLoadConfig({
  baseURL:"https://cdn.live.ledger-stg.com", // use a staging api
})

@gre gre changed the title Add ability to overrides plugins + be chainId ready LL-6794 Add ability to overrides plugins + be chainId ready Sep 16, 2021
@codecov
Copy link

codecov bot commented Sep 16, 2021

Codecov Report

Merging #658 (73519a8) into master (e1d07e7) will increase coverage by 0.24%.
The diff coverage is 95.23%.

❗ Current head 73519a8 differs from pull request most recent head 7606dc7. Consider uploading reports for the commit 7606dc7 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #658      +/-   ##
==========================================
+ Coverage   42.42%   42.66%   +0.24%     
==========================================
  Files          72       72              
  Lines        4255     4268      +13     
  Branches      711      705       -6     
==========================================
+ Hits         1805     1821      +16     
+ Misses       2436     2433       -3     
  Partials       14       14              
Impacted Files Coverage Δ
packages/hw-app-eth/src/contracts.ts 96.00% <93.33%> (+21.00%) ⬆️
packages/hw-app-eth/src/Eth.ts 85.15% <100.00%> (+0.13%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e1d07e7...7606dc7. Read the comment docs.

@gre
Copy link
Contributor Author

gre commented Sep 16, 2021

i'll rollback the idea to split per chainId because there is possibly no need to do so.

The idea i had was:

LEGACY: https://cdn.live.ledger.com/plugins/ethereum.json
NEW: https://cdn.live.ledger.com/plugins/ethereum/${chainId}.json

for now, we stay on just having all in ethereum.json

@gre gre merged commit cbad4a2 into master Sep 16, 2021
@gre gre deleted the LL-6794 branch September 16, 2021 15:31
@pscott
Copy link
Contributor

pscott commented Sep 17, 2021

Late to the party but thanks for the work @gre :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants