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

[fix] allow asset importers to define which content they can load #772

Merged
merged 1 commit into from
Jan 31, 2022

Conversation

YBadiss
Copy link

@YBadiss YBadiss commented Jan 21, 2022

Ethereum plugins as defined in https://github.com/LedgerHQ/ledger-asset-dapps/ don't necessarily have a b2c.json file anymore, in which case they should just be ignored by the Live for now as they are only defined for B2B.

The ethereum-plugins.js importer fails to load the plugin in question, and raises an exception that is properly caught and logged by the main script.
However the error can be scary, and does not need to be raised in this case, so I added the notion of shouldLoad which allows importers to decide whether to skip a file or not. This notion already existed implicitly (checking if the file is a JSON), and I have simply extended it.

Let me know if this implementation suits you =]

@YBadiss YBadiss requested a review from gre January 21, 2022 11:14
@YBadiss YBadiss self-assigned this Jan 21, 2022
@YBadiss YBadiss requested a review from a team as a code owner January 21, 2022 11:14
@YBadiss YBadiss removed their assignment Jan 21, 2022
@codecov
Copy link

codecov bot commented Jan 21, 2022

Codecov Report

Merging #772 (80d8b7b) into master (97d487f) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #772   +/-   ##
=======================================
  Coverage   43.51%   43.51%           
=======================================
  Files          81       81           
  Lines        4883     4883           
  Branches      859      859           
=======================================
  Hits         2125     2125           
  Misses       2744     2744           
  Partials       14       14           

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 97d487f...80d8b7b. Read the comment docs.

@gre gre merged commit 9093850 into LedgerHQ:master Jan 31, 2022
@YBadiss YBadiss deleted the fix/ethereum-plugin-importer branch January 31, 2022 15:26
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.

None yet

2 participants