Skip to content

Commit 2ea72da

Browse files
authored
updated to 0.6.7 added new rust enum version (#83)
* updated to 0.6.7 added new rust enum version updated net api to 24-rc5 * updated comments
1 parent e07a54c commit 2ea72da

File tree

8 files changed

+63
-224
lines changed

8 files changed

+63
-224
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Using a terminal of your choice, create a new directory for your project and exe
5656
```sh
5757
dotnet new sln
5858
dotnet new substrate \
59-
--sdk_version 0.6.6 \
59+
--sdk_version 0.6.7 \
6060
--rest_service PROJECTNAME.RestService \
6161
--net_api PROJECTNAME.NetApiExt \
6262
--net_integration PROJECTNAME.Integration \
@@ -127,7 +127,7 @@ You can also watch our short step-by-step tutorial that guides you through the e
127127
- AstarNET
128128
```sh
129129
dotnet new substrate \
130-
--sdk_version 0.6.6 \
130+
--sdk_version 0.6.7 \
131131
--rest_service AstarNET.RestService \
132132
--net_api AstarNET.NetApiExt \
133133
--net_api AstarNET.Integration \

Substrate.AspNetCore/Substrate.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
14-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
14+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
1515
</ItemGroup>
1616

1717
<ItemGroup>

Substrate.ServiceLayer/Substrate.ServiceLayer.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
15-
<PackageReference Include="Substrate.NET.API" Version="0.9.24-rc1" />
14+
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
15+
<PackageReference Include="Substrate.NET.API" Version="0.9.24-rc5" />
1616
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
1717
</ItemGroup>
1818

Tools/Substrate.DotNet.Template/templates/Substrate/.template.config/template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
"symbols": {
1313
"sdk_version": {
1414
"datatype": "string",
15-
"defaultValue": "0.6.6",
15+
"defaultValue": "0.6.7",
1616
"description": "Uses the given Substrate .NET Toolchain version.",
1717
"replaces": "SUBSTRATE_TOOLCHAIN_VERSION",
1818
"type": "parameter"
1919
},
2020
"api_version": {
2121
"datatype": "string",
22-
"defaultValue": "0.9.24-rc1",
22+
"defaultValue": "0.9.24-rc5",
2323
"description": "Uses the given Substrate .NET API version.",
2424
"replaces": "SUBSTRATE_NETAPI_VERSION",
2525
"type": "parameter"

Tools/Substrate.DotNet/Service/Node/Base/BuilderBase.cs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77

88
namespace Substrate.DotNet.Service.Node.Base
99
{
10-
1110
public abstract class BuilderBase
1211
{
1312
public static readonly List<string> Files = new();
1413

1514
public uint Id { get; }
16-
17-
NodeTypeResolver Resolver { get; }
15+
16+
private NodeTypeResolver Resolver { get; }
1817

1918
public bool Success { get; set; }
2019

@@ -153,7 +152,7 @@ private string GetPath(string basePath)
153152

154153
space.Add((FileName is null ? ClassName : FileName) + ".cs");
155154

156-
// Remove the first two parts of the namespace to avoid the files being created in the Substrate/NetApi sub folder.
155+
// Remove the first two parts of the namespace to avoid the files being created in the Substrate/NetApi sub folder.
157156
space = space.TakeLast(space.Count - 2).ToList();
158157

159158
// Add base path at the beginning of the paths list
@@ -176,8 +175,25 @@ protected void AddTargetClassCustomAttributes(CodeTypeDeclaration targetClass, N
176175
targetClass.CustomAttributes.Add(new CodeAttributeDeclaration(new CodeTypeReference("SubstrateNodeType"), new CodeAttributeArgument(
177176
new CodeSnippetExpression($"TypeDefEnum.{typeDef.TypeDef}")
178177
)));
179-
180178
}
181179

180+
public static string HandleReservedKeyword(string name)
181+
{
182+
// List of C# reserved keywords
183+
var reservedKeywords = new HashSet<string>
184+
{
185+
"abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", "class",
186+
"const", "continue", "decimal", "default", "delegate", "do", "double", "else", "enum", "event",
187+
"explicit", "extern", "false", "finally", "fixed", "float", "for", "foreach", "goto", "if",
188+
"implicit", "in", "int", "interface", "internal", "is", "lock", "long", "namespace", "new", "null",
189+
"object", "operator", "out", "override", "params", "private", "protected", "public", "readonly",
190+
"ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", "string", "struct",
191+
"switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", "ushort",
192+
"using", "virtual", "void", "volatile", "while"
193+
};
194+
195+
// If the name is a reserved keyword, prepend with @
196+
return reservedKeywords.Contains(name) ? $"@{name}" : name;
197+
}
182198
}
183199
}

Tools/Substrate.DotNet/Service/Node/EnumBuilder.cs

Lines changed: 31 additions & 208 deletions
Large diffs are not rendered by default.

Tools/Substrate.DotNet/Substrate.DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
</ItemGroup>
4040

4141
<ItemGroup>
42-
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
43-
<PackageReference Include="Substrate.NET.API" Version="0.9.24-rc1" />
42+
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
43+
<PackageReference Include="Substrate.NET.API" Version="0.9.24-rc5" />
4444
<PackageReference Include="System.CodeDom" Version="8.0.0" />
4545
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
4646
</ItemGroup>

Version.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<!-- Configuration -->
55
<VersionMajor>0</VersionMajor>
66
<VersionMinor>6</VersionMinor>
7-
<VersionPatch>6</VersionPatch>
7+
<VersionPatch>7</VersionPatch>
88
<AssemblyVersion>$(VersionMajor).$(VersionMinor).$(VersionPatch)</AssemblyVersion>
99

10-
<SubstratePackageVersion>0.6.6</SubstratePackageVersion>
10+
<SubstratePackageVersion>0.6.7</SubstratePackageVersion>
1111

1212
<!-- Variables -->
1313
<SubstrateVersion>$(AssemblyVersion)</SubstrateVersion>

0 commit comments

Comments
 (0)