Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: generateShares(2 * 2) #2853

Merged
merged 1 commit into from
Nov 20, 2023
Merged

test: generateShares(2 * 2) #2853

merged 1 commit into from
Nov 20, 2023

Conversation

JulianToledano
Copy link
Contributor

@JulianToledano JulianToledano commented Nov 16, 2023

Overview

Closes #1788

This PR updates generateShares parameter with 2 * 2 instead of 4. As pointed in #1788.

Summary by CodeRabbit

  • Refactor
    • Adjusted the share generation logic to be more explicit about the relationship between the number of shares and the square size.

Copy link
Contributor

coderabbitai bot commented Nov 16, 2023

Walkthrough

The change is a simple refactor within a test file, where the number of shares generated by the generateShares function is now defined by 2 * 2 instead of a direct 4. This doesn't alter the functionality but may improve readability or maintainability by indicating that the number of shares is related to a square of size 2.

Changes

File Change Summary
pkg/da/.../data_availability_header_test.go Updated generateShares function call from generateShares(4) to generateShares(2 * 2).

🐇 In the code's woven warren, a tiny change does spark,
As autumn leaves in twirl and dance, we refactor in the dark.
With numbers twinned like rabbit's ears, we hop through lines so stark,
And celebrate with code that's clear, as leaves embrace the park. 🍂🌟


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

@celestia-bot celestia-bot requested a review from a team November 16, 2023 20:02
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9b5d025 and 7ed9f9f.
Files selected for processing (1)
  • pkg/da/data_availability_header_test.go (1 hunks)
Additional comments: 1
pkg/da/data_availability_header_test.go (1)
  • 44-47: The change from generateShares(4) to generateShares(2 * 2) is functionally equivalent but may improve readability by providing context for the number 4. If 2 * 2 represents a square or a pair-wise generation of shares, this change makes the intention clearer. However, if there is no such context, this change might be unnecessary. It's important to ensure that this change is consistent with the project's coding standards and that the team agrees on using such expressions for clarity.

@JulianToledano JulianToledano changed the title update: generateShares(2 * 2) test: generateShares(2 * 2) Nov 16, 2023
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9b5d025) 19.16% compared to head (7ed9f9f) 19.16%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2853   +/-   ##
=======================================
  Coverage   19.16%   19.16%           
=======================================
  Files         142      142           
  Lines       17291    17291           
=======================================
  Hits         3313     3313           
  Misses      13676    13676           
  Partials      302      302           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rootulp rootulp enabled auto-merge (squash) November 20, 2023 19:03
@rootulp rootulp merged commit 6c5a86b into celestiaorg:main Nov 20, 2023
32 of 34 checks passed
Copy link

gitpoap-bot bot commented Nov 20, 2023

Congrats, your important contribution to this open-source project has earned you a GitPOAP!

GitPOAP: 2023 Celestia Contributor:

GitPOAP: 2023 Celestia Contributor GitPOAP Badge

Head to gitpoap.io & connect your GitHub account to mint!

Learn more about GitPOAPs here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[nit] Can we use 2*2 instead of 4 in the generateShares(4), it is more clear how 4 is calculated and why.
4 participants