Skip to content

Commit

Permalink
chore: use Mebibyte seperately in ant_test package
Browse files Browse the repository at this point in the history
  • Loading branch information
ZwangaMukwevho committed Jan 15, 2025
1 parent 6116a94 commit 1114ebe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions x/blob/ante/blob_share_decorator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

const (
squareSize = 64
mebibyte = 1_048_576 // bytes
Mebibyte = 1_048_576 // bytes
)

func TestBlobShareDecorator(t *testing.T) {
Expand All @@ -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,
},
{
Expand All @@ -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
Expand All @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions x/blob/ante/max_total_blob_size_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1114ebe

Please sign in to comment.