예제 #1
0
        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));
        }
예제 #2
0
 public async Task SetIndexClaimable(UInt160 scriptHash, HashSet <CoinReference> coinReferences)
 {
     var raw = _binarySerializer.Serialize(coinReferences.ToArray());
     await _redisDbContext.Set(scriptHash.BuildIxClaimableKey(), raw);
 }
예제 #3
0
 public async Task SetIndexClaimable(UInt160 scriptHash, HashSet <CoinReference> coinReferences)
 {
     var json = _jsonConverter.SerializeObject(coinReferences.ToArray());
     await _redisDbJsonContext.Set(scriptHash.BuildIxClaimableKey(), json);
 }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }