Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 8 additions & 22 deletions AElf.All.sln
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Contracts.NFT", "contr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Contracts.TestContract.BigIntValue", "test\AElf.Contracts.TestContract.BigIntValue\AElf.Contracts.TestContract.BigIntValue.csproj", "{F50AF512-69E2-46B5-87C6-E058CE2C2D8A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManager", "src\AElf.Kernel.FeatureManager\AElf.Kernel.FeatureManager.csproj", "{B24BC602-DAFD-4941-A913-8B0725691681}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManagement", "src\AElf.Kernel.FeatureManagement\AElf.Kernel.FeatureManagement.csproj", "{B24BC602-DAFD-4941-A913-8B0725691681}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManager.Tests", "test\AElf.Kernel.FeatureManager.Tests\AElf.Kernel.FeatureManager.Tests.csproj", "{1B44277E-74EB-49B2-B8FD-05C29EE51985}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManagement.Tests", "test\AElf.Kernel.FeatureManagement.Tests\AElf.Kernel.FeatureManagement.Tests.csproj", "{1B44277E-74EB-49B2-B8FD-05C29EE51985}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.CSharp.CodeOps.UnitTests", "test\AElf.CSharp.CodeOps.UnitTests\AElf.CSharp.CodeOps.UnitTests.csproj", "{D1A00CD6-958E-4E9F-8325-354309E3029E}"
EndProject
Expand All @@ -379,11 +379,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Contracts.TestContract
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Contracts.VirtualTransactionEventContract.Tests", "test\AElf.Contracts.VirtualTransactionEventContract.Tests\AElf.Contracts.VirtualTransactionEventContract.Tests.csproj", "{6981684D-450C-412B-9082-0B0A67A679B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureDisable", "src\AElf.Kernel.FeatureDisable\AElf.Kernel.FeatureDisable.csproj", "{A4ACE6D2-4CF8-4B52-93C9-BB8BEC0C098E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureDisable.Tests", "test\AElf.Kernel.FeatureDisable.Tests\AElf.Kernel.FeatureDisable.Tests.csproj", "{8C0D86A4-D1A7-4B61-AC44-755F5AC75D67}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureDisable.Core", "src\AElf.Kernel.FeatureDisable.Core\AElf.Kernel.FeatureDisable.Core.csproj", "{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManagement.Core", "src\AElf.Kernel.FeatureManagement.Core\AElf.Kernel.FeatureManagement.Core.csproj", "{EB2EE653-B268-481B-9C5A-096E939E07E1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1095,18 +1091,10 @@ Global
{6981684D-450C-412B-9082-0B0A67A679B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6981684D-450C-412B-9082-0B0A67A679B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6981684D-450C-412B-9082-0B0A67A679B9}.Release|Any CPU.Build.0 = Release|Any CPU
{A4ACE6D2-4CF8-4B52-93C9-BB8BEC0C098E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4ACE6D2-4CF8-4B52-93C9-BB8BEC0C098E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4ACE6D2-4CF8-4B52-93C9-BB8BEC0C098E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4ACE6D2-4CF8-4B52-93C9-BB8BEC0C098E}.Release|Any CPU.Build.0 = Release|Any CPU
{8C0D86A4-D1A7-4B61-AC44-755F5AC75D67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8C0D86A4-D1A7-4B61-AC44-755F5AC75D67}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C0D86A4-D1A7-4B61-AC44-755F5AC75D67}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C0D86A4-D1A7-4B61-AC44-755F5AC75D67}.Release|Any CPU.Build.0 = Release|Any CPU
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}.Release|Any CPU.Build.0 = Release|Any CPU
{EB2EE653-B268-481B-9C5A-096E939E07E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB2EE653-B268-481B-9C5A-096E939E07E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB2EE653-B268-481B-9C5A-096E939E07E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB2EE653-B268-481B-9C5A-096E939E07E1}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1298,8 +1286,6 @@ Global
{64498F8C-B827-4E1C-B5FB-4B9188C839A8} = {D3950CC9-808F-4ED8-946A-79A992F3F8EF}
{0F10B838-C363-4F55-A5BB-B7F9F80565AB} = {D3950CC9-808F-4ED8-946A-79A992F3F8EF}
{6981684D-450C-412B-9082-0B0A67A679B9} = {D3950CC9-808F-4ED8-946A-79A992F3F8EF}
{A4ACE6D2-4CF8-4B52-93C9-BB8BEC0C098E} = {90B310B4-C2DB-419E-B5EE-97FA096B62CC}
{8C0D86A4-D1A7-4B61-AC44-755F5AC75D67} = {4E54480A-D155-43ED-9736-1A5BE7957211}
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4} = {90B310B4-C2DB-419E-B5EE-97FA096B62CC}
{EB2EE653-B268-481B-9C5A-096E939E07E1} = {90B310B4-C2DB-419E-B5EE-97FA096B62CC}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions AElf.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.Consensus.Sched
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.Consensus.Scheduler.RxNet", "src\AElf.Kernel.Consensus.Scheduler.RxNet\AElf.Kernel.Consensus.Scheduler.RxNet.csproj", "{0396B229-C6D6-4CCC-BCD2-0158A93193D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManager", "src\AElf.Kernel.FeatureManager\AElf.Kernel.FeatureManager.csproj", "{CFDA6378-7EA0-4DAB-BE1F-CE10E0072718}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManagement", "src\AElf.Kernel.FeatureManagement\AElf.Kernel.FeatureManagement.csproj", "{CFDA6378-7EA0-4DAB-BE1F-CE10E0072718}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeeCalculation", "src\AElf.Kernel.FeeCalculation\AElf.Kernel.FeeCalculation.csproj", "{7308E633-AA3E-4CB9-87BE-E4345562C45C}"
EndProject
Expand Down Expand Up @@ -157,7 +157,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.Consensus.AEDPo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.Consensus.Tests", "test\AElf.Kernel.Consensus.Tests\AElf.Kernel.Consensus.Tests.csproj", "{D2F63569-51D7-449D-A632-8DD7B5DA5378}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManager.Tests", "test\AElf.Kernel.FeatureManager.Tests\AElf.Kernel.FeatureManager.Tests.csproj", "{BEDA2B8B-3C65-4C74-8650-1A208A7B1300}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureManagement.Tests", "test\AElf.Kernel.FeatureManagement.Tests\AElf.Kernel.FeatureManagement.Tests.csproj", "{BEDA2B8B-3C65-4C74-8650-1A208A7B1300}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.WebApp.Application.Chain.Tests", "test\AElf.WebApp.Application.Chain.Tests\AElf.WebApp.Application.Chain.Tests.csproj", "{5198D134-A58C-417F-946E-8D6CEB410991}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
using AElf.Kernel;
using AElf.Kernel.FeatureDisable.Core;
using AElf.Kernel.FeatureManagement.Core;
using AElf.Kernel.SmartContract;
using AElf.Kernel.SmartContract.Application;
using AElf.Kernel.SmartContractExecution.Events;
Expand All @@ -13,8 +13,8 @@ public class UnitTestPlainTransactionExecutingService : PlainTransactionExecutin
{
public UnitTestPlainTransactionExecutingService(ISmartContractExecutiveService smartContractExecutiveService,
IEnumerable<IPostExecutionPlugin> postPlugins, IEnumerable<IPreExecutionPlugin> prePlugins,
ITransactionContextFactory transactionContextFactory, IFeatureDisableService featureDisableService) : base(
smartContractExecutiveService, postPlugins, prePlugins, transactionContextFactory, featureDisableService)
ITransactionContextFactory transactionContextFactory, IFeatureManagementService featureManagementService) : base(
smartContractExecutiveService, postPlugins, prePlugins, transactionContextFactory, featureManagementService)
{
}

Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions src/AElf.Kernel.FeatureDisable.Core/IFeatureDisableService.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/AElf.Kernel.FeatureDisable/AElf.Kernel.FeatureDisable.csproj

This file was deleted.

6 changes: 0 additions & 6 deletions src/AElf.Kernel.FeatureDisable/DisableFeatureOptions.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/AElf.Kernel.FeatureDisable/FeatureDisableAElfModule.cs

This file was deleted.

41 changes: 0 additions & 41 deletions src/AElf.Kernel.FeatureDisable/FeatureDisableService.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AElf.Core\AElf.Core.csproj" />
<ProjectReference Include="..\AElf.Core\AElf.Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AElf.Kernel.FeatureManagement;

public class FeatureManagementConstants
{
public const string FeatureConfigurationNamePrefix = "AElfFeature_";
public const string FeatureDisableConfigurationName = "DisableFeatureNameList";
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AElf.Modularity;
using Volo.Abp.Modularity;

namespace AElf.Kernel.FeatureDisable.Core;
namespace AElf.Kernel.FeatureManagement.Core;

public class FeatureDisableCoreAElfModule : AElfModule
public class FeatureManagementCoreAElfModule : AElfModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Volo.Abp.DependencyInjection;

namespace AElf.Kernel.FeatureManagement.Core;

public interface IFeatureManagementService
{
Task<bool> IsFeatureActive(string featureName);
Task<bool> IsFeatureDisabledAsync(params string[] featureNames);
}

public class DefaultFeatureManagementService : IFeatureManagementService, ITransientDependency
{
public Task<bool> IsFeatureActive(string featureName)
{
return Task.FromResult(false);
}

public Task<bool> IsFeatureDisabledAsync(params string[] featureNames)
{
return Task.FromResult(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<PackageId>AElf.Kernel.FeatureManager</PackageId>
<PackageId>AElf.Kernel.FeatureManagement</PackageId>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>Module that contains code to enable or disable new features of AElf.</Description>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\AElf.Kernel.Configuration\AElf.Kernel.Configuration.csproj" />
<ProjectReference Include="..\AElf.Kernel.FeatureManagement.Core\AElf.Kernel.FeatureManagement.Core.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Threading.Tasks;
using AElf.Kernel.Configuration;
using AElf.Kernel.FeatureDisable.Core;
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
using Volo.Abp.DependencyInjection;

namespace AElf.Kernel.FeatureDisable;
namespace AElf.Kernel.FeatureManagement;

public class FeatureDisableConfigurationProcessor : IConfigurationProcessor, ITransientDependency
{
Expand All @@ -15,7 +15,7 @@ public FeatureDisableConfigurationProcessor(IDisabledFeatureListProvider disable
_disabledFeatureListProvider = disabledFeatureListProvider;
}

public string ConfigurationName => FeatureDisableConstants.FeatureDisableConfigurationName;
public string ConfigurationName => FeatureManagementConstants.FeatureDisableConfigurationName;

public async Task ProcessConfigurationAsync(ByteString byteString, BlockIndex blockIndex)
{
Expand Down
14 changes: 14 additions & 0 deletions src/AElf.Kernel.FeatureManagement/FeatureManagementAElfModule.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using AElf.Kernel.Configuration;
using AElf.Kernel.FeatureManagement.Core;
using AElf.Modularity;
using Volo.Abp.Modularity;

namespace AElf.Kernel.FeatureManagement;

[DependsOn(
typeof(FeatureManagementCoreAElfModule),
typeof(ConfigurationAElfModule)
)]
public class FeatureManagementAElfModule : AElfModule
{
}
8 changes: 8 additions & 0 deletions src/AElf.Kernel.FeatureManagement/FeatureManagementOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System.Collections.Generic;

namespace AElf.Kernel.FeatureManagement;

public class FeatureManagementOptions
{
public List<string> DisableFeatureNameList { get; set; }
}
Loading