Repository navigation
Move CES parser to separate project (separate Nuget package). #122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ obj/ | |
| riderModule.iml | ||
| /_ReSharper.Caches/ | ||
| /.vs | ||
| *.DotSettings.user | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Casper.Network.SDK.CES.Test/Casper.Network.SDK.CES.Test.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <LangVersion>9.0</LangVersion> | ||
| <IsPackable>false</IsPackable> | ||
| <RootNamespace>Casper.Network.SDK.CES.Test</RootNamespace> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" /> | ||
| <PackageReference Include="NUnit" Version="3.14.0" /> | ||
| <PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> | ||
| <PackageReference Include="coverlet.collector" Version="3.2.0" /> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <CustomTargetFramework Condition="'$(TEST_FRAMEWORK)' != ''">$(TEST_FRAMEWORK)</CustomTargetFramework> | ||
| <CustomTargetFramework Condition="'$(CustomTargetFramework)' == ''">net8.0</CustomTargetFramework> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup Condition="'$(CustomTargetFramework)' == 'net8.0'"> | ||
| <ProjectReference Include="..\Casper.Network.SDK.CES\Casper.Network.SDK.CES.csproj" Properties="TargetFramework=net8.0" /> | ||
| </ItemGroup> | ||
| <ItemGroup Condition="'$(CustomTargetFramework)' == 'netstandard2.0'"> | ||
| <ProjectReference Include="..\Casper.Network.SDK.CES\Casper.Network.SDK.CES.csproj" Properties="TargetFramework=netstandard2.0" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks> | ||
| <LangVersion>9.0</LangVersion> | ||
| <NoWarn>CS1591</NoWarn> | ||
| <AssemblyVersion>3.3.0.0</AssemblyVersion> | ||
| <FileVersion>3.3.0</FileVersion> | ||
| <PackageVersion>3.3.0</PackageVersion> | ||
| <PackageId>Casper.Network.SDK.CES</PackageId> | ||
| <Title>Casper.Network.SDK.CES</Title> | ||
| <Authors>make-software</Authors> | ||
| <PackageProjectUrl>https://github.com/make-software/casper-net-sdk</PackageProjectUrl> | ||
| <RepositoryUrl>https://github.com/make-software/casper-net-sdk</RepositoryUrl> | ||
| <RepositoryType>git</RepositoryType> | ||
| <PackageTags>Casper NetCasperSDK CES</PackageTags> | ||
| <PackageReadmeFile>README_nuget.md</PackageReadmeFile> | ||
| <PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
| <Description>Casper Event Standard (CES) schema and event parsing for the Casper .NET SDK.</Description> | ||
| <RootNamespace>Casper.Network.SDK.CES</RootNamespace> | ||
| <GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Casper.Network.SDK\Casper.Network.SDK.csproj" /> | ||
| <Compile Include="..\Casper.Network.SDK\Compat\IsExternalInit.cs" Link="Compat\IsExternalInit.cs" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="README_nuget.md" Pack="true" PackagePath="\" /> | ||
| <None Include="..\LICENSE" Pack="true" PackagePath="\" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Casper Event Standard (CES) for .NET | ||
|
|
||
| `Casper.Network.SDK.CES` parses typed events emitted by Casper smart contracts that follow the Casper Event Standard. It supports .NET 8 and .NET Standard 2.0 and depends on `Casper.Network.SDK`. | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| dotnet add package Casper.Network.SDK.CES | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```csharp | ||
| using System; | ||
| using Casper.Network.SDK; | ||
| using Casper.Network.SDK.CES; | ||
|
|
||
| var client = new NetCasperClient("http://127.0.0.1:11101/rpc"); | ||
| var schema = await CESContractSchema.LoadAsync(client, contractPackageHash); | ||
|
|
||
| var events = CESParser.GetEvents(executionResult.Effect, new[] { schema }); | ||
| foreach (var evt in events) | ||
| Console.WriteLine(evt.Name); | ||
| ``` | ||
|
|
||
| `contractPackageHash` is the hash of the contract package to watch, and `executionResult` is the execution result of a processed transaction. | ||
|
|
||
| See the [CES documentation](https://make-software.github.io/casper-net-sdk/Articles/CasperEventStandard.html) and the [SSE example](https://github.com/make-software/casper-net-sdk/tree/master/Docs/Examples/CESParser) for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note points NuGet users to
Casper.Network.SDK.CES, but the "Add a reference to the source code" section just below still names onlyCasper.Network.SDK.csproj. CES no longer compiles into that project. So anyone who references the SDK from source and then follows the CES guide gets unresolvedCasper.Network.SDK.CES/CESParsersymbols.Could that section also mention the CES project, e.g.
dotnet add reference ../casper-net-sdk/Casper.Network.SDK.CES/Casper.Network.SDK.CES.csproj?Basis
CESParsermoved fromCasper.Network.SDK/CES/toCasper.Network.SDK.CES/CESParser.cs, andCasper.Network.SDK.csprojhas no reference to the new project.CasperEventStandard.md,README.md, the CESREADME_nuget.md) only give thedotnet add packageroute.