-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathUnitTestPlainTransactionExecutingService.cs
More file actions
39 lines (35 loc) · 1.4 KB
/
UnitTestPlainTransactionExecutingService.cs
File metadata and controls
39 lines (35 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using AElf.Kernel;
using AElf.Kernel.FeatureManagement.Core;
using AElf.Kernel.SmartContract;
using AElf.Kernel.SmartContract.Application;
using AElf.Kernel.SmartContractExecution.Events;
namespace AElf.ContractTestKit.AEDPoSExtension;
public class UnitTestPlainTransactionExecutingService : PlainTransactionExecutingService
{
public UnitTestPlainTransactionExecutingService(ISmartContractExecutiveService smartContractExecutiveService,
IEnumerable<IPostExecutionPlugin> postPlugins, IEnumerable<IPreExecutionPlugin> prePlugins,
ITransactionContextFactory transactionContextFactory, IFeatureManagementService featureManagementService) : base(
smartContractExecutiveService, postPlugins, prePlugins, transactionContextFactory, featureManagementService)
{
}
protected override async Task<TransactionTrace> ExecuteOneAsync(SingleTransactionExecutingDto singleTxExecutingDto,
CancellationToken cancellationToken)
{
TransactionTrace trace = null;
try
{
trace = await base.ExecuteOneAsync(singleTxExecutingDto, cancellationToken);
}
finally
{
await LocalEventBus.PublishAsync(new TransactionExecutedEventData
{
TransactionTrace = trace
});
}
return trace;
}
}