feat: add calculator component testing and contributor guidelines#783
Open
NoahMaizels wants to merge 3 commits intomasterfrom
Open
feat: add calculator component testing and contributor guidelines#783NoahMaizels wants to merge 3 commits intomasterfrom
NoahMaizels wants to merge 3 commits intomasterfrom
Conversation
Collaborator
NoahMaizels
commented
Mar 19, 2026
- Add AmountAndDepthCalc.test.js with 37 comprehensive unit tests
- Cover time conversion, depth calculation, cost calculation, and data consistency
- Update README.md with testing instructions for contributors
- Update CODING.md with calculator testing requirements
- Tests validate all 25 depths (17-41), 5 erasure levels, and encryption modes
- Add AmountAndDepthCalc.test.js with 37 comprehensive unit tests - Cover time conversion, depth calculation, cost calculation, and data consistency - Update README.md with testing instructions for contributors - Update CODING.md with calculator testing requirements - Tests validate all 25 depths (17-41), 5 erasure levels, and encryption modes Contributors must run tests before submitting PRs to this component.
✅ Deploy Preview for test-twitter-preview-testing-3 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
- 23 test cases covering reverse calculator logic - Validates depth/amount recovery from volume/duration inputs - Tests input validation, storage duration calculation, volume formatting - Tests cost calculation with exponential depth and linear amount scaling - Tests encryption and erasure coding effects on effective volumes - Tests edge cases (depth 17 minimum, depth 41 maximum) - All tests passing with properly calibrated tolerances for floating-point precision Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Collected real estimates from swarm-cli (depth 17-23 with amount 1103536010) - Updated AmountAndDepthCalc.js component with current pricing - Updated test files with current data and extrapolated values for higher depths - Scaled encryption/erasure levels based on historical overhead patterns - Unencrypted 'none' level uses current swarm-cli estimates - Encrypted and other erasure levels scaled to preserve cost relationships - All 37 AmountAndDepthCalc tests passing - All 23 VolumeAndDurationCalc tests passing This ensures tests use current network pricing rather than stale hardcoded values. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.