@@ -64,7 +64,7 @@ func (ls LedgerService) QueryDIDDoc(did string) (cheqd.Did, cheqd.Metadata, bool
6464}
6565
6666func (ls LedgerService ) QueryResource (did string , resourceId string ) (resource.Resource , bool , error ) {
67- collectionId , namespace , _ , _ := cheqdUtils .TrySplitDID (did )
67+ _ , namespace , collectionId , _ := cheqdUtils .TrySplitDID (did )
6868 serverAddr , namespaceFound := ls .ledgers [namespace ]
6969 if ! namespaceFound {
7070 return resource.Resource {}, false , fmt .Errorf ("namespace not supported: %s" , namespace )
@@ -78,11 +78,12 @@ func (ls LedgerService) QueryResource(did string, resourceId string) (resource.R
7878
7979 defer mustCloseGRPCConnection (conn )
8080
81- log .Info ().Msgf ("Querying did resource: %s, %s" , did , resourceId )
81+ log .Info ().Msgf ("Querying did resource: %s, %s" , collectionId , resourceId )
8282
8383 client := resource .NewQueryClient (conn )
8484 resourceResponse , err := client .Resource (context .Background (), & resource.QueryGetResourceRequest {CollectionId : collectionId , Id : resourceId })
8585 if err != nil {
86+ log .Info ().Msgf ("Resource not found %s" , err .Error ())
8687 return resource.Resource {}, false , nil
8788 }
8889
0 commit comments