public async Task <HashSet <CoinReference> > GetIndexConfirmed(UInt160 scriptHash) { var redisVal = await _redisDbContext.Get(scriptHash.BuildIxConfirmedKey()); if (redisVal == RedisValue.Null) { return(new HashSet <CoinReference>()); } return(JsonConvert.DeserializeObject <HashSet <CoinReference> >(redisVal)); }
public async Task SetIndexConfirmed(UInt160 scriptHash, HashSet <CoinReference> coinReferences) { var raw = _binarySerializer.Serialize(coinReferences.ToArray()); await _redisDbContext.Set(scriptHash.BuildIxConfirmedKey(), raw); }
public async Task SetIndexConfirmed(UInt160 scriptHash, HashSet <CoinReference> coinReferences) { var json = _jsonConverter.SerializeObject(coinReferences); await _redisDbJsonContext.Set(scriptHash.BuildIxConfirmedKey(), json); }
public async Task <HashSet <CoinReference> > GetIndexConfirmed(UInt160 scriptHash) { var raw = await _redisDbContext.Get(scriptHash.BuildIxConfirmedKey()); return(raw.IsNull ? new HashSet <CoinReference>() : _binarySerializer.Deserialize <HashSet <CoinReference> >(raw)); }
public async Task <HashSet <CoinReference> > GetIndexConfirmed(UInt160 scriptHash) { var redisVal = await _redisDbJsonContext.Get(scriptHash.BuildIxConfirmedKey()); return(redisVal.IsNull ? new HashSet <CoinReference>() : _jsonConverter.DeserializeObject <HashSet <CoinReference> >(redisVal)); }