csharp/AElfProject/AElf/test/AElf.Kernel.SmartContract.Parallel.Tests/MockBlockchainService.cs

MockBlockchainService.cs
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AElf.Kernel.Blockchain.Application;
using AElf.Kernel.Blockchain.Domain;
using AElf.Types;

namespace AElf.Kernel.SmartContract.Parallel.Tests
{
    public clast MockBlockchainService : IBlockchainService
    {
        private List _data = new List();
        
        public int GetChainId()
        {
            throw new System.NotImplementedException();
        }

        public async Task CreateChainAsync(Block block, IEnumerable transactions)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public Task AddTransactionsAsync(IEnumerable transactions)
        {
            _data.AddRange(transactions);

            return Task.CompletedTask;
        }

        public Task GetTransactionsAsync(IEnumerable transactionHashes)
        {
            return Task.FromResult(_data.Where(d => transactionHashes.Contains(d.GetHash())).ToList());
        }

        public Task HasTransactionAsync(Hash transactionId)
        {
            throw new System.NotImplementedException();
        }

        public async Task AddBlockAsync(Block block)
        {
            await Task.FromException(new System.NotImplementedException());
        }

        public async Task HasBlockAsync(Hash blockId)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task GetBlockByHashAsync(Hash blockId)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task GetBlockHeaderByHashAsync(Hash blockId)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task GetChainAsync()
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task GetReversedBlockIndexes(Hash lastBlockHash, int count)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task GetBlockHashesAsync(Chain chain, Hash firstHash, int count, Hash chainBranchBlockHash = null)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task GetBlockHashByHeightAsync(Chain chain, long height, Hash chainBranchBlockHash)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task AttachBlockToChainAsync(Chain chain, Block block)
        {
            return await Task.FromException(new System.NotImplementedException());
        }

        public async Task SetBestChainAsync(Chain chain, long bestChainHeight, Hash bestChainHash)
        {
            await Task.FromException(new System.NotImplementedException());
        }

        public async Task SetIrreversibleBlockAsync(Chain chain, long irreversibleBlockHeight, Hash irreversibleBlockHash)
        {
            await Task.FromException(new System.NotImplementedException());
        }

        public Task GetDiscardedBranchAsync(Chain chain)
        {
            throw new System.NotImplementedException();
        }

        public Task CleanChainBranchAsync(DiscardedBranch discardedBranch)
        {
            throw new System.NotImplementedException();
        }

        public Task ResetChainToLibAsync(Chain chain)
        {
            throw new System.NotImplementedException();
        }

        public Task RemoveLongestBranchAsync(Chain chain)
        {
            throw new System.NotImplementedException();
        }
    }
}