generates deployment base class

This commit is contained in:
benbierens 2024-08-30 10:27:03 +02:00
parent 017cee43c0
commit 489209d549
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
4 changed files with 26 additions and 2 deletions

View File

@ -6,6 +6,11 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nethereum.Generators" Version="4.21.4" />
<PackageReference Include="Nethereum.Generators.Net" Version="4.21.4" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Framework\Core\Core.csproj" />
<ProjectReference Include="..\GethPlugin\GethPlugin.csproj" />

View File

@ -62,7 +62,10 @@ namespace CodexContractsPlugin
.ToLowerInvariant()
.Replace("\"", "") != MarketplaceDeploymentBase.BYTECODE.ToLowerInvariant())
{
throw new Exception("BYTECODE in CodexContractsPlugin does not match BYTECODE deployed by container. Update Marketplace.cs generated code?");
//throw new Exception("BYTECODE in CodexContractsPlugin does not match BYTECODE deployed by container. Update Marketplace.cs generated code?");
var selfUpdater = new SelfUpdater();
selfUpdater.Update(abiResult, byteCodeResult);
}
return abiResult;

View File

@ -0,0 +1,16 @@
namespace CodexContractsPlugin
{
public class SelfUpdater
{
public void Update(string abi, string bytecode)
{
var deserializer = new Nethereum.Generators.Net.GeneratorModelABIDeserialiser();
var abiModel = deserializer.DeserialiseABI(abi);
var abiCtor = abiModel.Constructor;
//var b = new Nethereum.Generators.Console.ConsoleGenerator(abiModel, "Marketplace", bytecode, "namespace", "cqsNamespace", "fucntionoutputnamespace", Nethereum.Generators.Core.CodeGenLanguage.CSharp);
var c = new Nethereum.Generators.CQS.ContractDeploymentCQSMessageGenerator(abiCtor, "namespace", bytecode, "Marketplace", Nethereum.Generators.Core.CodeGenLanguage.CSharp);
var lines = c.GenerateClass();
var a = 0;
}
}
}

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>ae71e621-bb16-41b2-b6f3-c597d2d21157</UserSecretsId>