Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Fix/unavailable capabilites #875

Merged
merged 5 commits into from
Aug 19, 2021
Merged

Conversation

szymonlesisz
Copy link
Contributor

@szymonlesisz szymonlesisz commented Aug 17, 2021

Motivation:
config.json fields and device.unavailableCapabilities were inconsistent

Problems:

  • invalid detection - 'no-capability' (from device.features) was set before 'no-support' (from coins.json)
  • there was no possibility to disable support (using "0" value) from config.json
  • device.unavailableCapabilities returns literal string (reason) OR array of strings (not anymore)
  • config.json supportedFirmware rules confusing field names (excludedMethods mixed with defined capability/feature)
  • there was no tests for getFirmwareRange utility

support should be determined by coins.json before reading capabilites from the device features
- override current range if min/max value equals "0"
- refactored search of "supportedFirmware" rule
- added unit tests for getFirmwareRange utility
- methods: real trezor-connect methods validated in runtime using "getFirmwareRange" utility, not listed in device.unavailableCapabilities
- capabilities: defined feature potentially listed in device.unavailableCapabilities
@szymonlesisz szymonlesisz marked this pull request as ready for review August 17, 2021 17:09
Copy link
Contributor

@marekrjpolak marekrjpolak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably OK

@szymonlesisz szymonlesisz merged commit 6464735 into develop Aug 19, 2021
@szymonlesisz szymonlesisz deleted the fix/unavailableCapabilites branch August 19, 2021 13:46
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

3 participants