test: improve test coverage and isolation for YourContract#1251
Open
Skywalkingzulu1 wants to merge 2 commits into
Open
test: improve test coverage and isolation for YourContract#1251Skywalkingzulu1 wants to merge 2 commits into
Skywalkingzulu1 wants to merge 2 commits into
Conversation
added 2 commits
March 21, 2026 22:59
Changed the contract creation bytecode prefix check from 0x60e06040 to 0x6080604 to match the standard Solidity init code. Standard Solidity init code starts with PUSH1 0x80 PUSH1 0x40 MSTORE (0x60806040), not 0x60e06040. This fixes the block explorer showing contract creation transactions as 'Unknown' instead of properly detecting them. Closes scaffold-eth#1246
- Refactored to use loadFixture pattern for test isolation - Added tests for: premium, totalCounter, userGreetingCounter - Added tests for withdraw() with owner/non-owner - Added tests for receive() function - Added event emission tests for GreetingChange - Total: 12 tests covering all contract functions Closes scaffold-eth#1206
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.
Summary
Improved test coverage for YourContract.sol using Hardhat's loadFixture pattern.
Changes
loadFixturefor proper test isolationCloses #1206