From 08de9e38fd3cfd18369a0628b355bfedc5ce8f27 Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Fri, 9 Aug 2024 13:22:22 +0200 Subject: [PATCH] make a few fixes from suggestions --- specs/src/specs/namespace.md | 2 +- test/txsim/blob.go | 5 +++-- test/util/testnode/config.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/specs/src/specs/namespace.md b/specs/src/specs/namespace.md index ee761c327f..916605e96e 100644 --- a/specs/src/specs/namespace.md +++ b/specs/src/specs/namespace.md @@ -95,7 +95,7 @@ Among the potential consequences is the _Woods Attack_, as elaborated in this fo ## Implementation See the [namespace implementation in go-square](https://github.com/celestiaorg/go-square/v2/share/be3c2801e902a0f90f694c062b9c4e6a7e01154e/namespace/namespace.go). -For the most recent version, which may not reflect the current specifications, refer to [the latest namespace code](https://github.com/celestiaorg/go-square/main/share/namespace.go). +For the most recent version, which may not reflect the current specifications, refer to [the latest namespace code](https://github.com/celestiaorg/go-square/blob/main/share/namespace.go). ## Go Definition diff --git a/test/txsim/blob.go b/test/txsim/blob.go index 90b410eb59..3fcef2fa33 100644 --- a/test/txsim/blob.go +++ b/test/txsim/blob.go @@ -97,13 +97,14 @@ func (s *BlobSequence) Next(_ context.Context, _ grpc.ClientConn, rand *rand.Ran } // generate the blobs var blobs []*share.Blob - switch s.shareVersions[rand.Intn(len(s.shareVersions))] { + shareVersion := s.shareVersions[rand.Intn(len(s.shareVersions))] + switch shareVersion { case share.ShareVersionZero: blobs = blobfactory.RandV0BlobsWithNamespace(namespaces, sizes) case share.ShareVersionOne: blobs = blobfactory.RandV1BlobsWithNamespace(namespaces, sizes, s.account) default: - return Operation{}, fmt.Errorf("invalid share version: %d", s.shareVersions[rand.Intn(len(s.shareVersions))]) + return Operation{}, fmt.Errorf("invalid share version: %d", shareVersion) } // derive the pay for blob message msg, err := blob.NewMsgPayForBlobs(s.account.String(), appconsts.LatestVersion, blobs...) diff --git a/test/util/testnode/config.go b/test/util/testnode/config.go index 7054d8e7ec..947df61fa9 100644 --- a/test/util/testnode/config.go +++ b/test/util/testnode/config.go @@ -139,7 +139,7 @@ func DefaultConfig() *Config { func DefaultConsensusParams() *tmproto.ConsensusParams { cparams := types.DefaultConsensusParams() cparams.Block.TimeIotaMs = 1 - cparams.Block.MaxBytes = int64(appconsts.DefaultUpperBoundMaxBytes) + cparams.Block.MaxBytes = appconsts.DefaultMaxBytes cparams.Version.AppVersion = appconsts.LatestVersion return cparams }