From 489209d549867ff466a3e52cb431c56989500f76 Mon Sep 17 00:00:00 2001 From: benbierens Date: Fri, 30 Aug 2024 10:27:03 +0200 Subject: [PATCH] generates deployment base class --- .../CodexContractsPlugin.csproj | 5 +++++ .../ContractsContainerInfoExtractor.cs | 5 ++++- .../CodexContractsPlugin/SelfUpdater.cs | 16 ++++++++++++++++ Tools/MarketInsights/MarketInsights.csproj | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 ProjectPlugins/CodexContractsPlugin/SelfUpdater.cs diff --git a/ProjectPlugins/CodexContractsPlugin/CodexContractsPlugin.csproj b/ProjectPlugins/CodexContractsPlugin/CodexContractsPlugin.csproj index 648b846..fcb65c2 100644 --- a/ProjectPlugins/CodexContractsPlugin/CodexContractsPlugin.csproj +++ b/ProjectPlugins/CodexContractsPlugin/CodexContractsPlugin.csproj @@ -6,6 +6,11 @@ enable + + + + + diff --git a/ProjectPlugins/CodexContractsPlugin/ContractsContainerInfoExtractor.cs b/ProjectPlugins/CodexContractsPlugin/ContractsContainerInfoExtractor.cs index 752192c..9b37c98 100644 --- a/ProjectPlugins/CodexContractsPlugin/ContractsContainerInfoExtractor.cs +++ b/ProjectPlugins/CodexContractsPlugin/ContractsContainerInfoExtractor.cs @@ -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; diff --git a/ProjectPlugins/CodexContractsPlugin/SelfUpdater.cs b/ProjectPlugins/CodexContractsPlugin/SelfUpdater.cs new file mode 100644 index 0000000..093c37e --- /dev/null +++ b/ProjectPlugins/CodexContractsPlugin/SelfUpdater.cs @@ -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; + } + } +} diff --git a/Tools/MarketInsights/MarketInsights.csproj b/Tools/MarketInsights/MarketInsights.csproj index 42b33c4..32ef782 100644 --- a/Tools/MarketInsights/MarketInsights.csproj +++ b/Tools/MarketInsights/MarketInsights.csproj @@ -1,7 +1,7 @@  - net8.0 + net7.0 enable enable ae71e621-bb16-41b2-b6f3-c597d2d21157