Ejemplo n.º 1
0
        public void TransactionInputForBlockMiningDataProvider_AddAndGet_Tests()
        {
            var blockHash = HashHelper.ComputeFrom("Random");
            var crossChainTransactionInput = new CrossChainTransactionInput
            {
                PreviousBlockHeight = 10
            };

            _transactionInputForBlockMiningDataProvider.AddTransactionInputForBlockMining(blockHash,
                                                                                          crossChainTransactionInput);

            {
                var actual = _transactionInputForBlockMiningDataProvider.GetTransactionInputForBlockMining(blockHash);
                actual.ShouldBe(crossChainTransactionInput);
            }

            {
                _transactionInputForBlockMiningDataProvider.ClearExpiredTransactionInput(11);
                var actual = _transactionInputForBlockMiningDataProvider.GetTransactionInputForBlockMining(blockHash);
                actual.ShouldBeNull();
            }
        }
 public void UpdateCrossChainDataWithLib(Hash blockHash, long blockHeight)
 {
     // clear useless cache
     _transactionInputForBlockMiningDataProvider.ClearExpiredTransactionInput(blockHeight);
 }