private async Task <bool> CheckExecutedDataInStoreAsync(BlockStateSet blockStateSet, string key, ByteString blockExecutedData) { var stateReturn = await _blockchainExecutedDataManager.GetExecutedCacheAsync(key, blockStateSet.BlockHeight, blockStateSet.BlockHash); stateReturn.Value.ShouldBe(blockExecutedData); return(stateReturn.IsInStore); }
public T GetBlockExecutedData(IBlockIndex chainContext, string key) { if (!_changeHeight.TryGetValue(key, out _) && _dictionary.TryGetValue(key, out var value)) { return(value); } var ret = AsyncHelper.RunSync(() => _blockchainExecutedDataManager.GetExecutedCacheAsync(key, chainContext.BlockHeight, chainContext.BlockHash)); var blockExecutedData = Deserialize(ret.Value); //if executed is in Store, it will not change when forking if (ret.IsInStore && !_changeHeight.TryGetValue(key, out _)) { _dictionary[key] = blockExecutedData; } return(blockExecutedData); }
public async Task <ByteString> GetBlockExecutedDataAsync(IBlockIndex chainContext, string key) { return((await _blockchainExecutedDataManager.GetExecutedCacheAsync(key, chainContext.BlockHeight, chainContext.BlockHash)).Value); }