Skip to content

Commit 218b91d

Browse files
authored
chore: Rename csharp project from PeerDASKZG (#103)
* Initial changes from PeerDASKZG -> EthKZG * update compile script
1 parent c6b860c commit 218b91d

File tree

10 files changed

+22
-22
lines changed

10 files changed

+22
-22
lines changed

bindings/csharp/csharp_code/PeerDASKZG.bindings/PeerDASKZG.csproj bindings/csharp/csharp_code/EthKZG.bindings/EthKZG.csproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
<TargetFramework>net8.0</TargetFramework>
77
<ImplicitUsings>enable</ImplicitUsings>
88
<Nullable>enable</Nullable>
9-
<RootNamespace>PeerDASKZG</RootNamespace>
9+
<RootNamespace>EthKZG</RootNamespace>
1010
</PropertyGroup>
1111

1212
<PropertyGroup>
1313
<Authors>Kevaundray Wedderburn</Authors>
1414
<Copyright>Kevaundray Wedderburn</Copyright>
15-
<Description>C# Bindings for PeerDASKZG</Description>
15+
<Description>C# Bindings for KZG functionality that Ethereum needs for Data Availability Sampling</Description>
1616
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1717
<IncludeSymbols>true</IncludeSymbols>
18-
<PackageId>PeerDASKZG.Bindings</PackageId>
18+
<PackageId>EthKZG.Bindings</PackageId>
1919
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
2020
<PackageReadmeFile>README.md</PackageReadmeFile>
21-
<PackageTags>peerdas-kzg</PackageTags>
21+
<PackageTags>eth-kzg</PackageTags>
2222
<RepositoryType>git</RepositoryType>
2323
<RepositoryUrl>https://github.com/crate-crypto/rust-eth-kzg</RepositoryUrl>
2424
<SymbolPackageFormat>snupkg</SymbolPackageFormat>

bindings/csharp/csharp_code/PeerDASKZG.bindings/peerdaskzg.cs bindings/csharp/csharp_code/EthKZG.bindings/ethkzg.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
using PeerDAS.Native;
2-
using static PeerDAS.Native.NativeMethods;
1+
using EthKZG.Native;
2+
using static EthKZG.Native.NativeMethods;
33
using System.Runtime.InteropServices;
44

5-
namespace PeerDASKZG;
5+
namespace EthKZG;
66

7-
public sealed unsafe class PeerDASKZG : IDisposable
7+
public sealed unsafe class EthKZG : IDisposable
88
{
99
// These constants are copied from the c-kzg csharp bindings file.
1010
// TODO: This is not ideal, since we want the Rust code to be the single source of truth
@@ -28,7 +28,7 @@ public sealed unsafe class PeerDASKZG : IDisposable
2828

2929
private DASContext* _context;
3030

31-
public PeerDASKZG()
31+
public EthKZG()
3232
{
3333
_context = das_context_new();
3434
}
@@ -274,7 +274,7 @@ private static void ThrowOnError(CResult result)
274274
case CResultStatus.Ok:
275275
return;
276276
default:
277-
throw new ApplicationException("PeerDASKZG returned an unexpected result variant");
277+
throw new ApplicationException("EthKZG returned an unexpected result variant");
278278
}
279279
}
280280

bindings/csharp/csharp_code/PeerDASKZG.bindings/native_methods.g.cs bindings/csharp/csharp_code/EthKZG.bindings/native_methods.g.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
using System.Runtime.InteropServices;
1010

1111

12-
namespace PeerDAS.Native
12+
namespace EthKZG.Native
1313
{
1414
internal static unsafe partial class NativeMethods
1515
{

bindings/csharp/csharp_code/PeerDASKZG.bindings/native_methods.loading.cs bindings/csharp/csharp_code/EthKZG.bindings/native_methods.loading.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Runtime.InteropServices;
33
using System.Runtime.Loader;
44

5-
namespace PeerDAS.Native;
5+
namespace EthKZG.Native;
66

77
internal static unsafe partial class NativeMethods
88
{

bindings/csharp/csharp_code/PeerDASKZG.sln bindings/csharp/csharp_code/EthKZG.sln

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.0.31903.59
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeerDASKZG", "PeerDASKZG.bindings\PeerDASKZG.csproj", "{A1534E2C-AB77-4075-865B-45E0ECEAA409}"
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EthKZG", "EthKZG.bindings\EthKZG.csproj", "{A1534E2C-AB77-4075-865B-45E0ECEAA409}"
77
EndProject
8-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PeerDASKZG.test", "PeerDASKZG.test\PeerDASKZG.test.csproj", "{15486123-F250-4BEF-96B8-94C07E0F5B14}"
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EthKZG.test", "EthKZG.test\EthKZG.test.csproj", "{15486123-F250-4BEF-96B8-94C07E0F5B14}"
99
EndProject
1010
Global
1111
GlobalSection(SolutionConfigurationPlatforms) = preSolution

bindings/csharp/csharp_code/PeerDASKZG.test/PeerDASKZG.test.csproj bindings/csharp/csharp_code/EthKZG.test/EthKZG.test.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</ItemGroup>
2525

2626
<ItemGroup>
27-
<ProjectReference Include="..\PeerDASKZG.bindings\PeerDASKZG.csproj" />
27+
<ProjectReference Include="..\EthKZG.bindings\EthKZG.csproj" />
2828
</ItemGroup>
2929

3030
</Project>

bindings/csharp/csharp_code/PeerDASKZG.test/RefTests.cs bindings/csharp/csharp_code/EthKZG.test/RefTests.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
using YamlDotNet.Serialization.NamingConventions;
55

66

7-
// Testing code below taken from CKZG and modified to work with PeerDASKZG
8-
namespace PeerDASKZG.test;
7+
// Testing code below taken from CKZG and modified to work with EthKZG
8+
namespace EthKZG.test;
99

1010
[TestFixture]
1111
public class ReferenceTests
@@ -14,7 +14,7 @@ public class ReferenceTests
1414
public void Setup()
1515
{
1616

17-
_context = new PeerDASKZG();
17+
_context = new EthKZG();
1818
_deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build();
1919
// TODO(Note): On some systems, this is needed as the normal deserializer has trouble deserializing
2020
// `cell_id` to `CellId` ie the underscore is not being parsed correctly.
@@ -28,7 +28,7 @@ public void Teardown()
2828
}
2929

3030

31-
private PeerDASKZG _context;
31+
private EthKZG _context;
3232
private const string TestDir = "../../../../../../../consensus_test_vectors";
3333
private readonly string _blobToKzgCommitmentTests = Path.Join(TestDir, "blob_to_kzg_commitment");
3434
private readonly string _computeCellsAndKzgProofsTests = Path.Join(TestDir, "compute_cells_and_kzg_proofs");

bindings/csharp/rust_code/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use toml::Value;
44

55
/// The path where the generated bindings file will be written, relative to the bindings folder.
66
const PATH_FOR_CSHARP_BINDINGS_FILE: &str =
7-
"csharp/csharp_code/PeerDASKZG.bindings/native_methods.g.cs";
7+
"csharp/csharp_code/EthKZG.bindings/native_methods.g.cs";
88

99
fn main() {
1010
let package_name_of_c_crate = get_package_name_of_c_crate();
@@ -20,7 +20,7 @@ fn main() {
2020

2121
csbindgen::Builder::default()
2222
.input_extern_file(path_to_c_crates_lib_file)
23-
.csharp_namespace("PeerDAS.Native")
23+
.csharp_namespace("EthKZG.Native")
2424
.csharp_dll_name(package_name_of_c_crate)
2525
.csharp_class_name("NativeMethods")
2626
.csharp_use_nint_types(false)

scripts/compile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ compile_java() {
2323
# Function to compile for C#
2424
compile_csharp() {
2525
echo "Compiling for C#..."
26-
OUT_DIR="$PROJECT_ROOT/bindings/csharp/csharp_code/PeerDASKZG.bindings/runtimes"
26+
OUT_DIR="$PROJECT_ROOT/bindings/csharp/csharp_code/EthKZG.bindings/runtimes"
2727
LIB_TYPE="dynamic"
2828
LIB_NAME="c_eth_kzg"
2929
$PROJECT_ROOT/scripts/compile_to_native.sh $OS $ARCH $LIB_NAME $LIB_TYPE $OUT_DIR

0 commit comments

Comments
 (0)