public static async Task <string> GetDeploymentReport(this WonkaEthEngineInitialization poEthEngineInit) { StringBuilder report = new StringBuilder("Contracts deployed successfully!\n"); report.Append("Wonka Contract deployed to: (" + poEthEngineInit.RulesEngineContractAddress + ")\n"); report.Append("Registry Contract deployed to: (" + poEthEngineInit.RegistryContractAddress + ")\n"); report.Append("Test Storage Contract deployed to: (" + poEthEngineInit.StorageContractAddress + ")\n\n"); report.Append("RuleTree (" + poEthEngineInit.Engine.RulesEngine.RuleTreeRoot.Description + ") was serialized succesfully to the Wonka Contract!"); var EngineContractHandler = GetWeb3(poEthEngineInit.EthPassword, poEthEngineInit.Web3HttpUrl).Eth.GetContractHandler(poEthEngineInit.RulesEngineContractAddress); var GetAttrNumOutput = await EngineContractHandler .QueryDeserializingToObjectAsync <GetNumberOfAttributesFunction, GetNumberOfAttributesOutputDTO>(new GetNumberOfAttributesFunction(), null) .ConfigureAwait(false); // Placed a wait, just for good measure System.Threading.Thread.Sleep(2000); report.Append("\n\nNumber of Attributes Deployed to Wonka Contract: [" + (uint)GetAttrNumOutput.ReturnValue1 + "].\n\n"); string sCurrValsReport = await poEthEngineInit.GetCurrValuesReport().ConfigureAwait(false); report.Append(sCurrValsReport); return(report.ToString()); }
public static async Task <string> PrettyPrint(this Wonka.Eth.Extensions.RuleTreeReport poReport, WonkaEthEngineInitialization poEthEngineInit) { StringBuilder PrettyPrintReport = new StringBuilder(); int nRSFailedCount = poReport.GetRuleSetSevereFailureCount(); if (nRSFailedCount == 0) { PrettyPrintReport.Append("Engine completed successfully!\n\n"); } else { PrettyPrintReport.Append("Engine failed, with [" + nRSFailedCount + "] 'severe' leaf RuleSets having failed.\n\n"); PrettyPrintReport.Append("Failed 'severe' RuleSets: [" + String.Join(',', poReport.RuleSetFailures) + "]\n\n"); } string sCurrValsReport = await poEthEngineInit.GetCurrValuesReport().ConfigureAwait(false); PrettyPrintReport.Append(sCurrValsReport); return(PrettyPrintReport.ToString()); }