Skip to content

Commit c752104

Browse files
committed
Adjust zk code
1 parent a2ef9a6 commit c752104

File tree

15 files changed

+162
-300
lines changed

15 files changed

+162
-300
lines changed

AElf.All.sln

-14
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Kernel.FeatureDisable.
385385
EndProject
386386
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}"
387387
EndProject
388-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Sdk.CSharp.Spec", "src\AElf.Sdk.CSharp.Spec\AElf.Sdk.CSharp.Spec.csproj", "{45A77C41-142E-4296-A14A-D53067EC8B75}"
389-
EndProject
390-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AElf.Sdk.CSharp.Internal", "src\AElf.Sdk.CSharp.Internal\AElf.Sdk.CSharp.Internal.csproj", "{A77380A7-E425-45A3-BF3F-F865DA4F3F4E}"
391-
EndProject
392388
Global
393389
GlobalSection(SolutionConfigurationPlatforms) = preSolution
394390
Debug|Any CPU = Debug|Any CPU
@@ -1111,14 +1107,6 @@ Global
11111107
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
11121108
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
11131109
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4}.Release|Any CPU.Build.0 = Release|Any CPU
1114-
{45A77C41-142E-4296-A14A-D53067EC8B75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1115-
{45A77C41-142E-4296-A14A-D53067EC8B75}.Debug|Any CPU.Build.0 = Debug|Any CPU
1116-
{45A77C41-142E-4296-A14A-D53067EC8B75}.Release|Any CPU.ActiveCfg = Release|Any CPU
1117-
{45A77C41-142E-4296-A14A-D53067EC8B75}.Release|Any CPU.Build.0 = Release|Any CPU
1118-
{A77380A7-E425-45A3-BF3F-F865DA4F3F4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1119-
{A77380A7-E425-45A3-BF3F-F865DA4F3F4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
1120-
{A77380A7-E425-45A3-BF3F-F865DA4F3F4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
1121-
{A77380A7-E425-45A3-BF3F-F865DA4F3F4E}.Release|Any CPU.Build.0 = Release|Any CPU
11221110
EndGlobalSection
11231111
GlobalSection(SolutionProperties) = preSolution
11241112
HideSolutionNode = FALSE
@@ -1313,7 +1301,5 @@ Global
13131301
{A4ACE6D2-4CF8-4B52-93C9-BB8BEC0C098E} = {90B310B4-C2DB-419E-B5EE-97FA096B62CC}
13141302
{8C0D86A4-D1A7-4B61-AC44-755F5AC75D67} = {4E54480A-D155-43ED-9736-1A5BE7957211}
13151303
{659A7C7A-44C9-424E-B4F6-D1D3656F7AD4} = {90B310B4-C2DB-419E-B5EE-97FA096B62CC}
1316-
{45A77C41-142E-4296-A14A-D53067EC8B75} = {798BAA50-825B-4DD9-83E2-77A9EE6EBE09}
1317-
{A77380A7-E425-45A3-BF3F-F865DA4F3F4E} = {798BAA50-825B-4DD9-83E2-77A9EE6EBE09}
13181304
EndGlobalSection
13191305
EndGlobal

src/AElf.CSharp.CodeOps/Patchers/Module/SafeMath/Patcher.cs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Reflection;
5-
using AElf.Sdk.CSharp;
65
using Mono.Cecil;
76
using Mono.Cecil.Cil;
87
using Mono.Cecil.Rocks;

src/AElf.CSharp.CodeOps/Validators/Whitelist/IWhitelistProvider.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ private void WhitelistCryptographyHelpers(Whitelist whitelist)
176176
{
177177
whitelist
178178
// Selectively allowed types and members
179-
.Namespace("AElf.Cryptography.SecretSharing", Permission.Denied, type => type
180-
.Type(typeof(SecretSharingHelper), Permission.Denied, member => member
181-
.Member(nameof(SecretSharingHelper.DecodeSecret), Permission.Allowed)
182-
))
183179
.Namespace("AElf.Cryptography.Bn254", Permission.Denied, type => type
184180
.Type(typeof(Bn254Helper), Permission.Denied, member => member
185181
.Member(nameof(Bn254Helper.Bn254Pairing), Permission.Allowed)
@@ -229,7 +225,6 @@ private void WhitelistAElfTypes(Whitelist whitelist)
229225
// Selectively allowed types and members
230226
.Namespace("AElf.Cryptography.SecretSharing", Permission.Denied, type => type
231227
.Type(typeof(SecretSharingHelper), Permission.Denied, member => member
232-
.Member(nameof(SecretSharingHelper.DecodeSecret), Permission.Allowed)
233-
));
228+
.Member(nameof(SecretSharingHelper.DecodeSecret), Permission.Allowed)));
234229
}
235230
}

src/AElf.Cryptography/Bn254/Bn254Helper.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
using Bn254.Net;
2+
using NetBn254 = Bn254.Net;
23

34
namespace AElf.Cryptography.Bn254
45
{
56
public static class Bn254Helper
67
{
78
public static (byte[] x, byte[] y) Bn254G1Mul(byte[] x1, byte[] y1, byte[] s)
89
{
9-
var (xUInt256, yUInt256) = global::Bn254.Net.Bn254.Mul(UInt256.FromBigEndianBytes(x1),
10+
var (xUInt256, yUInt256) = NetBn254.Bn254.Mul(UInt256.FromBigEndianBytes(x1),
1011
UInt256.FromBigEndianBytes(y1),
1112
UInt256.FromBigEndianBytes(s));
1213
return (xUInt256.ToBigEndianBytes(), yUInt256.ToBigEndianBytes());
1314
}
1415

1516
public static (byte[] x3, byte[] y3) Bn254G1Add(byte[] x1, byte[] y1, byte[] x2, byte[] y2)
1617
{
17-
var (x3UInt256, y3UInt256) = global::Bn254.Net.Bn254.Add(UInt256.FromBigEndianBytes(x1),
18+
var (x3UInt256, y3UInt256) = NetBn254.Bn254.Add(UInt256.FromBigEndianBytes(x1),
1819
UInt256.FromBigEndianBytes(y1),
1920
UInt256.FromBigEndianBytes(x2), UInt256.FromBigEndianBytes(y2));
2021
return (x3UInt256.ToBigEndianBytes(), y3UInt256.ToBigEndianBytes());
@@ -31,7 +32,7 @@ public static bool Bn254Pairing((byte[], byte[], byte[], byte[], byte[], byte[])
3132
UInt256.FromBigEndianBytes(x3), UInt256.FromBigEndianBytes(y3));
3233
}
3334

34-
return global::Bn254.Net.Bn254.Pairing(elements);
35+
return NetBn254.Bn254.Pairing(elements);
3536
}
3637
}
3738
}

src/AElf.Sdk.CSharp.Internal/AElf.Sdk.CSharp.Internal.csproj

-28
This file was deleted.

src/AElf.Sdk.CSharp.Internal/AssemblyInfo.cs

-3
This file was deleted.

src/AElf.Sdk.CSharp.Internal/InternalBuiltIns.cs

-61
This file was deleted.

src/AElf.Sdk.CSharp.Spec/AElf.Sdk.CSharp.Spec.csproj

-11
This file was deleted.

src/AElf.Sdk.CSharp.Spec/IBuiltIns.cs

-10
This file was deleted.

src/AElf.Sdk.CSharp/AElf.Sdk.CSharp.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<ProjectReference Include="..\AElf.Cryptography\AElf.Cryptography.csproj" />
1414
<ProjectReference Include="..\AElf.CSharp.Core\AElf.CSharp.Core.csproj" />
1515
<ProjectReference Include="..\AElf.Kernel.SmartContract.Shared\AElf.Kernel.SmartContract.Shared.csproj" />
16-
<ProjectReference Include="..\AElf.Sdk.CSharp.Internal\AElf.Sdk.CSharp.Internal.csproj" />
1716
</ItemGroup>
1817

1918
</Project>

src/AElf.Sdk.CSharp/CSharpSmartContractAbstract.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using AElf.Kernel.SmartContract;
22
using AElf.Types;
3-
using AElf.Sdk.CSharp.Spec;
43

54
namespace AElf.Sdk.CSharp;
65

@@ -21,6 +20,6 @@ protected void Assert(bool asserted, string message = "Assertion failed!")
2120
}
2221

2322
internal abstract void InternalInitialize(ISmartContractBridgeContext bridgeContext);
24-
25-
public IBuiltIns BuiltIns { get; internal set; }
23+
24+
// public IBuiltIns BuiltIns { get; internal set; }
2625
}

src/AElf.Sdk.CSharp/CSharpSmartContractContext.cs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using AElf.Kernel.SmartContract;
4-
using AElf.Sdk.CSharp.Internal;
5-
using AElf.Sdk.CSharp.Spec;
64
using AElf.Types;
75
using Google.Protobuf;
86
using Google.Protobuf.WellKnownTypes;

test/AElf.Contracts.Economic.TestBase/ContractsPreparation.cs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
using AElf.Cryptography.ECDSA;
1919
using AElf.CSharp.Core.Extension;
2020
using AElf.Kernel;
21-
using AElf.Sdk.CSharp;
2221
using AElf.Standards.ACS3;
2322
using AElf.Types;
2423
using Google.Protobuf;

test/AElf.Contracts.TestContract.VirtualTransactionEvent/Action.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using AElf.Sdk.CSharp;
2-
using AElf.Types;
1+
using AElf.Types;
32
using Google.Protobuf.WellKnownTypes;
43

54
namespace AElf.Contracts.TestContract.VirtualTransactionEvent;

0 commit comments

Comments
 (0)