File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -880,6 +880,15 @@ class KeyringController extends EventEmitter {
880880 }
881881 }
882882
883+ /**
884+ * Instantiate, initialize and return a new keyring
885+ *
886+ * The keyring instantiated is of the given `type`.
887+ *
888+ * @param {string } type - The type of keyring to add.
889+ * @param {Object } data - The data to restore a previously serialized keyring.
890+ * @returns {Promise<Keyring> } The new keyring.
891+ */
883892 async _newKeyring ( type , data ) {
884893 const keyringBuilder = this . getKeyringBuilderForType ( type ) ;
885894
@@ -899,13 +908,18 @@ class KeyringController extends EventEmitter {
899908 }
900909}
901910
902- function keyringBuilderFactory ( KeyringClass , BridgeClass ) {
903- const builder = ( ) => {
904- const constructorDependencies = BridgeClass ? new BridgeClass ( ) : undefined ;
905- return new KeyringClass ( constructorDependencies ) ;
906- } ;
911+ /**
912+ * Get builder function for `Keyring`
913+ *
914+ * Returns a builder function for `Keyring` with a `type` property.
915+ *
916+ * @param {typeof Keyring } Keyring - The Keyring class for the builder.
917+ * @returns {function: Keyring } A builder function for the given Keyring.
918+ */
919+ function keyringBuilderFactory ( Keyring ) {
920+ const builder = ( ) => new Keyring ( ) ;
907921
908- builder . type = KeyringClass . type ;
922+ builder . type = Keyring . type ;
909923
910924 return builder ;
911925}
You can’t perform that action at this time.
0 commit comments