From 4f461e4cb327a797d369b311e4ea42a9724aae21 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 28 Mar 2024 13:49:02 +0100 Subject: [PATCH] Checking onchain events to debug missing slotFilled event --- Tests/CodexTests/BasicTests/ExampleTests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Tests/CodexTests/BasicTests/ExampleTests.cs b/Tests/CodexTests/BasicTests/ExampleTests.cs index 60670ea4..d308f8f9 100644 --- a/Tests/CodexTests/BasicTests/ExampleTests.cs +++ b/Tests/CodexTests/BasicTests/ExampleTests.cs @@ -107,6 +107,15 @@ namespace CodexTests.BasicTests var purchaseContract = buyer.Marketplace.RequestStorage(purchase); + Time.Retry(() => + { + var slotFilledEvents = contracts.GetSlotFilledEvents(GetTestRunTimeRange()); + + Log($"SlotFilledEvents: {slotFilledEvents.Length} - NumSlots: {purchase.MinRequiredNumberOfNodes}"); + + if (slotFilledEvents.Length != purchase.MinRequiredNumberOfNodes) throw new Exception("not yet"); + }, Convert.ToInt32(purchase.Duration.TotalSeconds / 2) + 10, TimeSpan.FromSeconds(2), "Checking SlotFilled events"); + purchaseContract.WaitForStorageContractStarted(); AssertBalance(contracts, seller, Is.LessThan(sellerInitialBalance), "Collateral was not placed.");