From 6e2ad8505ec11fdb1f6bb2fa65322031b331c6a2 Mon Sep 17 00:00:00 2001 From: Jayash Satolia Date: Sun, 29 Oct 2023 18:22:54 +0530 Subject: [PATCH] Fix --- tests/api_tests/chimney_blobber_rewards_test.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/api_tests/chimney_blobber_rewards_test.go b/tests/api_tests/chimney_blobber_rewards_test.go index ff5932dd1e..f7fec7aa05 100644 --- a/tests/api_tests/chimney_blobber_rewards_test.go +++ b/tests/api_tests/chimney_blobber_rewards_test.go @@ -105,11 +105,19 @@ func Test1ChimneyBlobberRewards(testSetup *testing.T) { blobberRequirements.DataShards = int64((lenAvailableBlobbers-1)/2 + 1) blobberRequirements.ParityShards = int64(lenAvailableBlobbers) - blobberRequirements.DataShards + beforeWallet := chimneyClient.GetWalletBalance(t, sdkWallet, client.HttpOkStatus) + allocationBlobbers = chimneyClient.GetAllocationBlobbers(t, sdkWallet, &blobberRequirements, client.HttpOkStatus) allocationID := chimneyClient.CreateAllocationWithLockValue(t, sdkWallet, allocationBlobbers, 5000, client.TxSuccessfulStatus) time.Sleep(1 * time.Minute) + beforeAlloc := chimneyClient.GetAllocation(t, allocationID, client.HttpOkStatus) + + afterWallet := chimneyClient.GetWalletBalance(t, sdkWallet, client.HttpOkStatus) + require.InEpsilon(t, beforeWallet.Balance-afterWallet.Balance, beforeAlloc.WritePool, extraErrorMargin, "Write pool is not equal to wallet balance difference") + beforeWallet = afterWallet + uploadOp := chimneySdkClient.AddUploadOperationForBigFile(t, allocationID, fileSize/GB) // 10gb chimneySdkClient.MultiOperation(t, allocationID, []sdk.OperationRequest{uploadOp}) @@ -261,8 +269,11 @@ func Test1ChimneyBlobberRewards(testSetup *testing.T) { // Reduce expected write pool expectedWritePoolBalance -= actualMinLockDemandReward + afterWallet = chimneyClient.GetWalletBalance(t, sdkWallet, client.HttpOkStatus) + require.InEpsilon(t, afterWallet.Balance-beforeWallet.Balance, expectedWritePoolBalance, extraErrorMargin, "Expected write pool balance is not equal to actual") + // Compare Write Pool Balance - require.InEpsilon(t, expectedWritePoolBalance, actualWritePoolBalance, standardErrorMargin, "Expected write pool balance is not equal to actual") + require.InEpsilon(t, 0, actualWritePoolBalance, standardErrorMargin, "Expected write pool balance is not equal to actual") }) t.RunWithTimeout("Block Rewards", 1*time.Hour, func(t *test.SystemTest) {