Example #1
0
        /// <inheritdoc />
        public virtual async Task <ParseResponseResult> LookupDefinitionAsync(IAgentContext agentContext,
                                                                              string definitionId)
        {
            async Task <ParseResponseResult> LookupDefinition()
            {
                var req = await IndyLedger.BuildGetCredDefRequestAsync(null, definitionId);

                var res = await IndyLedger.SubmitRequestAsync(await agentContext.Pool, req);

                return(await IndyLedger.ParseGetCredDefResponseAsync(res));
            }

            return(await ResilienceUtils.RetryPolicyAsync(
                       action : LookupDefinition,
                       exceptionPredicate : (IndyException e) => e.SdkErrorCode == 309));
        }
Example #2
0
        /// <inheritdoc />
        public virtual async Task <ParseResponseResult> LookupSchemaAsync(IAgentContext agentContext, string schemaId)
        {
            async Task <ParseResponseResult> LookupSchema()
            {
                var req = await IndyLedger.BuildGetSchemaRequestAsync(null, schemaId);

                var res = await IndyLedger.SubmitRequestAsync(await agentContext.Pool, req);

                EnsureSuccessResponse(res);

                return(await IndyLedger.ParseGetSchemaResponseAsync(res));
            };

            return(await ResilienceUtils.RetryPolicyAsync(
                       action : LookupSchema,
                       exceptionPredicate : (IndyException e) => e.SdkErrorCode == 309));
        }