From 1114ebeff9bdb62efb562f8142d4b051250dee9e Mon Sep 17 00:00:00 2001 From: zwanga Date: Wed, 15 Jan 2025 23:37:33 +0200 Subject: [PATCH] chore: use Mebibyte seperately in ant_test package --- x/blob/ante/blob_share_decorator_test.go | 10 +++++----- x/blob/ante/max_total_blob_size_ante_test.go | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/x/blob/ante/blob_share_decorator_test.go b/x/blob/ante/blob_share_decorator_test.go index 95b0bba2f1..fb6801fa12 100644 --- a/x/blob/ante/blob_share_decorator_test.go +++ b/x/blob/ante/blob_share_decorator_test.go @@ -25,7 +25,7 @@ import ( const ( squareSize = 64 - mebibyte = 1_048_576 // bytes + Mebibyte = 1_048_576 // bytes ) func TestBlobShareDecorator(t *testing.T) { @@ -42,7 +42,7 @@ func TestBlobShareDecorator(t *testing.T) { { name: "want no error if appVersion v1 and 8 MiB blob", blobsPerPFB: 1, - blobSize: 8 * mebibyte, + blobSize: 8 * Mebibyte, appVersion: v1.Version, }, { @@ -54,13 +54,13 @@ func TestBlobShareDecorator(t *testing.T) { { name: "PFB with 1 blob that is 1 MiB", blobsPerPFB: 1, - blobSize: 1 * mebibyte, + blobSize: 1 * Mebibyte, appVersion: v2.Version, }, { name: "PFB with 1 blob that is 2 MiB", blobsPerPFB: 1, - blobSize: 2 * mebibyte, + blobSize: 2 * Mebibyte, appVersion: v2.Version, // This test case should return an error because a square size of 64 // has exactly 2 MiB of total capacity so the total blob capacity @@ -76,7 +76,7 @@ func TestBlobShareDecorator(t *testing.T) { { name: "PFB with 2 blobs that are 1 MiB each", blobsPerPFB: 2, - blobSize: 1 * mebibyte, + blobSize: 1 * Mebibyte, appVersion: v2.Version, // This test case should return an error for the same reason a // single blob that is 2 MiB returns an error. diff --git a/x/blob/ante/max_total_blob_size_ante_test.go b/x/blob/ante/max_total_blob_size_ante_test.go index 18089e7faa..fd20fcd66e 100644 --- a/x/blob/ante/max_total_blob_size_ante_test.go +++ b/x/blob/ante/max_total_blob_size_ante_test.go @@ -7,7 +7,6 @@ import ( "github.com/celestiaorg/celestia-app/v3/app/encoding" v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1" v2 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v2" - "github.com/celestiaorg/celestia-app/v3/test/util/testnode" ante "github.com/celestiaorg/celestia-app/v3/x/blob/ante" blob "github.com/celestiaorg/celestia-app/v3/x/blob/types" "github.com/celestiaorg/go-square/v2/share" @@ -44,14 +43,14 @@ func TestMaxTotalBlobSizeDecorator(t *testing.T) { { name: "PFB with 1 blob that is 1 MiB", pfb: &blob.MsgPayForBlobs{ - BlobSizes: []uint32{testnode.Mebibyte}, + BlobSizes: []uint32{Mebibyte}, }, appVersion: v1.Version, }, { name: "PFB with 1 blob that is 2 MiB", pfb: &blob.MsgPayForBlobs{ - BlobSizes: []uint32{2 * testnode.Mebibyte}, + BlobSizes: []uint32{2 * Mebibyte}, }, appVersion: v1.Version, // This test case should return an error because a square size of 64 @@ -69,7 +68,7 @@ func TestMaxTotalBlobSizeDecorator(t *testing.T) { { name: "PFB with 2 blobs that are 1 MiB each", pfb: &blob.MsgPayForBlobs{ - BlobSizes: []uint32{testnode.Mebibyte, testnode.Mebibyte}, + BlobSizes: []uint32{Mebibyte, Mebibyte}, }, appVersion: v1.Version, // This test case should return an error for the same reason a