Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayashsatolia403 committed Oct 29, 2023
1 parent b7b2026 commit 6e2ad85
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/api_tests/chimney_blobber_rewards_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6e2ad85

Please sign in to comment.