File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export interface Signer {
2020
2121export interface SapientSigner {
2222 readonly address : MaybePromise < Address . Address >
23- readonly imageHash : MaybePromise < Hex . Hex | undefined >
23+ readonly imageHash : MaybePromise < Hex . Hex >
2424
2525 signSapient : (
2626 wallet : Address . Address ,
Original file line number Diff line number Diff line change @@ -49,15 +49,15 @@ export class SessionManager implements SapientSigner {
4949 this . _provider = options . provider
5050 }
5151
52- get imageHash ( ) : Promise < Hex . Hex | undefined > {
52+ get imageHash ( ) : Promise < Hex . Hex > {
5353 return this . getImageHash ( )
5454 }
5555
56- async getImageHash ( ) : Promise < Hex . Hex | undefined > {
56+ async getImageHash ( ) : Promise < Hex . Hex > {
5757 const { configuration } = await this . wallet . getStatus ( )
5858 const sessionConfigLeaf = Config . findSignerLeaf ( configuration , this . address )
5959 if ( ! sessionConfigLeaf || ! Config . isSapientSignerLeaf ( sessionConfigLeaf ) ) {
60- return undefined
60+ throw new Error ( `Session configuration not found for wallet ${ this . wallet . address } ` )
6161 }
6262 return sessionConfigLeaf . imageHash
6363 }
Original file line number Diff line number Diff line change @@ -898,9 +898,7 @@ export class ChainSessionManager {
898898 ...envelope . payload ,
899899 parentWallets : [ this . wallet . address ] ,
900900 }
901- const imageHash = await this . sessionManager . imageHash
902- if ( imageHash === undefined ) throw new SessionConfigError ( 'Session manager image hash is undefined' )
903-
901+ const imageHash = await this . sessionManager . getImageHash ( )
904902 const signature = await this . sessionManager . signSapient (
905903 this . wallet . address ,
906904 this . chainId ,
You can’t perform that action at this time.
0 commit comments