@@ -324,7 +324,7 @@ export type SerializedKeyring = {
324
324
/**
325
325
* State/data that can be updated during a `withKeyring` operation.
326
326
*/
327
- type UpdatableState = {
327
+ type SessionState = {
328
328
keyrings : SerializedKeyring [ ] ;
329
329
keyringsMetadata : KeyringMetadata [ ] ;
330
330
password ?: string ;
@@ -2167,13 +2167,14 @@ export class KeyringController extends BaseController<
2167
2167
* @returns An object with serialized keyrings, keyrings metadata,
2168
2168
* and the user password.
2169
2169
*/
2170
- async #getControllerSessionState ( ) : Promise < SessionState > {
2170
+ async #getSessionState ( ) : Promise < SessionState > {
2171
2171
return {
2172
2172
keyrings : await this . #getSerializedKeyrings( ) ,
2173
2173
keyringsMetadata : this . #keyringsMetadata. slice ( ) , // Force copy.
2174
2174
password : this . #password,
2175
2175
} ;
2176
2176
}
2177
+
2177
2178
/**
2178
2179
* Restore a serialized keyrings array.
2179
2180
*
@@ -2655,9 +2656,9 @@ export class KeyringController extends BaseController<
2655
2656
callback : MutuallyExclusiveCallback < Result > ,
2656
2657
) : Promise < Result > {
2657
2658
return this . #withRollback( async ( { releaseLock } ) => {
2658
- const oldState = await this . #getUpdatableState ( ) ;
2659
+ const oldState = await this . #getSessionState ( ) ;
2659
2660
const callbackResult = await callback ( { releaseLock } ) ;
2660
- const newState = await this . #getUpdatableState ( ) ;
2661
+ const newState = await this . #getSessionState ( ) ;
2661
2662
2662
2663
// State is committed only if the operation is successful and need to trigger a vault update.
2663
2664
if ( ! isEqual ( oldState , newState ) ) {
0 commit comments