Check for marketplace contract up-to-date

This commit is contained in:
benbierens 2024-04-11 07:46:00 +02:00
parent 0224f17733
commit 4a0885cf2d
No known key found for this signature in database
GPG Key ID: 877D2C2E09A22F3A
3 changed files with 86 additions and 13 deletions

View File

@ -1,4 +1,5 @@
using KubernetesWorkflow;
using CodexContractsPlugin.Marketplace;
using KubernetesWorkflow;
using KubernetesWorkflow.Types;
using Logging;
using Newtonsoft.Json;
@ -53,7 +54,18 @@ namespace CodexContractsPlugin
var artifact = JObject.Parse(json);
var abi = artifact["abi"];
return abi!.ToString(Formatting.None);
var byteCode = artifact["bytecode"];
var abiResult = abi!.ToString(Formatting.None);
var byteCodeResult = byteCode!.ToString(Formatting.None);
if (byteCodeResult
.ToLowerInvariant()
.Replace("\"", "") != MarketplaceDeploymentBase.BYTECODE.ToLowerInvariant())
{
throw new Exception("BYTECODE in CodexContractsPlugin does not match BYTECODE deployed by container. Update Marketplace.cs generated code?");
}
return abiResult;
}
private static string Retry(Func<string> fetch)

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,8 @@ namespace TestNetRewarder
public ChainState(HistoricState historicState, ICodexContracts contracts, BlockInterval blockRange)
{
this.historicState = historicState;
NewRequests = contracts.GetStorageRequests(blockRange);
historicState.CleanUpOldRequests();
historicState.ProcessNewRequests(NewRequests);
@ -23,7 +25,6 @@ namespace TestNetRewarder
RequestCancelledEvents = contracts.GetRequestCancelledEvents(blockRange);
SlotFilledEvents = contracts.GetSlotFilledEvents(blockRange);
SlotFreedEvents = contracts.GetSlotFreedEvents(blockRange);
this.historicState = historicState;
}
public Request[] NewRequests { get; }