refactor: prefix private members with underscore#861
Merged
Conversation
04eb7ce to
d2b5232
Compare
Aligns with the convention already used in StdAssertions, StdInvariant, and StdConfig, and addresses the second goal of #653. Renamed private state variables and helper functions: - StdChains: _stdChainsInitialized, _chains, _defaultRpcUrls, _idToAlias, _fallbackToDefaultRpcUrls, _initializeStdChains, _getChainWithUpdatedRpcUrl, _setChainWithDefaultRpcUrl - StdCheats: _gasMeteringOff, _stdstore, _console2_log_StdCheats - StdStorage: _read, _bytesToBytes32, _flatten - StdStyle: _styleConcat - StdUtils: _addressFromLast20Bytes, _console2_log_StdUtils Renamed private constants: - StdAssertions: _FAILED_SLOT - StdCheats: _UINT256_MAX, _CONSOLE2_ADDRESS - StdConfig: _NUM_TYPES - StdMath: _INT256_MIN - StdUtils: _UINT256_MAX, _INT256_MIN_ABS, _SECP256K1_ORDER, _CONSOLE2_ADDRESS Excluded: 'vm' private constant (universal alias across forge-std). Amp-Thread-ID: https://ampcode.com/threads/T-019e207d-61e2-7644-94cb-9a8861834bb5 Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-019e207d-61e2-7644-94cb-9a8861834bb5 Co-authored-by: Amp <[email protected]> Amp-Thread-ID: https://ampcode.com/threads/T-019e207d-61e2-7644-94cb-9a8861834bb5 Co-authored-by: Amp <[email protected]>
d2b5232 to
a8353d2
Compare
24 tasks
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.
Towards #653
Addresses the second goal of #653 ("Mark private variables and functions with underscore prefix") by aligning the remaining files with the convention already used in
StdAssertions.sol,StdInvariant.sol, andStdConfig.sol.No public/internal/external function signatures or behavior changed — all renames are limited to
privatemembers.Renamed private state variables / helper functions
_stdChainsInitialized,_chains,_defaultRpcUrls,_idToAlias,_fallbackToDefaultRpcUrls,_initializeStdChains,_getChainWithUpdatedRpcUrl,_setChainWithDefaultRpcUrl_gasMeteringOff,_stdstore,_console2_log_StdCheats_read,_bytesToBytes32,_flatten_styleConcat_addressFromLast20Bytes,_console2_log_StdUtilsRenamed private constants
_FAILED_SLOT_UINT256_MAX,_CONSOLE2_ADDRESS_NUM_TYPES_INT256_MIN_UINT256_MAX,_INT256_MIN_ABS,_SECP256K1_ORDER,_CONSOLE2_ADDRESSExclusions
vmprivate constant — universal alias across forge-std and broader user code.UINT256_MAXinStdStorage.sol— declared without an explicit visibility modifier, which defaults tointernalin Solidity, so it is out of scope for this PR.internalconstants inBase.solandStdConstants.sol— out of scope.Verification
forge buildandforge testboth pass (202/202 tests).