A previous refactor unified all keyfile generation to a single hook, useMultiKeyfileGenerator, to be used in all Keyfile download interactions. This turned out to cause issues booting L1 ships.
Changes
This PR resolves #895 ~by restoring single keyfile generation for Home view touchpoints (Network Keys, Home > OS, etc.). It also updates the single keyfile generator to use the new compileMultikey implementation~
~There is also some renaming for improved readability, and simplification of the multi key generator (now that it's only used during Activation flow).~
update
To address PR feedback, the implementation of useKeyfileGenerator is refactored. It is now a base hook that can be used by itself, or composed within other React hooks.
There are two new hooks that wrap it to provide the keyfile generation functionality, based on the application context:
In the Home view (Set Network Keys, Home > OS, Home > ID), a hook called useHomeKeyfileGenerator is now used.
In the Activation view, a hook called useActivationKeyfileGenerator is now used.
Both wrap the base hook, the difference is how the network key seeds are derived (for consumption by the base hook).
Context
A previous refactor unified all keyfile generation to a single hook, useMultiKeyfileGenerator, to be used in all Keyfile download interactions. This turned out to cause issues booting L1 ships.
Changes
This PR resolves #895 ~by restoring single keyfile generation for Home view touchpoints (Network Keys, Home > OS, etc.). It also updates the single keyfile generator to use the new compileMultikey implementation~
~There is also some renaming for improved readability, and simplification of the multi key generator (now that it's only used during Activation flow).~
update To address PR feedback, the implementation of
useKeyfileGenerator
is refactored. It is now a base hook that can be used by itself, or composed within other React hooks.There are two new hooks that wrap it to provide the keyfile generation functionality, based on the application context:
In the Home view (Set Network Keys, Home > OS, Home > ID), a hook called
useHomeKeyfileGenerator
is now used. In the Activation view, a hook calleduseActivationKeyfileGenerator
is now used.Both wrap the base hook, the difference is how the network key seeds are derived (for consumption by the base hook).
Testing