@@ -116,44 +116,38 @@ func (wm *WalletManager) OwnerWallet(ctx context.Context, id WalletLookupID) (*O
116116
117117// IssuerWallet returns the issuer wallet bound to the passed identifier, if any is available.
118118// The identifier can be a label, as defined in the configuration file, an identity or a wallet ID.
119- // If no wallet is found, it returns nil .
120- func (wm * WalletManager ) IssuerWallet (ctx context.Context , id WalletLookupID ) * IssuerWallet {
119+ // If no wallet is found, it returns an error .
120+ func (wm * WalletManager ) IssuerWallet (ctx context.Context , id WalletLookupID ) ( * IssuerWallet , error ) {
121121 w , err := wm .walletService .IssuerWallet (ctx , id )
122122 if err != nil {
123- wm .managementService .logger .DebugfContext (ctx , "failed to get issuer wallet for id [%s]: [%s]" , id , err )
124-
125- return nil
123+ return nil , err
126124 }
127125
128- return & IssuerWallet {Wallet : & Wallet {w : w , managementService : wm .managementService }, w : w }
126+ return & IssuerWallet {Wallet : & Wallet {w : w , managementService : wm .managementService }, w : w }, nil
129127}
130128
131129// AuditorWallet returns the auditor wallet bound to the passed identifier, if any is available.
132130// The identifier can be a label, as defined in the configuration file, an identity or a wallet ID.
133- // If no wallet is found, it returns nil .
134- func (wm * WalletManager ) AuditorWallet (ctx context.Context , id WalletLookupID ) * AuditorWallet {
131+ // If no wallet is found, it returns an error .
132+ func (wm * WalletManager ) AuditorWallet (ctx context.Context , id WalletLookupID ) ( * AuditorWallet , error ) {
135133 w , err := wm .walletService .AuditorWallet (ctx , id )
136134 if err != nil {
137- wm .managementService .logger .DebugfContext (ctx , "failed to get auditor wallet for id [%s]: [%s]" , id , err )
138-
139- return nil
135+ return nil , err
140136 }
141137
142- return & AuditorWallet {Wallet : & Wallet {w : w , managementService : wm .managementService }, w : w }
138+ return & AuditorWallet {Wallet : & Wallet {w : w , managementService : wm .managementService }, w : w }, nil
143139}
144140
145141// CertifierWallet returns the certifier wallet bound to the passed identifier, if any is available.
146142// The identifier can be a label, as defined in the configuration file, an identity or a wallet ID.
147- // If no wallet is found, it returns nil .
148- func (wm * WalletManager ) CertifierWallet (ctx context.Context , id WalletLookupID ) * CertifierWallet {
143+ // If no wallet is found, it returns an error .
144+ func (wm * WalletManager ) CertifierWallet (ctx context.Context , id WalletLookupID ) ( * CertifierWallet , error ) {
149145 w , err := wm .walletService .CertifierWallet (ctx , id )
150146 if err != nil {
151- wm .managementService .logger .DebugfContext (ctx , "failed to get certifier wallet for id [%s]: [%s]" , id , err )
152-
153- return nil
147+ return nil , err
154148 }
155149
156- return & CertifierWallet {Wallet : & Wallet {w : w , managementService : wm .managementService }, w : w }
150+ return & CertifierWallet {Wallet : & Wallet {w : w , managementService : wm .managementService }, w : w }, nil
157151}
158152
159153// GetEnrollmentID returns the enrollment ID of passed identity
0 commit comments