Example #1
0
        public async Task <RelayCollection> GetAsync(string hubAddress, IRelayPriorityPolicy policy)
        {
            var relays = await GetRelaysFromEvents(hubAddress).ConfigureAwait(false);

            if (relays.Count == 0)
            {
                throw new GSNNoRegisteredRelaysException(hubAddress);
            }

            // TODO: filter relays by minDelay and minStake
            return(new RelayCollection(_relayClient, policy.Execute(relays)));
        }
Example #2
0
        public async Task <RelayCollection> GetRelaysAsync(string hubAddress, IRelayPriorityPolicy policy)
        {
            var relays = await GetRelaysFromEvents(hubAddress);

            if (relays.Count == 0)
            {
                throw new Exception($"No relayers registered in the requested hub at {hubAddress}");
            }

            // TODO: filter relays by minDelay and minStake
            return(new RelayCollection(_relayClient, policy.Execute(relays)));
        }
Example #3
0
 public Task <RelayCollection> GetRelaysAsync(string hubAddress, IRelayPriorityPolicy policy)
 {
     return(_relayQuery.GetAsync(hubAddress, policy));
 }