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