diff --git a/.changeset/beige-geckos-explode.md b/.changeset/beige-geckos-explode.md new file mode 100644 index 00000000000..9f06a9c989b --- /dev/null +++ b/.changeset/beige-geckos-explode.md @@ -0,0 +1,5 @@ +--- +"chainlink": minor +--- + +#updated Gracefully fail if CL_DATABASE_URL is not set. diff --git a/.github/workflows/crib-integration-test.yml b/.github/workflows/crib-integration-test.yml index 63c383300ec..a6f995d57ba 100644 --- a/.github/workflows/crib-integration-test.yml +++ b/.github/workflows/crib-integration-test.yml @@ -76,7 +76,7 @@ jobs: echo $GITHUB_WORKSPACE - name: Deploy and validate CRIB Environment for Core - uses: smartcontractkit/.github/actions/crib-deploy-environment@57f99fbea73056c490c766d50ef582a13ec4f3bb # crib-deploy-environment@7.2.0 + uses: smartcontractkit/.github/actions/crib-deploy-environment@815e0d550527897746e889441407926d7e28169c # crib-deploy-environment@7.4.0 id: deploy-crib with: github-token: ${{ steps.token.outputs.access-token }} diff --git a/.golangci.yml b/.golangci.yml index a7928ee97de..63b061c2951 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,5 @@ run: - timeout: 15m0s + timeout: 15m allow-parallel-runners: true linters: enable: @@ -97,7 +97,7 @@ linters-settings: - name: waitgroup-by-value - name: unconditional-recursion - name: struct-tag - # - name: string-format + - name: string-format - name: string-of-int - name: range-val-address - name: range-val-in-closure diff --git a/contracts/.changeset/new-elephants-behave.md b/contracts/.changeset/new-elephants-behave.md new file mode 100644 index 00000000000..29f3c248afc --- /dev/null +++ b/contracts/.changeset/new-elephants-behave.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +fix test naming diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 504566402ac..d9a3baac08a 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -1,367 +1,205 @@ ARMProxy_constructor:test_Constructor() (gas: 302231) -ARMProxy_isCursed:test_IsCursed_Success() (gas: 47209) -ARMProxy_isCursed:test_call_ARMCallEmptyContract_Revert() (gas: 19412) -ARMProxy_isCursed:test_isCursed_RevertReasonForwarded_Revert() (gas: 45210) +ARMProxy_isCursed:test_IsCursed_GlobalCurseSubject() (gas: 89814) ARMProxy_setARM:test_SetARM() (gas: 16599) ARMProxy_setARM:test_SetARMzero() (gas: 11275) -BurnFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 27346) -BurnFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 54878) -BurnFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244452) -BurnFromMintTokenPool_lockOrBurn:test_setup_Success() (gas: 24210) -BurnMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 27486) -BurnMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 54878) -BurnMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 242352) -BurnMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 17852) -BurnMintTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 27287) -BurnMintTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 54624) -BurnMintTokenPool_releaseOrMint:test_PoolMint_Success() (gas: 109426) -BurnMintWithLockReleaseFlagTokenPool_lockOrBurn:test_LockOrBurn_CorrectReturnData_Success() (gas: 242805) -BurnWithFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 27346) -BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 54878) -BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 244496) -BurnWithFromMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 24223) -CCIPClientExample_sanity:test_ImmutableExamples_Success() (gas: 2078199) -CCIPHome__validateConfig:test__validateConfigLessTransmittersThanSigners_Success() (gas: 332619) -CCIPHome__validateConfig:test__validateConfigSmallerFChain_Success() (gas: 458568) -CCIPHome__validateConfig:test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() (gas: 289191) -CCIPHome__validateConfig:test__validateConfig_ABIEncodedAddress_RMNHomeAddressCannotBeZero_Reverts() (gas: 289486) -CCIPHome__validateConfig:test__validateConfig_ChainSelectorNotFound_Reverts() (gas: 292216) -CCIPHome__validateConfig:test__validateConfig_ChainSelectorNotSet_Reverts() (gas: 288824) -CCIPHome__validateConfig:test__validateConfig_FChainTooHigh_Reverts() (gas: 336363) -CCIPHome__validateConfig:test__validateConfig_FMustBePositive_Reverts() (gas: 290590) -CCIPHome__validateConfig:test__validateConfig_FTooHigh_Reverts() (gas: 290055) -CCIPHome__validateConfig:test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() (gas: 308646) -CCIPHome__validateConfig:test__validateConfig_NotEnoughTransmitters_Reverts() (gas: 1191231) -CCIPHome__validateConfig:test__validateConfig_OfframpAddressCannotBeZero_Reverts() (gas: 288918) -CCIPHome__validateConfig:test__validateConfig_RMNHomeAddressCannotBeZero_Reverts() (gas: 289112) -CCIPHome__validateConfig:test__validateConfig_Success() (gas: 299797) -CCIPHome__validateConfig:test__validateConfig_TooManySigners_Reverts() (gas: 773105) -CCIPHome__validateConfig:test__validateConfig_ZeroP2PId_Reverts() (gas: 293455) -CCIPHome__validateConfig:test__validateConfig_ZeroSignerKey_Reverts() (gas: 293503) -CCIPHome_applyChainConfigUpdates:test__applyChainConfigUpdates_FChainNotPositive_Reverts() (gas: 187822) -CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_addChainConfigs_Success() (gas: 350051) -CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() (gas: 18089) -CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_removeChainConfigs_Success() (gas: 282212) -CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_selectorNotFound_Reverts() (gas: 14976) -CCIPHome_applyChainConfigUpdates:test_getPaginatedCCIPHomes_Success() (gas: 373475) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_DONIdMismatch_reverts() (gas: 38098) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_InnerCallReverts_reverts() (gas: 11783) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_InvalidSelector_reverts() (gas: 11015) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_reverts() (gas: 37072) -CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet_success() (gas: 1455674) -CCIPHome_constructor:test_constructor_CapabilitiesRegistryAddressZero_reverts() (gas: 63865) -CCIPHome_constructor:test_constructor_success() (gas: 3531036) -CCIPHome_getAllConfigs:test_getAllConfigs_success() (gas: 2773023) -CCIPHome_getCapabilityConfiguration:test_getCapabilityConfiguration_success() (gas: 9116) -CCIPHome_getConfigDigests:test_getConfigDigests_success() (gas: 2547513) -CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_CanOnlySelfCall_reverts() (gas: 9110) -CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() (gas: 23074) -CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() (gas: 8840) -CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_multiplePlugins_success() (gas: 5113754) -CCIPHome_revokeCandidate:test_revokeCandidate_CanOnlySelfCall_reverts() (gas: 9024) -CCIPHome_revokeCandidate:test_revokeCandidate_ConfigDigestMismatch_reverts() (gas: 19084) -CCIPHome_revokeCandidate:test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() (gas: 8773) -CCIPHome_revokeCandidate:test_revokeCandidate_success() (gas: 30676) -CCIPHome_setCandidate:test_setCandidate_CanOnlySelfCall_reverts() (gas: 29383) -CCIPHome_setCandidate:test_setCandidate_ConfigDigestMismatch_reverts() (gas: 1395154) -CCIPHome_setCandidate:test_setCandidate_success() (gas: 1365439) -CCIPHome_supportsInterface:test_supportsInterface_success() (gas: 9885) -DefensiveExampleTest:test_HappyPath_Success() (gas: 200540) +BurnFromMintTokenPool_lockOrBurn:test_PoolBurn() (gas: 238946) +BurnFromMintTokenPool_lockOrBurn:test_setup() (gas: 24168) +BurnMintTokenPool_lockOrBurn:test_PoolBurn() (gas: 236868) +BurnMintTokenPool_lockOrBurn:test_Setup() (gas: 17809) +BurnMintTokenPool_releaseOrMint:test_PoolMint() (gas: 102532) +BurnMintWithLockReleaseFlagTokenPool_lockOrBurn:test_LockOrBurn_CorrectReturnData() (gas: 237295) +BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurn() (gas: 239008) +BurnWithFromMintTokenPool_lockOrBurn:test_Setup() (gas: 24159) +CCIPClientExample_sanity:test_ImmutableExamples() (gas: 2065555) +CCIPHome__validateConfig:test__validateConfig() (gas: 299752) +CCIPHome__validateConfig:test__validateConfigLessTransmittersThanSigners() (gas: 332617) +CCIPHome__validateConfig:test__validateConfigSmallerFChain() (gas: 458568) +CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_addChainConfigs() (gas: 350052) +CCIPHome_applyChainConfigUpdates:test_applyChainConfigUpdates_removeChainConfigs() (gas: 282248) +CCIPHome_applyChainConfigUpdates:test_getPaginatedCCIPHomes() (gas: 373497) +CCIPHome_beforeCapabilityConfigSet:test_beforeCapabilityConfigSet() (gas: 1455673) +CCIPHome_constructor:test_constructor() (gas: 3531056) +CCIPHome_getAllConfigs:test_getAllConfigs() (gas: 2773001) +CCIPHome_getCapabilityConfiguration:test_getCapabilityConfiguration() (gas: 9094) +CCIPHome_getConfigDigests:test_getConfigDigests() (gas: 2547468) +CCIPHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_multiplePlugins() (gas: 5113733) +CCIPHome_revokeCandidate:test_revokeCandidate() (gas: 30677) +CCIPHome_setCandidate:test_setCandidate() (gas: 1365438) +CCIPHome_supportsInterface:test_supportsInterface() (gas: 9885) +DefensiveExampleTest:test_HappyPath() (gas: 200521) DefensiveExampleTest:test_Recovery() (gas: 425013) -E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1513205) -ERC165CheckerReverting_getSupportedInterfaces:test__getSupportedInterfacesReverting() (gas: 11479) -ERC165CheckerReverting_supportsInterfaceReverting:test__getSupportedInterfacesReverting() (gas: 11490) -ERC165CheckerReverting_supportsInterfaceReverting:test__supportsAllInterfacesReverting() (gas: 10828) -ERC165CheckerReverting_supportsInterfaceReverting:test__supportsAllInterfacesReverting_notAllSupported() (gas: 11882) -ERC165CheckerReverting_supportsInterfaceReverting:test__supportsAllInterfacesReverting_notSupportsERC165() (gas: 6494) -ERC165CheckerReverting_supportsInterfaceReverting:test__supportsInterfaceReverting() (gas: 10452) +E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1487929) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 96980) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_happyPath() (gas: 49812) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongToken() (gas: 17479) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongTokenAmount() (gas: 15753) -EtherSenderReceiverTest_ccipSend:test_ccipSend_reverts_insufficientFee_feeToken() (gas: 99953) -EtherSenderReceiverTest_ccipSend:test_ccipSend_reverts_insufficientFee_native() (gas: 76182) -EtherSenderReceiverTest_ccipSend:test_ccipSend_reverts_insufficientFee_weth() (gas: 99974) -EtherSenderReceiverTest_ccipSend:test_ccipSend_success_feeToken() (gas: 145007) -EtherSenderReceiverTest_ccipSend:test_ccipSend_success_native() (gas: 80439) -EtherSenderReceiverTest_ccipSend:test_ccipSend_success_nativeExcess() (gas: 80604) -EtherSenderReceiverTest_ccipSend:test_ccipSend_success_weth() (gas: 96107) +EtherSenderReceiverTest_ccipSend:test_ccipSend_feeToken() (gas: 145049) +EtherSenderReceiverTest_ccipSend:test_ccipSend_native() (gas: 80417) +EtherSenderReceiverTest_ccipSend:test_ccipSend_nativeExcess() (gas: 80582) +EtherSenderReceiverTest_ccipSend:test_ccipSend_weth() (gas: 96129) EtherSenderReceiverTest_constructor:test_constructor() (gas: 17575) EtherSenderReceiverTest_getFee:test_getFee() (gas: 27456) -EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_reverts_feeToken_tokenAmountNotEqualToMsgValue() (gas: 20355) -EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_valid_feeToken() (gas: 16682) +EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_valid_feeToken() (gas: 16704) EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_valid_native() (gas: 16615) EtherSenderReceiverTest_validatedMessage:test_validatedMessage_dataOverwrittenToMsgSender() (gas: 25456) EtherSenderReceiverTest_validatedMessage:test_validatedMessage_emptyDataOverwrittenToMsgSender() (gas: 25373) EtherSenderReceiverTest_validatedMessage:test_validatedMessage_invalidTokenAmounts() (gas: 17969) EtherSenderReceiverTest_validatedMessage:test_validatedMessage_tokenOverwrittenToWeth() (gas: 25328) EtherSenderReceiverTest_validatedMessage:test_validatedMessage_validMessage_extraArgs() (gas: 26348) -FactoryBurnMintERC20_approve:test_Approve_Success() (gas: 55819) -FactoryBurnMintERC20_approve:test_InvalidAddress_Reverts() (gas: 10703) -FactoryBurnMintERC20_burn:test_BasicBurn_Success() (gas: 172464) -FactoryBurnMintERC20_burn:test_BurnFromZeroAddress_Reverts() (gas: 47338) -FactoryBurnMintERC20_burn:test_ExceedsBalance_Reverts() (gas: 22005) -FactoryBurnMintERC20_burn:test_SenderNotBurner_Reverts() (gas: 13520) -FactoryBurnMintERC20_burnFrom:test_BurnFrom_Success() (gas: 58274) -FactoryBurnMintERC20_burnFrom:test_ExceedsBalance_Reverts() (gas: 36191) -FactoryBurnMintERC20_burnFrom:test_InsufficientAllowance_Reverts() (gas: 22113) -FactoryBurnMintERC20_burnFrom:test_SenderNotBurner_Reverts() (gas: 13487) -FactoryBurnMintERC20_burnFromAlias:test_BurnFrom_Success() (gas: 58248) -FactoryBurnMintERC20_burnFromAlias:test_ExceedsBalance_Reverts() (gas: 36155) -FactoryBurnMintERC20_burnFromAlias:test_InsufficientAllowance_Reverts() (gas: 22068) -FactoryBurnMintERC20_burnFromAlias:test_SenderNotBurner_Reverts() (gas: 13442) -FactoryBurnMintERC20_constructor:test_Constructor_Success() (gas: 1450638) -FactoryBurnMintERC20_decreaseApproval:test_DecreaseApproval_Success() (gas: 31419) -FactoryBurnMintERC20_getCCIPAdmin:test_getCCIPAdmin_Success() (gas: 12717) -FactoryBurnMintERC20_getCCIPAdmin:test_setCCIPAdmin_Success() (gas: 23874) -FactoryBurnMintERC20_grantMintAndBurnRoles:test_GrantMintAndBurnRoles_Success() (gas: 121194) -FactoryBurnMintERC20_grantRole:test_GrantBurnAccess_Success() (gas: 53403) -FactoryBurnMintERC20_grantRole:test_GrantMany_Success() (gas: 961486) -FactoryBurnMintERC20_grantRole:test_GrantMintAccess_Success() (gas: 94165) -FactoryBurnMintERC20_increaseApproval:test_IncreaseApproval_Success() (gas: 44398) -FactoryBurnMintERC20_mint:test_BasicMint_Success() (gas: 149804) -FactoryBurnMintERC20_mint:test_MaxSupplyExceeded_Reverts() (gas: 50679) -FactoryBurnMintERC20_mint:test_SenderNotMinter_Reverts() (gas: 11405) -FactoryBurnMintERC20_supportsInterface:test_SupportsInterface_Success() (gas: 11538) -FactoryBurnMintERC20_transfer:test_InvalidAddress_Reverts() (gas: 10701) -FactoryBurnMintERC20_transfer:test_Transfer_Success() (gas: 42482) -FeeQuoter_applyDestChainConfigUpdates:test_InvalidChainFamilySelector_Revert() (gas: 16846) -FeeQuoter_applyDestChainConfigUpdates:test_InvalidDestChainConfigDestChainSelectorEqZero_Revert() (gas: 16759) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesDefaultTxGasLimitEqZero_Revert() (gas: 16813) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesDefaultTxGasLimitGtMaxPerMessageGasLimit_Revert() (gas: 41239) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroInput_Success() (gas: 12563) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates_Success() (gas: 140709) -FeeQuoter_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates_Success() (gas: 162719) -FeeQuoter_applyFeeTokensUpdates:test_OnlyCallableByOwner_Revert() (gas: 12263) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 11476) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens_Success() (gas: 54860) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken_Success() (gas: 45257) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12368) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeConfig_Success() (gas: 89062) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeZeroInput() (gas: 13346) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_InvalidDestBytesOverhead_Revert() (gas: 17435) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 12349) -FeeQuoter_constructor:test_InvalidLinkTokenEqZeroAddress_Revert() (gas: 106632) -FeeQuoter_constructor:test_InvalidMaxFeeJuelsPerMsg_Revert() (gas: 110982) -FeeQuoter_constructor:test_InvalidStalenessThreshold_Revert() (gas: 111057) -FeeQuoter_constructor:test_Setup_Success() (gas: 5014619) -FeeQuoter_convertTokenAmount:test_ConvertTokenAmount_Success() (gas: 68416) -FeeQuoter_convertTokenAmount:test_LinkTokenNotSupported_Revert() (gas: 29300) -FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost_Success() (gas: 96433) -FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() (gas: 14857) -FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 20988) -FeeQuoter_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices_Success() (gas: 73071) -FeeQuoter_getTokenAndGasPrices:test_StaleGasPrice_Revert() (gas: 26476) -FeeQuoter_getTokenAndGasPrices:test_StalenessCheckDisabled_Success() (gas: 112065) -FeeQuoter_getTokenAndGasPrices:test_UnsupportedChain_Revert() (gas: 16184) -FeeQuoter_getTokenAndGasPrices:test_ZeroGasPrice_Success() (gas: 109175) -FeeQuoter_getTokenPrice:test_GetTokenPriceFromFeed_Success() (gas: 68059) -FeeQuoter_getTokenPrice:test_GetTokenPrice_LocalMoreRecent_Success() (gas: 33529) -FeeQuoter_getTokenPrices:test_GetTokenPrices_Success() (gas: 78516) -FeeQuoter_getTokenTransferCost:test_CustomTokenBpsFee_Success() (gas: 37307) -FeeQuoter_getTokenTransferCost:test_FeeTokenBpsFee_Success() (gas: 35086) -FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas_Success() (gas: 28176) -FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 96089) -FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee_Success() (gas: 20615) -FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas_Success() (gas: 27984) -FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28029) -FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 40822) -FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 29736) -FeeQuoter_getValidatedFee:test_DestinationChainNotEnabled_Revert() (gas: 18465) -FeeQuoter_getValidatedFee:test_EmptyMessage_Success() (gas: 83484) -FeeQuoter_getValidatedFee:test_EnforceOutOfOrder_Revert() (gas: 53570) -FeeQuoter_getValidatedFee:test_HighGasMessage_Success() (gas: 239880) -FeeQuoter_getValidatedFee:test_InvalidEVMAddress_Revert() (gas: 22668) -FeeQuoter_getValidatedFee:test_MessageGasLimitTooHigh_Revert() (gas: 29966) -FeeQuoter_getValidatedFee:test_MessageTooLarge_Revert() (gas: 100417) -FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 143562) -FeeQuoter_getValidatedFee:test_NotAFeeToken_Revert() (gas: 21280) -FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 115060) -FeeQuoter_getValidatedFee:test_TooManyTokens_Revert() (gas: 23495) -FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 63981) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 1897852) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 1897810) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 1877929) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 1897584) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 1897788) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 1897600) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() (gas: 65232) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed_Success() (gas: 65112) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice_Success() (gas: 58894) -FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 1897226) -FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken_Success() (gas: 61843) -FeeQuoter_getValidatedTokenPrice:test_TokenNotSupportedFeed_Revert() (gas: 116970) -FeeQuoter_getValidatedTokenPrice:test_TokenNotSupported_Revert() (gas: 14182) -FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 1895903) +FactoryBurnMintERC20_approve:test_Approve() (gas: 55783) +FactoryBurnMintERC20_burn:test_BasicBurn() (gas: 172448) +FactoryBurnMintERC20_burnFrom:test_BurnFrom() (gas: 58290) +FactoryBurnMintERC20_burnFromAlias:test_BurnFrom() (gas: 58264) +FactoryBurnMintERC20_constructor:test_Constructor() (gas: 1450594) +FactoryBurnMintERC20_decreaseApproval:test_DecreaseApproval() (gas: 31420) +FactoryBurnMintERC20_getCCIPAdmin:test_getCCIPAdmin() (gas: 12740) +FactoryBurnMintERC20_getCCIPAdmin:test_setCCIPAdmin() (gas: 23852) +FactoryBurnMintERC20_grantMintAndBurnRoles:test_GrantMintAndBurnRoles() (gas: 121216) +FactoryBurnMintERC20_grantRole:test_GrantBurnAccess() (gas: 53386) +FactoryBurnMintERC20_grantRole:test_GrantMany() (gas: 961464) +FactoryBurnMintERC20_grantRole:test_GrantMintAccess() (gas: 94181) +FactoryBurnMintERC20_increaseApproval:test_IncreaseApproval() (gas: 44421) +FactoryBurnMintERC20_mint:test_BasicMint() (gas: 149826) +FactoryBurnMintERC20_supportsInterface:test_SupportsInterface() (gas: 11539) +FactoryBurnMintERC20_transfer:test_Transfer() (gas: 42505) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates() (gas: 140774) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroInput() (gas: 12562) +FeeQuoter_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates() (gas: 162736) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens() (gas: 54784) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken() (gas: 45279) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12412) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeConfig() (gas: 89100) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeZeroInput() (gas: 13324) +FeeQuoter_constructor:test_Setup() (gas: 5014643) +FeeQuoter_convertTokenAmount:test_ConvertTokenAmount() (gas: 68350) +FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost() (gas: 96410) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost() (gas: 20988) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector() (gas: 14836) +FeeQuoter_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices() (gas: 73065) +FeeQuoter_getTokenAndGasPrices:test_StalenessCheckDisabled() (gas: 112102) +FeeQuoter_getTokenAndGasPrices:test_ZeroGasPrice() (gas: 109189) +FeeQuoter_getTokenPrice:test_GetTokenPriceFromFeed() (gas: 68126) +FeeQuoter_getTokenPrice:test_GetTokenPrice_LocalMoreRecent() (gas: 33553) +FeeQuoter_getTokenPrices:test_GetTokenPrices() (gas: 78451) +FeeQuoter_getTokenTransferCost:test_CustomTokenBpsFee() (gas: 37329) +FeeQuoter_getTokenTransferCost:test_FeeTokenBpsFee() (gas: 35108) +FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas() (gas: 28156) +FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee() (gas: 96110) +FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee() (gas: 20592) +FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas() (gas: 27985) +FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas() (gas: 27986) +FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee() (gas: 40800) +FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults() (gas: 29713) +FeeQuoter_getValidatedFee:test_EmptyMessage() (gas: 83464) +FeeQuoter_getValidatedFee:test_HighGasMessage() (gas: 239904) +FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer() (gas: 143587) +FeeQuoter_getValidatedFee:test_SingleTokenMessage() (gas: 115084) +FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier() (gas: 64004) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice() (gas: 58871) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed() (gas: 65113) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals() (gas: 1897788) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals() (gas: 1897830) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals() (gas: 1877886) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals() (gas: 1897628) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals() (gas: 1897764) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value() (gas: 1897598) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod() (gas: 65231) +FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken() (gas: 61820) FeeQuoter_onReport:test_OnReport_SkipPriceUpdateWhenStaleUpdateReceived() (gas: 52614) -FeeQuoter_onReport:test_onReport() (gas: 89071) -FeeQuoter_onReport:test_onReport_withKeystoneForwarderContract() (gas: 122700) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsDefault_Success() (gas: 17381) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsEnforceOutOfOrder_Revert() (gas: 21553) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsGasLimitTooHigh_Revert() (gas: 18613) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsInvalidExtraArgsTag_Revert() (gas: 18153) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV1_Success() (gas: 18467) -FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV2_Success() (gas: 18590) -FeeQuoter_processMessageArgs:test_applyTokensTransferFeeConfigUpdates_InvalidFeeRange_Revert() (gas: 21476) -FeeQuoter_processMessageArgs:test_processMessageArgs_InvalidEVMAddressDestToken_Revert() (gas: 44974) -FeeQuoter_processMessageArgs:test_processMessageArgs_InvalidExtraArgs_Revert() (gas: 20008) -FeeQuoter_processMessageArgs:test_processMessageArgs_MalformedEVMExtraArgs_Revert() (gas: 20405) -FeeQuoter_processMessageArgs:test_processMessageArgs_MessageFeeTooHigh_Revert() (gas: 17976) -FeeQuoter_processMessageArgs:test_processMessageArgs_SourceTokenDataTooLarge_Revert() (gas: 123405) -FeeQuoter_processMessageArgs:test_processMessageArgs_TokenAmountArraysMismatching_Revert() (gas: 42236) -FeeQuoter_processMessageArgs:test_processMessageArgs_WitEVMExtraArgsV2_Success() (gas: 28702) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithConvertedTokenAmount_Success() (gas: 30021) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithCorrectPoolReturnData_Success() (gas: 76515) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithEVMExtraArgsV1_Success() (gas: 28300) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithEmptyEVMExtraArgs_Success() (gas: 26159) -FeeQuoter_processMessageArgs:test_processMessageArgs_WithLinkTokenAmount_Success() (gas: 19595) -FeeQuoter_supportsInterface:test_SupportsInterface_Success() (gas: 13263) -FeeQuoter_updatePrices:test_OnlyCallableByUpdater_Revert() (gas: 12198) -FeeQuoter_updatePrices:test_OnlyGasPrice_Success() (gas: 23872) -FeeQuoter_updatePrices:test_OnlyTokenPrice_Success() (gas: 28648) -FeeQuoter_updatePrices:test_UpdatableByAuthorizedCaller_Success() (gas: 74816) -FeeQuoter_updatePrices:test_UpdateMultiplePrices_Success() (gas: 145691) -FeeQuoter_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 52443) -FeeQuoter_updateTokenPriceFeeds:test_FeedUnset_Success() (gas: 66423) -FeeQuoter_updateTokenPriceFeeds:test_FeedUpdatedByNonOwner_Revert() (gas: 20124) -FeeQuoter_updateTokenPriceFeeds:test_MultipleFeedUpdate_Success() (gas: 93563) -FeeQuoter_updateTokenPriceFeeds:test_SingleFeedUpdate_Success() (gas: 53142) -FeeQuoter_updateTokenPriceFeeds:test_ZeroFeeds_Success() (gas: 12431) -FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddressEncodePacked_Revert() (gas: 10710) -FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddressPrecompiles_Revert() (gas: 4057945) -FeeQuoter_validateDestFamilyAddress:test_InvalidEVMAddress_Revert() (gas: 10906) -FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress_Success() (gas: 6841) -FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress_Success() (gas: 6567) -HybridLockReleaseUSDCTokenPool_TransferLiquidity:test_cannotTransferLiquidityDuringPendingMigration_Revert() (gas: 176859) -HybridLockReleaseUSDCTokenPool_TransferLiquidity:test_transferLiquidity_Success() (gas: 167004) -HybridLockReleaseUSDCTokenPool_lockOrBurn:test_PrimaryMechanism_Success() (gas: 135878) -HybridLockReleaseUSDCTokenPool_lockOrBurn:test_WhileMigrationPause_Revert() (gas: 109718) -HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism_Success() (gas: 146937) -HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism_thenSwitchToPrimary_Success() (gas: 209160) -HybridLockReleaseUSDCTokenPool_releaseOrMint:test_OnLockReleaseMechanism_Success() (gas: 213127) -HybridLockReleaseUSDCTokenPool_releaseOrMint:test_WhileMigrationPause_Revert() (gas: 109646) -HybridLockReleaseUSDCTokenPool_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 265910) -LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquidity_Success() (gas: 3209936) -LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 29734) -LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Success() (gas: 80625) -LockReleaseTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 59227) -LockReleaseTokenPool_provideLiquidity:test_LiquidityNotAccepted_Revert() (gas: 3206264) -LockReleaseTokenPool_provideLiquidity:test_Unauthorized_Revert() (gas: 11511) -LockReleaseTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 74100) -LockReleaseTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 54745) -LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint_Success() (gas: 223256) -LockReleaseTokenPool_setRebalancer:test_SetRebalancer_Revert() (gas: 11003) -LockReleaseTokenPool_setRebalancer:test_SetRebalancer_Success() (gas: 18182) -LockReleaseTokenPool_supportsInterface:test_SupportsInterface_Success() (gas: 10250) -LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_Success() (gas: 83328) -LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_transferTooMuch_Revert() (gas: 56101) -LockReleaseTokenPool_withdrawalLiquidity:test_InsufficientLiquidity_Revert() (gas: 60188) -LockReleaseTokenPool_withdrawalLiquidity:test_Unauthorized_Revert() (gas: 11464) +FeeQuoter_onReport:test_onReport() (gas: 89027) +FeeQuoter_onReport:test_onReport_withKeystoneForwarderContract() (gas: 122656) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsDefault() (gas: 17425) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV1() (gas: 18511) +FeeQuoter_parseEVMExtraArgsFromBytes:test_EVMExtraArgsV2() (gas: 18614) +FeeQuoter_processMessageArgs:test_processMessageArgs_WitEVMExtraArgsV2() (gas: 28659) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithConvertedTokenAmount() (gas: 29999) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithCorrectPoolReturnData() (gas: 76516) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithEVMExtraArgsV1() (gas: 28300) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithEmptyEVMExtraArgs() (gas: 26148) +FeeQuoter_processMessageArgs:test_processMessageArgs_WithLinkTokenAmount() (gas: 19639) +FeeQuoter_supportsInterface:test_SupportsInterface() (gas: 13264) +FeeQuoter_updatePrices:test_OnlyGasPrice() (gas: 23850) +FeeQuoter_updatePrices:test_OnlyTokenPrice() (gas: 28736) +FeeQuoter_updatePrices:test_UpdatableByAuthorizedCaller() (gas: 74816) +FeeQuoter_updatePrices:test_UpdateMultiplePrices() (gas: 145689) +FeeQuoter_updateTokenPriceFeeds:test_FeedNotUpdated() (gas: 52498) +FeeQuoter_updateTokenPriceFeeds:test_FeedUnset() (gas: 66456) +FeeQuoter_updateTokenPriceFeeds:test_MultipleFeedUpdate() (gas: 93606) +FeeQuoter_updateTokenPriceFeeds:test_SingleFeedUpdate() (gas: 53198) +FeeQuoter_updateTokenPriceFeeds:test_ZeroFeeds() (gas: 12495) +FeeQuoter_validateDestFamilyAddress:test_ValidEVMAddress() (gas: 6798) +FeeQuoter_validateDestFamilyAddress:test_ValidNonEVMAddress() (gas: 6523) +HybridLockReleaseUSDCTokenPool_TransferLiquidity:test_transferLiquidity() (gas: 167004) +HybridLockReleaseUSDCTokenPool_lockOrBurn:test_PrimaryMechanism() (gas: 130340) +HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism() (gas: 140093) +HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 202936) +HybridLockReleaseUSDCTokenPool_releaseOrMint:test_OnLockReleaseMechanism() (gas: 206227) +HybridLockReleaseUSDCTokenPool_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 260398) +LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquidity() (gas: 3209963) +LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList() (gas: 72800) +LockReleaseTokenPool_releaseOrMint:test_ReleaseOrMint() (gas: 217909) +LockReleaseTokenPool_setRebalancer:test_SetRebalancer() (gas: 18183) +LockReleaseTokenPool_supportsInterface:test_SupportsInterface() (gas: 10251) +LockReleaseTokenPool_transferLiquidity:test_transferLiquidity() (gas: 83263) MerkleMultiProofTest:test_CVE_2023_34459() (gas: 5456) -MerkleMultiProofTest:test_EmptyLeaf_Revert() (gas: 3563) MerkleMultiProofTest:test_MerkleRoot256() (gas: 394891) -MerkleMultiProofTest:test_MerkleRootSingleLeaf_Success() (gas: 3661) +MerkleMultiProofTest:test_MerkleRootSingleLeaf() (gas: 3684) MerkleMultiProofTest:test_SpecSync_gas() (gas: 34152) -MockRouterTest:test_ccipSendWithEVMExtraArgsV1_Success() (gas: 110095) -MockRouterTest:test_ccipSendWithEVMExtraArgsV2_Success() (gas: 132614) -MockRouterTest:test_ccipSendWithInsufficientNativeTokens_Revert() (gas: 34059) -MockRouterTest:test_ccipSendWithInvalidEVMExtraArgs_Revert() (gas: 106706) -MockRouterTest:test_ccipSendWithInvalidMsgValue_Revert() (gas: 60864) -MockRouterTest:test_ccipSendWithLinkFeeTokenAndValidMsgValue_Success() (gas: 126741) -MockRouterTest:test_ccipSendWithLinkFeeTokenbutInsufficientAllowance_Revert() (gas: 63499) -MockRouterTest:test_ccipSendWithSufficientNativeFeeTokens_Success() (gas: 44070) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ConfigRateMoreThanCapacity_Revert() (gas: 16554) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ConfigRateZero_Revert() (gas: 16634) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_DiableConfigCapacityNonZero_Revert() (gas: 16585) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_DisableConfigRateNonZero_Revert() (gas: 16571) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_MultipleConfigsBothLanes_Success() (gas: 133973) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_MultipleConfigs_Success() (gas: 316663) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_OnlyCallableByOwner_Revert() (gas: 17490) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_SingleConfigOutbound_Success() (gas: 76620) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_SingleConfig_Success() (gas: 76603) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_UpdateExistingConfigWithNoDifference_Success() (gas: 38739) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_UpdateExistingConfig_Success() (gas: 53937) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ZeroChainSelector_Revert() (gas: 17154) -MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ZeroConfigs_Success() (gas: 12481) -MultiAggregateRateLimiter_constructor:test_ConstructorNoAuthorizedCallers_Success() (gas: 1977286) -MultiAggregateRateLimiter_constructor:test_Constructor_Success() (gas: 2093583) -MultiAggregateRateLimiter_getTokenBucket:test_GetTokenBucket_Success() (gas: 30794) -MultiAggregateRateLimiter_getTokenBucket:test_Refill_Success() (gas: 48169) -MultiAggregateRateLimiter_getTokenBucket:test_TimeUnderflow_Revert() (gas: 15907) -MultiAggregateRateLimiter_getTokenValue:test_GetTokenValue_Success() (gas: 17624) -MultiAggregateRateLimiter_getTokenValue:test_NoTokenPrice_Reverts() (gas: 21652) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageFromUnauthorizedCaller_Revert() (gas: 14636) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDifferentTokensOnDifferentChains_Success() (gas: 210637) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDisabledRateLimitToken_Success() (gas: 58473) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithNoTokens_Success() (gas: 17791) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitDisabled_Success() (gas: 45202) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitExceeded_Revert() (gas: 46514) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitReset_Success() (gas: 76999) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokensOnDifferentChains_Success() (gas: 309039) -MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokens_Success() (gas: 50680) -MultiAggregateRateLimiter_onOutboundMessage:test_RateLimitValueDifferentLanes_Success() (gas: 51331) -MultiAggregateRateLimiter_onOutboundMessage:test_ValidateMessageWithNoTokens_Success() (gas: 19375) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageFromUnauthorizedCaller_Revert() (gas: 15914) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains_Success() (gas: 210357) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken_Success() (gas: 60266) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitDisabled_Success() (gas: 47025) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitExceeded_Revert() (gas: 48305) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitReset_Success() (gas: 78006) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains_Success() (gas: 308985) -MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokens_Success() (gas: 52450) -MultiAggregateRateLimiter_setFeeQuoter:test_OnlyOwner_Revert() (gas: 10967) -MultiAggregateRateLimiter_setFeeQuoter:test_Owner_Success() (gas: 19190) -MultiAggregateRateLimiter_setFeeQuoter:test_ZeroAddress_Revert() (gas: 10642) -MultiAggregateRateLimiter_updateRateLimitTokens:test_NonOwner_Revert() (gas: 18518) -MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensMultipleChains_Success() (gas: 281000) -MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensSingleChain_Success() (gas: 255391) -MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokens_AddsAndRemoves_Success() (gas: 205169) -MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokens_RemoveNonExistentToken_Success() (gas: 29012) -MultiAggregateRateLimiter_updateRateLimitTokens:test_ZeroDestToken_AbiEncoded_Revert() (gas: 14001) -MultiAggregateRateLimiter_updateRateLimitTokens:test_ZeroDestToken_Revert() (gas: 18365) -MultiAggregateRateLimiter_updateRateLimitTokens:test_ZeroSourceToken_Revert() (gas: 18294) -MultiOCR3Base_setOCR3Configs:test_FMustBePositive_Revert() (gas: 59441) -MultiOCR3Base_setOCR3Configs:test_FTooHigh_Revert() (gas: 44190) -MultiOCR3Base_setOCR3Configs:test_MoreTransmittersThanSigners_Revert() (gas: 104844) -MultiOCR3Base_setOCR3Configs:test_NoTransmitters_Revert() (gas: 18908) -MultiOCR3Base_setOCR3Configs:test_RepeatSignerAddress_Revert() (gas: 283842) -MultiOCR3Base_setOCR3Configs:test_RepeatTransmitterAddress_Revert() (gas: 422489) -MultiOCR3Base_setOCR3Configs:test_SetConfigIgnoreSigners_Success() (gas: 512288) -MultiOCR3Base_setOCR3Configs:test_SetConfigWithSignersMismatchingTransmitters_Success() (gas: 680609) -MultiOCR3Base_setOCR3Configs:test_SetConfigWithSigners_Success() (gas: 829200) -MultiOCR3Base_setOCR3Configs:test_SetConfigWithoutSigners_Success() (gas: 457530) -MultiOCR3Base_setOCR3Configs:test_SetConfigsZeroInput_Success() (gas: 12436) -MultiOCR3Base_setOCR3Configs:test_SetMultipleConfigs_Success() (gas: 2142528) -MultiOCR3Base_setOCR3Configs:test_SignerCannotBeZeroAddress_Revert() (gas: 141905) -MultiOCR3Base_setOCR3Configs:test_StaticConfigChange_Revert() (gas: 807791) -MultiOCR3Base_setOCR3Configs:test_TooManySigners_Revert() (gas: 158911) -MultiOCR3Base_setOCR3Configs:test_TooManyTransmitters_Revert() (gas: 112357) -MultiOCR3Base_setOCR3Configs:test_TransmitterCannotBeZeroAddress_Revert() (gas: 254293) -MultiOCR3Base_setOCR3Configs:test_UpdateConfigSigners_Success() (gas: 861787) -MultiOCR3Base_setOCR3Configs:test_UpdateConfigTransmittersWithoutSigners_Success() (gas: 476186) -MultiOCR3Base_transmit:test_ConfigDigestMismatch_Revert() (gas: 42765) -MultiOCR3Base_transmit:test_ForkedChain_Revert() (gas: 48348) -MultiOCR3Base_transmit:test_InsufficientSignatures_Revert() (gas: 76893) -MultiOCR3Base_transmit:test_NonUniqueSignature_Revert() (gas: 65621) -MultiOCR3Base_transmit:test_SignatureOutOfRegistration_Revert() (gas: 33387) -MultiOCR3Base_transmit:test_TooManySignatures_Revert() (gas: 79597) -MultiOCR3Base_transmit:test_TransmitSigners_gas_Success() (gas: 33589) -MultiOCR3Base_transmit:test_TransmitWithExtraCalldataArgs_Revert() (gas: 47082) -MultiOCR3Base_transmit:test_TransmitWithLessCalldataArgs_Revert() (gas: 25583) -MultiOCR3Base_transmit:test_TransmitWithoutSignatureVerification_gas_Success() (gas: 18615) -MultiOCR3Base_transmit:test_UnAuthorizedTransmitter_Revert() (gas: 24193) -MultiOCR3Base_transmit:test_UnauthorizedSigner_Revert() (gas: 60994) -MultiOCR3Base_transmit:test_UnconfiguredPlugin_Revert() (gas: 39824) -MultiOCR3Base_transmit:test_ZeroSignatures_Revert() (gas: 32920) -NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 123604) -NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySet_overrideAllowed() (gas: 45986) -NonceManager_applyPreviousRampsUpdates:test_SingleRampUpdate_success() (gas: 66889) -NonceManager_applyPreviousRampsUpdates:test_ZeroInput() (gas: 12169) -NonceManager_getInboundNonce:test_getInboundNonce_NoPrevOffRampForChain() (gas: 185881) -NonceManager_getInboundNonce:test_getInboundNonce_Upgraded() (gas: 153036) -NonceManager_getInboundNonce:test_getInboundNonce_UpgradedNonceNewSenderStartsAtZero() (gas: 189356) -NonceManager_getInboundNonce:test_getInboundNonce_UpgradedNonceStartsAtV1Nonce() (gas: 252504) -NonceManager_getInboundNonce:test_getInboundNonce_UpgradedOffRampNonceSkipsIfMsgInFlight() (gas: 220732) +MockRouterTest:test_ccipSendWithEVMExtraArgsV1() (gas: 110127) +MockRouterTest:test_ccipSendWithEVMExtraArgsV2() (gas: 132625) +MockRouterTest:test_ccipSendWithLinkFeeTokenAndValidMsgValue() (gas: 126731) +MockRouterTest:test_ccipSendWithSufficientNativeFeeTokens() (gas: 44094) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_MultipleConfigs() (gas: 316641) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_MultipleConfigsBothLanes() (gas: 133974) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_SingleConfig() (gas: 76612) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_SingleConfigOutbound() (gas: 76654) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_UpdateExistingConfig() (gas: 53872) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_UpdateExistingConfigWithNoDifference() (gas: 38759) +MultiAggregateRateLimiter_applyRateLimiterConfigUpdates:test_ZeroConfigs() (gas: 12503) +MultiAggregateRateLimiter_constructor:test_Constructor() (gas: 2093495) +MultiAggregateRateLimiter_constructor:test_ConstructorNoAuthorizedCallers() (gas: 1977273) +MultiAggregateRateLimiter_getTokenBucket:test_GetTokenBucket() (gas: 30794) +MultiAggregateRateLimiter_getTokenBucket:test_Refill() (gas: 48146) +MultiAggregateRateLimiter_getTokenValue:test_GetTokenValue() (gas: 17582) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDifferentTokensOnDifferentChains() (gas: 210614) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithDisabledRateLimitToken() (gas: 58494) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithNoTokens() (gas: 17813) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitDisabled() (gas: 45245) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithRateLimitReset() (gas: 76933) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokens() (gas: 50703) +MultiAggregateRateLimiter_onInboundMessage:test_ValidateMessageWithTokensOnDifferentChains() (gas: 309105) +MultiAggregateRateLimiter_onOutboundMessage:test_RateLimitValueDifferentLanes() (gas: 51331) +MultiAggregateRateLimiter_onOutboundMessage:test_ValidateMessageWithNoTokens() (gas: 19353) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains() (gas: 210332) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken() (gas: 60289) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitDisabled() (gas: 46980) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithRateLimitReset() (gas: 78006) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokens() (gas: 52496) +MultiAggregateRateLimiter_onOutboundMessage:test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains() (gas: 309029) +MultiAggregateRateLimiter_setFeeQuoter:test_Owner() (gas: 19146) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensMultipleChains() (gas: 280956) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokensSingleChain() (gas: 255391) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokens_AddsAndRemoves() (gas: 205151) +MultiAggregateRateLimiter_updateRateLimitTokens:test_UpdateRateLimitTokens_RemoveNonExistentToken() (gas: 29055) +MultiOCR3Base_setOCR3Configs:test_SetConfigIgnoreSigners() (gas: 512288) +MultiOCR3Base_setOCR3Configs:test_SetConfigWithSigners() (gas: 829136) +MultiOCR3Base_setOCR3Configs:test_SetConfigWithSignersMismatchingTransmitters() (gas: 680621) +MultiOCR3Base_setOCR3Configs:test_SetConfigWithoutSigners() (gas: 457530) +MultiOCR3Base_setOCR3Configs:test_SetConfigsZeroInput() (gas: 12481) +MultiOCR3Base_setOCR3Configs:test_SetMultipleConfigs() (gas: 2142579) +MultiOCR3Base_setOCR3Configs:test_UpdateConfigSigners() (gas: 861823) +MultiOCR3Base_setOCR3Configs:test_UpdateConfigTransmittersWithoutSigners() (gas: 476185) +MultiOCR3Base_transmit:test_TransmitSigners_gas() (gas: 33568) +MultiOCR3Base_transmit:test_TransmitWithoutSignatureVerification_gas() (gas: 18638) +NonceManager_applyPreviousRampsUpdates:test_MultipleRampsUpdates() (gas: 123593) +NonceManager_applyPreviousRampsUpdates:test_PreviousRampAlreadySet_overrideAllowed() (gas: 45963) +NonceManager_applyPreviousRampsUpdates:test_SingleRampUpdate() (gas: 66943) +NonceManager_applyPreviousRampsUpdates:test_ZeroInput() (gas: 12191) +NonceManager_getInboundNonce:test_getInboundNonce_NoPrevOffRampForChain() (gas: 178734) +NonceManager_getInboundNonce:test_getInboundNonce_Upgraded() (gas: 145889) +NonceManager_getInboundNonce:test_getInboundNonce_UpgradedNonceNewSenderStartsAtZero() (gas: 182209) +NonceManager_getInboundNonce:test_getInboundNonce_UpgradedNonceStartsAtV1Nonce() (gas: 244710) +NonceManager_getInboundNonce:test_getInboundNonce_UpgradedOffRampNonceSkipsIfMsgInFlight() (gas: 213585) NonceManager_getInboundNonce:test_getInboundNonce_UpgradedSenderNoncesReadsPreviousRamp() (gas: 60520) NonceManager_getIncrementedOutboundNonce:test_getIncrementedOutboundNonce() (gas: 37979) NonceManager_getIncrementedOutboundNonce:test_incrementInboundNonce() (gas: 38756) @@ -371,393 +209,198 @@ NonceManager_getOutboundNonce:test_getOutboundNonce_Upgrade() (gas: 105300) NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceNewSenderStartsAtZero() (gas: 166146) NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeNonceStartsAtV1Nonce() (gas: 195937) NonceManager_getOutboundNonce:test_getOutboundNonce_UpgradeSenderNoncesReadsPreviousRamp() (gas: 140158) -OffRamp_afterOC3ConfigSet:test_afterOCR3ConfigSet_SignatureVerificationDisabled_Revert() (gas: 5908363) -OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 626094) -OffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 166505) -OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 16719) -OffRamp_applySourceChainConfigUpdates:test_InvalidOnRampUpdate_Revert() (gas: 274389) -OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp_Success() (gas: 168604) -OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain_Success() (gas: 181037) -OffRamp_applySourceChainConfigUpdates:test_RouterAddress_Revert() (gas: 13441) -OffRamp_applySourceChainConfigUpdates:test_ZeroOnRampAddress_Revert() (gas: 72724) -OffRamp_applySourceChainConfigUpdates:test_ZeroSourceChainSelector_Revert() (gas: 15519) -OffRamp_applySourceChainConfigUpdates:test_allowNonOnRampUpdateAfterLaneIsUsed_success() (gas: 284695) -OffRamp_batchExecute:test_MultipleReportsDifferentChainsSkipCursedChain_Success() (gas: 177651) -OffRamp_batchExecute:test_MultipleReportsDifferentChains_Success() (gas: 333753) -OffRamp_batchExecute:test_MultipleReportsSameChain_Success() (gas: 277019) -OffRamp_batchExecute:test_MultipleReportsSkipDuplicate_Success() (gas: 168589) -OffRamp_batchExecute:test_OutOfBoundsGasLimitsAccess_Revert() (gas: 188293) -OffRamp_batchExecute:test_SingleReport_Success() (gas: 156587) -OffRamp_batchExecute:test_Unhealthy_Success() (gas: 545791) -OffRamp_batchExecute:test_ZeroReports_Revert() (gas: 10643) -OffRamp_commit:test_CommitOnRampMismatch_Revert() (gas: 92450) -OffRamp_commit:test_FailedRMNVerification_Reverts() (gas: 63117) -OffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 69655) -OffRamp_commit:test_InvalidInterval_Revert() (gas: 65803) -OffRamp_commit:test_InvalidRootRevert() (gas: 64898) -OffRamp_commit:test_NoConfigWithOtherConfigPresent_Revert() (gas: 6669153) -OffRamp_commit:test_NoConfig_Revert() (gas: 6252571) -OffRamp_commit:test_OnlyGasPriceUpdates_Success() (gas: 112728) -OffRamp_commit:test_OnlyPriceUpdateStaleReport_Revert() (gas: 120561) -OffRamp_commit:test_OnlyTokenPriceUpdates_Success() (gas: 112660) -OffRamp_commit:test_PriceSequenceNumberCleared_Success() (gas: 354785) -OffRamp_commit:test_ReportAndPriceUpdate_Success() (gas: 163983) -OffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 140923) -OffRamp_commit:test_RootAlreadyCommitted_Revert() (gas: 147631) -OffRamp_commit:test_RootWithRMNDisabled_success() (gas: 153596) -OffRamp_commit:test_SourceChainNotEnabled_Revert() (gas: 61365) -OffRamp_commit:test_StaleReportWithRoot_Success() (gas: 231709) -OffRamp_commit:test_UnauthorizedTransmitter_Revert() (gas: 125027) -OffRamp_commit:test_Unhealthy_Revert() (gas: 60177) -OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot_Success() (gas: 206221) -OffRamp_commit:test_ZeroEpochAndRound_Revert() (gas: 53305) -OffRamp_constructor:test_Constructor_Success() (gas: 6215348) -OffRamp_constructor:test_SourceChainSelector_Revert() (gas: 137118) -OffRamp_constructor:test_ZeroChainSelector_Revert() (gas: 103828) -OffRamp_constructor:test_ZeroNonceManager_Revert() (gas: 101677) -OffRamp_constructor:test_ZeroOnRampAddress_Revert() (gas: 162599) -OffRamp_constructor:test_ZeroRMNRemote_Revert() (gas: 101597) -OffRamp_constructor:test_ZeroTokenAdminRegistry_Revert() (gas: 101598) -OffRamp_execute:test_IncorrectArrayType_Revert() (gas: 17532) -OffRamp_execute:test_LargeBatch_Success() (gas: 3380247) -OffRamp_execute:test_MultipleReportsWithPartialValidationFailures_Success() (gas: 371269) -OffRamp_execute:test_MultipleReports_Success() (gas: 298986) -OffRamp_execute:test_NoConfigWithOtherConfigPresent_Revert() (gas: 7077691) -OffRamp_execute:test_NoConfig_Revert() (gas: 6302161) -OffRamp_execute:test_NonArray_Revert() (gas: 27572) -OffRamp_execute:test_SingleReport_Success() (gas: 175691) -OffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 147850) -OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6969299) -OffRamp_execute:test_ZeroReports_Revert() (gas: 17248) -OffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens() (gas: 56273) +OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains() (gas: 626073) +OffRamp_applySourceChainConfigUpdates:test_AddNewChain() (gas: 166460) +OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates() (gas: 16720) +OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain() (gas: 181035) +OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp() (gas: 168558) +OffRamp_applySourceChainConfigUpdates:test_allowNonOnRampUpdateAfterLaneIsUsed() (gas: 284716) +OffRamp_batchExecute:test_MultipleReportsDifferentChains() (gas: 325065) +OffRamp_batchExecute:test_MultipleReportsDifferentChainsSkipCursedChain() (gas: 170394) +OffRamp_batchExecute:test_MultipleReportsSameChain() (gas: 268364) +OffRamp_batchExecute:test_MultipleReportsSkipDuplicate() (gas: 161411) +OffRamp_batchExecute:test_SingleReport() (gas: 149342) +OffRamp_batchExecute:test_Unhealthy() (gas: 532022) +OffRamp_commit:test_OnlyGasPriceUpdates() (gas: 112719) +OffRamp_commit:test_OnlyTokenPriceUpdates() (gas: 112673) +OffRamp_commit:test_PriceSequenceNumberCleared() (gas: 354787) +OffRamp_commit:test_ReportAndPriceUpdate() (gas: 163895) +OffRamp_commit:test_ReportOnlyRootSuccess_gas() (gas: 140878) +OffRamp_commit:test_RootWithRMNDisabled() (gas: 153674) +OffRamp_commit:test_StaleReportWithRoot() (gas: 231732) +OffRamp_commit:test_ValidPriceUpdateThenStaleReportWithRoot() (gas: 206199) +OffRamp_constructor:test_Constructor() (gas: 6210275) +OffRamp_execute:test_LargeBatch() (gas: 3354418) +OffRamp_execute:test_MultipleReports() (gas: 290585) +OffRamp_execute:test_MultipleReportsWithPartialValidationFailures() (gas: 364141) +OffRamp_execute:test_SingleReport() (gas: 168585) +OffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens() (gas: 51593) OffRamp_executeSingleMessage:test_executeSingleMessage_NonContract() (gas: 20508) -OffRamp_executeSingleMessage:test_executeSingleMessage_NonContractWithTokens() (gas: 238250) -OffRamp_executeSingleMessage:test_executeSingleMessage_WithMessageInterceptor() (gas: 92054) -OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens() (gas: 268403) -OffRamp_executeSingleReport:test_DisabledSourceChain_Revert() (gas: 28659) -OffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 15530) -OffRamp_executeSingleReport:test_InvalidSourcePoolAddress() (gas: 474978) -OffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 48296) -OffRamp_executeSingleReport:test_MismatchingDestChainSelector_Revert() (gas: 34101) -OffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 28824) -OffRamp_executeSingleReport:test_ReceiverError_Success() (gas: 187737) -OffRamp_executeSingleReport:test_RetryFailedMessageWithoutManualExecution_Revert() (gas: 197869) -OffRamp_executeSingleReport:test_RootNotCommitted_Revert() (gas: 40687) -OffRamp_executeSingleReport:test_RouterYULCall_Revert() (gas: 405083) -OffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain_Success() (gas: 248906) -OffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered_Success() (gas: 192550) -OffRamp_executeSingleReport:test_SingleMessageNoTokens_Success() (gas: 212576) -OffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver_Success() (gas: 243719) -OffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 141570) -OffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 402802) -OffRamp_executeSingleReport:test_SkippedIncorrectNonce_Success() (gas: 58242) -OffRamp_executeSingleReport:test_TokenDataMismatch_Revert() (gas: 73812) -OffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 574696) -OffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 523247) -OffRamp_executeSingleReport:test_UnexpectedTokenData_Revert() (gas: 26795) -OffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 541323) -OffRamp_executeSingleReport:test_Unhealthy_Success() (gas: 541270) -OffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 452360) -OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 135291) -OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 164952) -OffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3905742) -OffRamp_getExecutionState:test_GetDifferentChainExecutionState_Success() (gas: 121048) -OffRamp_getExecutionState:test_GetExecutionState_Success() (gas: 89737) -OffRamp_manuallyExecute:test_ManualExecGasLimitMismatchSingleReport_Revert() (gas: 81694) -OffRamp_manuallyExecute:test_manuallyExecute_DestinationGasAmountCountMismatch_Revert() (gas: 74284) -OffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched_Success() (gas: 172699) -OffRamp_manuallyExecute:test_manuallyExecute_FailedTx_Revert() (gas: 213371) -OffRamp_manuallyExecute:test_manuallyExecute_ForkedChain_Revert() (gas: 27248) -OffRamp_manuallyExecute:test_manuallyExecute_GasLimitMismatchMultipleReports_Revert() (gas: 165935) -OffRamp_manuallyExecute:test_manuallyExecute_InvalidReceiverExecutionGasLimit_Revert() (gas: 27774) -OffRamp_manuallyExecute:test_manuallyExecute_InvalidTokenGasOverride_Revert() (gas: 55362) -OffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit_Success() (gas: 489789) -OffRamp_manuallyExecute:test_manuallyExecute_MultipleReportsWithSingleCursedLane_Revert() (gas: 315041) -OffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails_Success() (gas: 2224914) -OffRamp_manuallyExecute:test_manuallyExecute_SourceChainSelectorMismatch_Revert() (gas: 165390) -OffRamp_manuallyExecute:test_manuallyExecute_Success() (gas: 226281) -OffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride_Success() (gas: 226821) -OffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride_Success() (gas: 775319) -OffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages_Success() (gas: 344966) -OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken_NotACompatiblePool_Revert() (gas: 37652) -OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken_Success() (gas: 101525) -OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_InvalidDataLength_Revert() (gas: 36850) -OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 91490) -OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() (gas: 83578) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens() (gas: 168992) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_RevertWhenInvalidDataLengthReturnData() (gas: 62882) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_RevertWhenPoolDoesNotSupportDest() (gas: 78486) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_WithGasOverride() (gas: 170862) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals() (gas: 182101) -OffRamp_setDynamicConfig:test_FeeQuoterZeroAddress_Revert() (gas: 11465) -OffRamp_setDynamicConfig:test_NonOwner_Revert() (gas: 13975) -OffRamp_setDynamicConfig:test_SetDynamicConfigWithInterceptor_Success() (gas: 47491) -OffRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 25464) -OffRamp_trialExecute:test_trialExecute() (gas: 272039) -OffRamp_trialExecute:test_trialExecute_RateLimitError() (gas: 127605) -OffRamp_trialExecute:test_trialExecute_TokenHandlingErrorIsCaught() (gas: 138915) -OffRamp_trialExecute:test_trialExecute_TokenPoolIsNotAContract() (gas: 289680) -OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 251893) +OffRamp_executeSingleMessage:test_executeSingleMessage_NonContractWithTokens() (gas: 230350) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithMessageInterceptor() (gas: 87432) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens() (gas: 259856) +OffRamp_executeSingleReport:test_InvalidSourcePoolAddress() (gas: 454636) +OffRamp_executeSingleReport:test_ReceiverError() (gas: 180665) +OffRamp_executeSingleReport:test_SingleMessageNoTokens() (gas: 204824) +OffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain() (gas: 241135) +OffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered() (gas: 184833) +OffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver() (gas: 243821) +OffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 134435) +OffRamp_executeSingleReport:test_SkippedIncorrectNonce() (gas: 58298) +OffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes() (gas: 391797) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE() (gas: 561276) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 509640) +OffRamp_executeSingleReport:test_Unhealthy() (gas: 527805) +OffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain() (gas: 438850) +OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessage() (gas: 157823) +OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered() (gas: 128214) +OffRamp_getExecutionState:test_FillExecutionState() (gas: 3905742) +OffRamp_getExecutionState:test_GetDifferentChainExecutionState() (gas: 121049) +OffRamp_getExecutionState:test_GetExecutionState() (gas: 89738) +OffRamp_manuallyExecute:test_manuallyExecute() (gas: 211986) +OffRamp_manuallyExecute:test_manuallyExecute_DoesNotRevertIfUntouched() (gas: 165552) +OffRamp_manuallyExecute:test_manuallyExecute_LowGasLimit() (gas: 475495) +OffRamp_manuallyExecute:test_manuallyExecute_ReentrancyFails() (gas: 2214817) +OffRamp_manuallyExecute:test_manuallyExecute_WithGasOverride() (gas: 212536) +OffRamp_manuallyExecute:test_manuallyExecute_WithMultiReportGasOverride() (gas: 729871) +OffRamp_manuallyExecute:test_manuallyExecute_WithPartialMessages() (gas: 335954) +OffRamp_releaseOrMintSingleToken:test__releaseOrMintSingleToken() (gas: 94597) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens() (gas: 161092) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_WithGasOverride() (gas: 162962) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals() (gas: 174201) +OffRamp_setDynamicConfig:test_SetDynamicConfig() (gas: 25397) +OffRamp_setDynamicConfig:test_SetDynamicConfigWithInterceptor() (gas: 47448) +OffRamp_trialExecute:test_trialExecute() (gas: 263492) +OffRamp_trialExecute:test_trialExecute_RateLimitError() (gas: 120655) +OffRamp_trialExecute:test_trialExecute_TokenHandlingErrorIsCaught() (gas: 131965) +OffRamp_trialExecute:test_trialExecute_TokenPoolIsNotAContract() (gas: 281133) +OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy() (gas: 244196) +OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates() (gas: 325984) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 17227) -OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_Revert() (gas: 67101) -OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_Success() (gas: 325983) -OnRamp_applyDestChainConfigUpdates:test_ApplyDestChainConfigUpdates_Success() (gas: 65892) -OnRamp_applyDestChainConfigUpdates:test_ApplyDestChainConfigUpdates_WithInvalidChainSelector_Revert() (gas: 12902) -OnRamp_constructor:test_Constructor_EnableAllowList_ForwardFromRouter_Reverts() (gas: 2569362) -OnRamp_constructor:test_Constructor_InvalidConfigChainSelectorEqZero_Revert() (gas: 95148) -OnRamp_constructor:test_Constructor_InvalidConfigNonceManagerEqAddressZero_Revert() (gas: 93090) -OnRamp_constructor:test_Constructor_InvalidConfigRMNProxyEqAddressZero_Revert() (gas: 98066) -OnRamp_constructor:test_Constructor_InvalidConfigTokenAdminRegistryEqAddressZero_Revert() (gas: 93146) -OnRamp_constructor:test_Constructor_Success() (gas: 2647459) -OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() (gas: 115432) -OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2_Success() (gas: 146300) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145875) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 144080) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 146072) -OnRamp_forwardFromRouter:test_ForwardFromRouter_Success() (gas: 145470) -OnRamp_forwardFromRouter:test_ForwardFromRouter_Success_ConfigurableSourceRouter() (gas: 140731) -OnRamp_forwardFromRouter:test_InvalidExtraArgsTag_Revert() (gas: 38526) -OnRamp_forwardFromRouter:test_MessageInterceptionError_Revert() (gas: 143112) -OnRamp_forwardFromRouter:test_MesssageFeeTooHigh_Revert() (gas: 36611) -OnRamp_forwardFromRouter:test_MultiCannotSendZeroTokens_Revert() (gas: 36493) -OnRamp_forwardFromRouter:test_OriginalSender_Revert() (gas: 18290) -OnRamp_forwardFromRouter:test_Paused_Revert() (gas: 38412) -OnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 23629) -OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 186715) -OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 213144) -OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 147070) +OnRamp_applyDestChainConfigUpdates:test_ApplyDestChainConfigUpdates() (gas: 65893) +OnRamp_constructor:test_Constructor() (gas: 2647502) +OnRamp_forwardFromRouter:test_ForwardFromRouter() (gas: 145456) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2() (gas: 146263) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue() (gas: 115437) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145859) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 144031) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 146100) +OnRamp_forwardFromRouter:test_ForwardFromRouter_ConfigurableSourceRouter() (gas: 140650) +OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered() (gas: 186736) +OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce() (gas: 213146) +OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 147101) OnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 161303) -OnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 4073863) -OnRamp_forwardFromRouter:test_UnAllowedOriginalSender_Revert() (gas: 24015) -OnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 75854) -OnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 38588) -OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception_Success() (gas: 281529) -OnRamp_getFee:test_EmptyMessage_Success() (gas: 99028) -OnRamp_getFee:test_EnforceOutOfOrder_Revert() (gas: 65475) -OnRamp_getFee:test_GetFeeOfZeroForTokenMessage_Success() (gas: 87287) -OnRamp_getFee:test_NotAFeeTokenButPricedToken_Revert() (gas: 35166) -OnRamp_getFee:test_SingleTokenMessage_Success() (gas: 114201) -OnRamp_getFee:test_Unhealthy_Revert() (gas: 17040) -OnRamp_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10565) -OnRamp_getTokenPool:test_GetTokenPool_Success() (gas: 35405) -OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigFeeAggregatorEqAddressZero_Revert() (gas: 11535) -OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigFeeQuoterEqAddressZero_Revert() (gas: 13194) -OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigInvalidConfig_Revert() (gas: 11499) -OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigOnlyOwner_Revert() (gas: 11938) -OnRamp_setDynamicConfig:test_setDynamicConfig_InvalidConfigReentrancyGuardEnteredEqTrue_Revert() (gas: 13264) -OnRamp_setDynamicConfig:test_setDynamicConfig_Success() (gas: 56440) -OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens_Success() (gas: 125901) -PingPong_ccipReceive:test_CcipReceive_Success() (gas: 172964) -PingPong_setOutOfOrderExecution:test_OutOfOrderExecution_Success() (gas: 20283) -PingPong_setPaused:test_Pausing_Success() (gas: 17738) -PingPong_startPingPong:test_StartPingPong_With_OOO_Success() (gas: 152077) -PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered_Success() (gas: 177692) -RMNHome_getConfigDigests:test_getConfigDigests_success() (gas: 1079685) -RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() (gas: 23879) -RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() (gas: 10597) -RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_OnlyOwner_reverts() (gas: 10843) -RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive_success() (gas: 1085033) -RMNHome_revokeCandidate:test_revokeCandidate_ConfigDigestMismatch_reverts() (gas: 19041) -RMNHome_revokeCandidate:test_revokeCandidate_OnlyOwner_reverts() (gas: 10889) -RMNHome_revokeCandidate:test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() (gas: 10628) -RMNHome_revokeCandidate:test_revokeCandidate_success() (gas: 28147) -RMNHome_setCandidate:test_setCandidate_ConfigDigestMismatch_reverts() (gas: 597564) -RMNHome_setCandidate:test_setCandidate_OnlyOwner_reverts() (gas: 15071) -RMNHome_setCandidate:test_setCandidate_success() (gas: 589330) -RMNHome_setDynamicConfig:test_setDynamicConfig_DigestNotFound_reverts() (gas: 30186) -RMNHome_setDynamicConfig:test_setDynamicConfig_MinObserversTooHigh_reverts() (gas: 18854) -RMNHome_setDynamicConfig:test_setDynamicConfig_OnlyOwner_reverts() (gas: 14009) -RMNHome_setDynamicConfig:test_setDynamicConfig_success() (gas: 104862) -RMNHome_validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_DuplicateOffchainPublicKey_reverts() (gas: 18850) -RMNHome_validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_DuplicatePeerId_reverts() (gas: 18710) -RMNHome_validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_DuplicateSourceChain_reverts() (gas: 20387) -RMNHome_validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_NotEnoughObservers_reverts() (gas: 21405) -RMNHome_validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_OutOfBoundsNodesLength_reverts() (gas: 137318) -RMNHome_validateStaticAndDynamicConfig:test_validateStaticAndDynamicConfig_OutOfBoundsObserverNodeIndex_reverts() (gas: 20522) +OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception() (gas: 274675) +OnRamp_getFee:test_EmptyMessage() (gas: 99075) +OnRamp_getFee:test_GetFeeOfZeroForTokenMessage() (gas: 87199) +OnRamp_getFee:test_SingleTokenMessage() (gas: 114181) +OnRamp_getTokenPool:test_GetTokenPool() (gas: 35382) +OnRamp_setDynamicConfig:test_setDynamicConfig() (gas: 56440) +OnRamp_withdrawFeeTokens:test_WithdrawFeeTokens() (gas: 125834) +PingPong_ccipReceive:test_CcipReceive() (gas: 165875) +PingPong_setOutOfOrderExecution:test_OutOfOrderExecution() (gas: 20350) +PingPong_setPaused:test_Pausing() (gas: 17738) +PingPong_startPingPong:test_StartPingPong_With_OOO() (gas: 144989) +PingPong_startPingPong:test_StartPingPong_With_Sequenced_Ordered() (gas: 170647) +RMNHome_getConfigDigests:test_getConfigDigests() (gas: 1079662) +RMNHome_promoteCandidateAndRevokeActive:test_promoteCandidateAndRevokeActive() (gas: 1085011) +RMNHome_revokeCandidate:test_revokeCandidate() (gas: 28148) +RMNHome_setCandidate:test_setCandidate() (gas: 589307) +RMNHome_setDynamicConfig:test_setDynamicConfig() (gas: 104883) RMNRemote_constructor:test_constructor() (gas: 8398) -RMNRemote_curse:test_curse_AlreadyCursed_duplicateSubject_reverts() (gas: 154501) -RMNRemote_curse:test_curse_calledByNonOwner_reverts() (gas: 18734) -RMNRemote_curse:test_curse_success() (gas: 149475) +RMNRemote_curse:test_curse() (gas: 149452) RMNRemote_global_curses:test_isCursed_globalCurseSubject() (gas: 71715) -RMNRemote_isBlessed:test_isBlessed() (gas: 17588) -RMNRemote_setConfig:test_setConfig_ZeroValueNotAllowed_revert() (gas: 37971) -RMNRemote_setConfig:test_setConfig_addSigner_removeSigner_success() (gas: 993448) -RMNRemote_setConfig:test_setConfig_duplicateOnChainPublicKey_reverts() (gas: 323540) -RMNRemote_setConfig:test_setConfig_invalidSignerOrder_reverts() (gas: 80201) -RMNRemote_setConfig:test_setConfig_notEnoughSigners_reverts() (gas: 54232) -RMNRemote_uncurse:test_uncurse_NotCursed_duplicatedUncurseSubject_reverts() (gas: 51940) -RMNRemote_uncurse:test_uncurse_calledByNonOwner_reverts() (gas: 18615) -RMNRemote_uncurse:test_uncurse_success() (gas: 40135) -RMNRemote_verify_withConfigNotSet:test_verify_reverts() (gas: 13600) -RMNRemote_verify_withConfigSet:test_verify_InvalidSignature_reverts() (gas: 96471) -RMNRemote_verify_withConfigSet:test_verify_OutOfOrderSignatures_duplicateSignature_reverts() (gas: 94289) -RMNRemote_verify_withConfigSet:test_verify_OutOfOrderSignatures_not_sorted_reverts() (gas: 101352) -RMNRemote_verify_withConfigSet:test_verify_ThresholdNotMet_reverts() (gas: 304744) -RMNRemote_verify_withConfigSet:test_verify_UnexpectedSigner_reverts() (gas: 428284) -RMNRemote_verify_withConfigSet:test_verify_success() (gas: 86181) -RateLimiter_constructor:test_Constructor_Success() (gas: 19806) -RateLimiter_consume:test_AggregateValueMaxCapacityExceeded_Revert() (gas: 16042) -RateLimiter_consume:test_AggregateValueRateLimitReached_Revert() (gas: 22435) -RateLimiter_consume:test_ConsumeAggregateValue_Success() (gas: 31495) -RateLimiter_consume:test_ConsumeTokens_Success() (gas: 20403) -RateLimiter_consume:test_ConsumeUnlimited_Success() (gas: 40693) -RateLimiter_consume:test_ConsumingMoreThanUint128_Revert() (gas: 15800) -RateLimiter_consume:test_RateLimitReachedOverConsecutiveBlocks_Revert() (gas: 25781) -RateLimiter_consume:test_Refill_Success() (gas: 37447) -RateLimiter_consume:test_TokenMaxCapacityExceeded_Revert() (gas: 18388) -RateLimiter_consume:test_TokenRateLimitReached_Revert() (gas: 24930) -RateLimiter_currentTokenBucketState:test_CurrentTokenBucketState_Success() (gas: 38947) -RateLimiter_currentTokenBucketState:test_Refill_Success() (gas: 46852) -RateLimiter_setTokenBucketConfig:test_SetRateLimiterConfig_Success() (gas: 38509) -RegistryModuleOwnerCustom_constructor:test_constructor_Revert() (gas: 36107) -RegistryModuleOwnerCustom_registerAccessControlDefaultAdmin:test_registerAccessControlDefaultAdmin_Revert() (gas: 20200) -RegistryModuleOwnerCustom_registerAccessControlDefaultAdmin:test_registerAccessControlDefaultAdmin_Success() (gas: 130631) -RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Revert() (gas: 19797) -RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin_Success() (gas: 130126) -RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Revert() (gas: 19602) -RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Success() (gas: 129930) -Router_applyRampUpdates:test_applyRampUpdates_OffRampUpdatesWithRouting() (gas: 10749731) -Router_applyRampUpdates:test_applyRampUpdates_OnRampDisable() (gas: 56422) -Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 131531) -Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 221794) -Router_ccipSend:test_FeeTokenAmountTooLow_Revert() (gas: 71942) -Router_ccipSend:test_InvalidMsgValue() (gas: 32411) -Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 69608) -Router_ccipSend:test_NativeFeeTokenOverpay_Success() (gas: 193486) -Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 61634) -Router_ccipSend:test_NativeFeeToken_Success() (gas: 192090) -Router_ccipSend:test_NonLinkFeeToken_Success() (gas: 226667) -Router_ccipSend:test_UnsupportedDestinationChain_Revert() (gas: 25056) -Router_ccipSend:test_WhenNotHealthy_Revert() (gas: 45056) -Router_ccipSend:test_WrappedNativeFeeToken_Success() (gas: 194399) -Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 140780) -Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 230978) -Router_constructor:test_Constructor_Success() (gas: 13222) +RMNRemote_isBlessed:test_isBlessed() (gas: 17566) +RMNRemote_setConfig:test_setConfig_addSigner_removeSigner() (gas: 989476) +RMNRemote_uncurse:test_uncurse() (gas: 40154) +RMNRemote_verify_withConfigSet:test_verify() (gas: 86204) +RateLimiter_constructor:test_Constructor() (gas: 19762) +RateLimiter_consume:test_ConsumeAggregateValue() (gas: 31517) +RateLimiter_consume:test_ConsumeTokens() (gas: 20369) +RateLimiter_consume:test_ConsumeUnlimited() (gas: 40717) +RateLimiter_consume:test_Refill() (gas: 37446) +RateLimiter_currentTokenBucketState:test_CurrentTokenBucketState() (gas: 38991) +RateLimiter_currentTokenBucketState:test_Refill() (gas: 46918) +RateLimiter_setTokenBucketConfig:test_SetRateLimiterConfig() (gas: 38510) +RegistryModuleOwnerCustom_registerAccessControlDefaultAdmin:test_registerAccessControlDefaultAdmin() (gas: 130631) +RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetCCIPAdmin() (gas: 130126) +RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner() (gas: 129931) +Router_applyRampUpdates:test_applyRampUpdates_OffRampUpdatesWithRouting() (gas: 10415191) +Router_applyRampUpdates:test_applyRampUpdates_OnRampDisable() (gas: 56424) +Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 124466) +Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 211840) +Router_ccipSend:test_InvalidMsgValue() (gas: 27824) +Router_ccipSend:test_NativeFeeToken() (gas: 185004) +Router_ccipSend:test_NativeFeeTokenInsufficientValue() (gas: 62455) +Router_ccipSend:test_NativeFeeTokenOverpay() (gas: 186421) +Router_ccipSend:test_NativeFeeTokenZeroValue() (gas: 54547) +Router_ccipSend:test_NonLinkFeeToken() (gas: 219603) +Router_ccipSend:test_WrappedNativeFeeToken() (gas: 187239) +Router_ccipSend:test_ccipSend_nativeFeeNoTokenSuccess_gas() (gas: 133627) +Router_ccipSend:test_ccipSend_nativeFeeOneTokenSuccess_gas() (gas: 221045) +Router_constructor:test_Constructor() (gas: 13152) Router_getArmProxy:test_getArmProxy() (gas: 10573) -Router_getFee:test_GetFeeSupportedChain_Success() (gas: 52018) -Router_getFee:test_UnsupportedDestinationChain_Revert() (gas: 17385) -Router_getSupportedTokens:test_GetSupportedTokens_Revert() (gas: 10565) -Router_recoverTokens:test_RecoverTokensInvalidRecipient_Revert() (gas: 11410) -Router_recoverTokens:test_RecoverTokensNoFunds_Revert() (gas: 20199) -Router_recoverTokens:test_RecoverTokensNonOwner_Revert() (gas: 11236) -Router_recoverTokens:test_RecoverTokensValueReceiver_Revert() (gas: 349502) -Router_recoverTokens:test_RecoverTokens_Success() (gas: 52667) -Router_routeMessage:test_routeMessage_AutoExec_Success() (gas: 43213) -Router_routeMessage:test_routeMessage_ExecutionEvent_Success() (gas: 159418) -Router_routeMessage:test_routeMessage_ManualExec_Success() (gas: 35723) -Router_routeMessage:test_routeMessage_OnlyOffRamp_Revert() (gas: 25376) -Router_routeMessage:test_routeMessage_WhenNotHealthy_Revert() (gas: 44812) -Router_setWrappedNative:test_OnlyOwner_Revert() (gas: 11030) -TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole_OnlyPendingAdministrator_Revert() (gas: 51433) -TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole_Success() (gas: 44189) -TokenAdminRegistry_addRegistryModule:test_addRegistryModule_OnlyOwner_Revert() (gas: 12662) -TokenAdminRegistry_addRegistryModule:test_addRegistryModule_Success() (gas: 67155) -TokenAdminRegistry_getAllConfiguredTokens:test_getAllConfiguredTokens_outOfBounds_Success() (gas: 11395) -TokenAdminRegistry_getPool:test_getPool_Success() (gas: 17701) -TokenAdminRegistry_getPools:test_getPools_Success() (gas: 40331) -TokenAdminRegistry_isAdministrator:test_isAdministrator_Success() (gas: 106315) -TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_AlreadyRegistered_Revert() (gas: 104412) -TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_OnlyRegistryModule_Revert() (gas: 15643) -TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_ZeroAddress_Revert() (gas: 15177) -TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_module_Success() (gas: 113094) -TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_owner_Success() (gas: 108031) -TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_reRegisterWhileUnclaimed_Success() (gas: 116216) -TokenAdminRegistry_removeRegistryModule:test_removeRegistryModule_OnlyOwner_Revert() (gas: 12651) -TokenAdminRegistry_removeRegistryModule:test_removeRegistryModule_Success() (gas: 54735) -TokenAdminRegistry_setPool:test_setPool_InvalidTokenPoolToken_Revert() (gas: 19316) -TokenAdminRegistry_setPool:test_setPool_OnlyAdministrator_Revert() (gas: 18170) -TokenAdminRegistry_setPool:test_setPool_Success() (gas: 36267) -TokenAdminRegistry_setPool:test_setPool_ZeroAddressRemovesPool_Success() (gas: 30875) -TokenAdminRegistry_transferAdminRole:test_transferAdminRole_OnlyAdministrator_Revert() (gas: 18202) -TokenAdminRegistry_transferAdminRole:test_transferAdminRole_Success() (gas: 49592) -TokenPoolFactory_constructor:test_constructor_Revert() (gas: 1121653) -TokenPoolFactory_createTokenPool:test_createTokenPoolLockRelease_ExistingToken_predict_Success() (gas: 12612969) -TokenPoolFactory_createTokenPool:test_createTokenPool_BurnFromMintTokenPool_Success() (gas: 6513874) -TokenPoolFactory_createTokenPool:test_createTokenPool_ExistingRemoteToken_AndPredictPool_Success() (gas: 13434268) -TokenPoolFactory_createTokenPool:test_createTokenPool_RemoteTokenHasDifferentDecimals_Success() (gas: 13441570) -TokenPoolFactory_createTokenPool:test_createTokenPool_WithNoExistingRemoteContracts_predict_Success() (gas: 13771048) -TokenPoolFactory_createTokenPool:test_createTokenPool_WithNoExistingTokenOnRemoteChain_Success() (gas: 6301066) -TokenPoolFactory_createTokenPool:test_createTokenPool_WithRemoteTokenAndRemotePool_Success() (gas: 6510314) -TokenPoolWithAllowList_applyAllowListUpdates:test_AllowListNotEnabled_Revert() (gas: 2827849) -TokenPoolWithAllowList_applyAllowListUpdates:test_OnlyOwner_Revert() (gas: 12119) -TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowListSkipsZero_Success() (gas: 23567) -TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowList_Success() (gas: 178398) -TokenPoolWithAllowList_getAllowList:test_GetAllowList_Success() (gas: 23929) -TokenPoolWithAllowList_getAllowListEnabled:test_GetAllowListEnabled_Success() (gas: 8408) -TokenPoolWithAllowList_setRouter:test_SetRouter_Success() (gas: 25005) -TokenPoolWithAllowList_setRouter:test_ZeroAddressNotAllowed_Revert() (gas: 10729) -TokenPool_addRemotePool:test_NonExistentChain_Revert() (gas: 14222) -TokenPool_addRemotePool:test_PoolAlreadyAdded_Revert() (gas: 117205) -TokenPool_addRemotePool:test_ZeroLengthAddressNotAllowed_Revert() (gas: 14014) -TokenPool_addRemotePool:test_addRemotePool_MultipleActive() (gas: 472820) -TokenPool_addRemotePool:test_addRemotePool_Success() (gas: 157095) -TokenPool_applyChainUpdates:test_applyChainUpdates_InvalidRateLimitRate_Revert() (gas: 455575) -TokenPool_applyChainUpdates:test_applyChainUpdates_NonExistentChain_Revert() (gas: 15032) -TokenPool_applyChainUpdates:test_applyChainUpdates_OnlyCallableByOwner_Revert() (gas: 11863) -TokenPool_applyChainUpdates:test_applyChainUpdates_Success() (gas: 592089) -TokenPool_applyChainUpdates:test_applyChainUpdates_UpdatesRemotePoolHashes() (gas: 1077776) -TokenPool_applyChainUpdates:test_applyChainUpdates_ZeroAddressNotAllowed_Revert() (gas: 226472) +Router_getFee:test_GetFeeSupportedChain() (gas: 52018) +Router_recoverTokens:test_RecoverTokens() (gas: 52668) +Router_routeMessage:test_routeMessage_AutoExec() (gas: 38081) +Router_routeMessage:test_routeMessage_ExecutionEvent() (gas: 153711) +Router_routeMessage:test_routeMessage_ManualExec() (gas: 31125) +TokenAdminRegistry_acceptAdminRole:test_acceptAdminRole() (gas: 44224) +TokenAdminRegistry_addRegistryModule:test_addRegistryModule() (gas: 67110) +TokenAdminRegistry_getAllConfiguredTokens:test_getAllConfiguredTokens_outOfBounds() (gas: 11373) +TokenAdminRegistry_getPool:test_getPool() (gas: 17679) +TokenAdminRegistry_getPools:test_getPools() (gas: 40331) +TokenAdminRegistry_isAdministrator:test_isAdministrator() (gas: 106335) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_module() (gas: 113028) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_owner() (gas: 107987) +TokenAdminRegistry_proposeAdministrator:test_proposeAdministrator_reRegisterWhileUnclaimed() (gas: 116195) +TokenAdminRegistry_removeRegistryModule:test_removeRegistryModule() (gas: 54771) +TokenAdminRegistry_setPool:test_setPool() (gas: 36224) +TokenAdminRegistry_setPool:test_setPool_ZeroAddressRemovesPool() (gas: 30852) +TokenAdminRegistry_transferAdminRole:test_transferAdminRole() (gas: 49548) +TokenPoolFactory_createTokenPool:test_createTokenPoolLockRelease_ExistingToken_predict() (gas: 12613002) +TokenPoolFactory_createTokenPool:test_createTokenPool_BurnFromMintTokenPool() (gas: 6513897) +TokenPoolFactory_createTokenPool:test_createTokenPool_ExistingRemoteToken_AndPredictPool() (gas: 13434180) +TokenPoolFactory_createTokenPool:test_createTokenPool_RemoteTokenHasDifferentDecimals() (gas: 13441657) +TokenPoolFactory_createTokenPool:test_createTokenPool_WithNoExistingRemoteContracts_predict() (gas: 13771038) +TokenPoolFactory_createTokenPool:test_createTokenPool_WithNoExistingTokenOnRemoteChain() (gas: 6301092) +TokenPoolFactory_createTokenPool:test_createTokenPool_WithRemoteTokenAndRemotePool() (gas: 6510292) +TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowList() (gas: 178460) +TokenPoolWithAllowList_applyAllowListUpdates:test_SetAllowListSkipsZero() (gas: 23579) +TokenPoolWithAllowList_getAllowList:test_GetAllowList() (gas: 23906) +TokenPoolWithAllowList_getAllowListEnabled:test_GetAllowListEnabled() (gas: 8386) +TokenPoolWithAllowList_setRouter:test_SetRouter() (gas: 24994) +TokenPool_addRemotePool:test_addRemotePool() (gas: 157118) +TokenPool_addRemotePool:test_addRemotePool_MultipleActive() (gas: 453964) +TokenPool_applyChainUpdates:test_applyChainUpdates() (gas: 592143) +TokenPool_applyChainUpdates:test_applyChainUpdates_UpdatesRemotePoolHashes() (gas: 1077758) TokenPool_calculateLocalAmount:test_calculateLocalAmount() (gas: 93680) TokenPool_constructor:test_constructor() (gas: 21930) -TokenPool_constructor:test_constructor_DecimalCallFails() (gas: 2824157) +TokenPool_constructor:test_constructor_DecimalCallFails() (gas: 2824091) TokenPool_getRemotePool:test_getRemotePools() (gas: 330500) -TokenPool_onlyOffRamp:test_CallerIsNotARampOnRouter_Revert() (gas: 21504) -TokenPool_onlyOffRamp:test_ChainNotAllowed_Revert() (gas: 240435) -TokenPool_onlyOffRamp:test_onlyOffRamp_Success() (gas: 94291) -TokenPool_onlyOnRamp:test_CallerIsNotARampOnRouter_Revert() (gas: 21156) -TokenPool_onlyOnRamp:test_ChainNotAllowed_Revert() (gas: 204376) -TokenPool_onlyOnRamp:test_onlyOnRamp_Success() (gas: 49238) +TokenPool_onlyOffRamp:test_onlyOffRamp() (gas: 94344) +TokenPool_onlyOnRamp:test_onlyOnRamp() (gas: 49248) TokenPool_parseRemoteDecimals:test_parseRemoteDecimals() (gas: 14020) -TokenPool_parseRemoteDecimals:test_parseRemoteDecimals_NoDecimalsDefaultsToLocalDecimals() (gas: 9727) -TokenPool_removeRemotePool:test_InvalidRemotePoolForChain_Revert() (gas: 17499) -TokenPool_removeRemotePool:test_NonExistentChain_Revert() (gas: 14344) -TokenPool_removeRemotePool:test_removeRemotePool_Success() (gas: 188387) -TokenPool_setChainRateLimiterConfig:test_NonExistentChain_Revert() (gas: 17214) -TokenPool_setChainRateLimiterConfig:test_OnlyOwnerOrRateLimitAdmin_Revert() (gas: 15307) -TokenPool_setChainRateLimiterConfigs:test_MismatchedArrayLengths_Revert() (gas: 23960) -TokenPool_setChainRateLimiterConfigs:test_NonExistentChain_Revert() (gas: 19424) -TokenPool_setChainRateLimiterConfigs:test_OnlyOwnerOrRateLimitAdmin_Revert() (gas: 16511) -TokenPool_setRateLimitAdmin:test_SetRateLimitAdmin_Revert() (gas: 11002) -TokenPool_setRateLimitAdmin:test_SetRateLimitAdmin_Success() (gas: 37606) -USDCBridgeMigrator_BurnLockedUSDC:test_PrimaryMechanism_Success() (gas: 135887) -USDCBridgeMigrator_BurnLockedUSDC:test_WhileMigrationPause_Revert() (gas: 109751) -USDCBridgeMigrator_BurnLockedUSDC:test_invalidPermissions_Revert() (gas: 39493) -USDCBridgeMigrator_BurnLockedUSDC:test_lockOrBurn_then_BurnInCCTPMigration_Success() (gas: 309833) -USDCBridgeMigrator_BurnLockedUSDC:test_onLockReleaseMechanism_Success() (gas: 146961) -USDCBridgeMigrator_BurnLockedUSDC:test_onLockReleaseMechanism_thenSwitchToPrimary_Success() (gas: 209124) -USDCBridgeMigrator_cancelMigrationProposal:test_cancelExistingCCTPMigrationProposal_Success() (gas: 56155) -USDCBridgeMigrator_cancelMigrationProposal:test_cannotCancelANonExistentMigrationProposal_Revert() (gas: 12669) -USDCBridgeMigrator_excludeTokensFromBurn:test_excludeTokensWhenNoMigrationProposalPending_Revert() (gas: 13579) -USDCBridgeMigrator_proposeMigration:test_ChainNotUsingLockRelease_Revert() (gas: 15765) -USDCBridgeMigrator_provideLiquidity:test_PrimaryMechanism_Success() (gas: 136004) -USDCBridgeMigrator_provideLiquidity:test_WhileMigrationPause_Revert() (gas: 109893) -USDCBridgeMigrator_provideLiquidity:test_cannotModifyLiquidityWithoutPermissions_Revert() (gas: 13390) -USDCBridgeMigrator_provideLiquidity:test_cannotProvideLiquidityWhenMigrationProposalPending_Revert() (gas: 67428) -USDCBridgeMigrator_provideLiquidity:test_cannotProvideLiquidity_AfterMigration_Revert() (gas: 313933) -USDCBridgeMigrator_provideLiquidity:test_invalidPermissions_Revert() (gas: 39493) -USDCBridgeMigrator_provideLiquidity:test_lockOrBurn_then_BurnInCCTPMigration_Success() (gas: 310092) -USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_Success() (gas: 147102) -USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_thenSwitchToPrimary_Success() (gas: 209430) -USDCBridgeMigrator_releaseOrMint:test_OnLockReleaseMechanism_Success() (gas: 213160) -USDCBridgeMigrator_releaseOrMint:test_WhileMigrationPause_Revert() (gas: 109679) -USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 265963) -USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_destChain_Success() (gas: 150538) -USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain_Success() (gas: 511783) -USDCBridgeMigrator_updateChainSelectorMechanism:test_PrimaryMechanism_Success() (gas: 136021) -USDCBridgeMigrator_updateChainSelectorMechanism:test_WhileMigrationPause_Revert() (gas: 109871) -USDCBridgeMigrator_updateChainSelectorMechanism:test_cannotRevertChainMechanism_afterMigration_Revert() (gas: 313532) -USDCBridgeMigrator_updateChainSelectorMechanism:test_invalidPermissions_Revert() (gas: 39471) -USDCBridgeMigrator_updateChainSelectorMechanism:test_lockOrBurn_then_BurnInCCTPMigration_Success() (gas: 310092) -USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism_Success() (gas: 147057) -USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism_thenSwitchToPrimary_Success() (gas: 209483) -USDCTokenPool__validateMessage:test_ValidateInvalidMessage_Revert() (gas: 26049) -USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35319) -USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 29897) -USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133426) -USDCTokenPool_lockOrBurn:test_UnknownDomain_Revert() (gas: 433430) -USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 265695) -USDCTokenPool_releaseOrMint:test_TokenMaxCapacityExceeded_Revert() (gas: 47231) -USDCTokenPool_releaseOrMint:test_UnlockingUSDCFailed_Revert() (gas: 95262) -USDCTokenPool_setDomains:test_InvalidDomain_Revert() (gas: 66437) -USDCTokenPool_setDomains:test_OnlyOwner_Revert() (gas: 11314) -USDCTokenPool_supportsInterface:test_SupportsInterface_Success() (gas: 10107) \ No newline at end of file +TokenPool_parseRemoteDecimals:test_parseRemoteDecimals_NoDecimalsDefaultsToLocalDecimals() (gas: 9705) +TokenPool_removeRemotePool:test_removeRemotePool() (gas: 188409) +TokenPool_setRateLimitAdmin:test_SetRateLimitAdmin() (gas: 37630) +USDCBridgeMigrator_BurnLockedUSDC:test_PrimaryMechanism() (gas: 130340) +USDCBridgeMigrator_BurnLockedUSDC:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303644) +USDCBridgeMigrator_BurnLockedUSDC:test_onLockReleaseMechanism() (gas: 140028) +USDCBridgeMigrator_BurnLockedUSDC:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 202953) +USDCBridgeMigrator_cancelMigrationProposal:test_cancelExistingCCTPMigrationProposal() (gas: 56120) +USDCBridgeMigrator_provideLiquidity:test_PrimaryMechanism() (gas: 130492) +USDCBridgeMigrator_provideLiquidity:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303903) +USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism() (gas: 140213) +USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 203242) +USDCBridgeMigrator_releaseOrMint:test_OnLockReleaseMechanism() (gas: 206260) +USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 260451) +USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_destChain() (gas: 142757) +USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain() (gas: 505539) +USDCBridgeMigrator_updateChainSelectorMechanism:test_PrimaryMechanism() (gas: 130474) +USDCBridgeMigrator_updateChainSelectorMechanism:test_lockOrBurn_then_BurnInCCTPMigration() (gas: 303885) +USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism() (gas: 140213) +USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism_thenSwitchToPrimary() (gas: 203224) +USDCTokenPool_lockOrBurn:test_LockOrBurn() (gas: 127914) +USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx() (gas: 260200) +USDCTokenPool_supportsInterface:test_SupportsInterface() (gas: 10108) \ No newline at end of file diff --git a/contracts/src/v0.8/ccip/rmn/RMNRemote.sol b/contracts/src/v0.8/ccip/rmn/RMNRemote.sol index 83445193ad1..1476b2e1628 100644 --- a/contracts/src/v0.8/ccip/rmn/RMNRemote.sol +++ b/contracts/src/v0.8/ccip/rmn/RMNRemote.sol @@ -94,7 +94,7 @@ contract RMNRemote is Ownable2StepMsgSender, ITypeAndVersion, IRMNRemote, IRMN { /// @inheritdoc IRMNRemote function verify( - address offrampAddress, + address offRampAddress, Internal.MerkleRoot[] calldata merkleRoots, Signature[] calldata signatures ) external view { @@ -110,7 +110,7 @@ contract RMNRemote is Ownable2StepMsgSender, ITypeAndVersion, IRMNRemote, IRMN { destChainId: block.chainid, destChainSelector: i_localChainSelector, rmnRemoteContractAddress: address(this), - offrampAddress: offrampAddress, + offrampAddress: offRampAddress, rmnHomeContractConfigDigest: s_config.rmnHomeContractConfigDigest, merkleRoots: merkleRoots }) diff --git a/contracts/src/v0.8/ccip/test/BaseTest.t.sol b/contracts/src/v0.8/ccip/test/BaseTest.t.sol index 1e9fcdd2fa5..32e144e9d3a 100644 --- a/contracts/src/v0.8/ccip/test/BaseTest.t.sol +++ b/contracts/src/v0.8/ccip/test/BaseTest.t.sol @@ -3,52 +3,37 @@ pragma solidity 0.8.24; // Imports to any non-library are not allowed due to the significant cascading // compile time increase they cause when imported into this base test. - import {IRMNRemote} from "../interfaces/IRMNRemote.sol"; + +import {Router} from "../Router.sol"; import {Internal} from "../libraries/Internal.sol"; import {RateLimiter} from "../libraries/RateLimiter.sol"; -import {MockRMN} from "./mocks/MockRMN.sol"; +import {WETH9} from "./WETH9.sol"; + import {Test} from "forge-std/Test.sol"; contract BaseTest is Test { - // Addresses address internal constant OWNER = 0x00007e64E1fB0C487F25dd6D3601ff6aF8d32e4e; address internal constant STRANGER = address(999999); - address internal constant USER_1 = address(1); + // Timing + uint256 internal constant BLOCK_TIME = 1234567890; + uint32 internal constant TWELVE_HOURS = 60 * 60 * 12; // Message info uint64 internal constant SOURCE_CHAIN_SELECTOR = 1; uint64 internal constant DEST_CHAIN_SELECTOR = 2; uint32 internal constant GAS_LIMIT = 200_000; - // Timing - uint256 internal constant BLOCK_TIME = 1234567890; - uint32 internal constant TWELVE_HOURS = 60 * 60 * 12; - - // Onramp - uint96 internal constant MAX_MSG_FEES_JUELS = 1_000e18; - uint32 internal constant DEST_GAS_OVERHEAD = 300_000; - uint16 internal constant DEST_GAS_PER_PAYLOAD_BYTE = 16; - - uint16 internal constant DEFAULT_TOKEN_FEE_USD_CENTS = 50; uint32 internal constant DEFAULT_TOKEN_DEST_GAS_OVERHEAD = 90_000; - uint32 internal constant DEFAULT_TOKEN_BYTES_OVERHEAD = 32; uint8 internal constant DEFAULT_TOKEN_DECIMALS = 18; + uint16 internal constant GAS_FOR_CALL_EXACT_CHECK = 5_000; bool private s_baseTestInitialized; - // OffRamp - uint32 internal constant MAX_DATA_SIZE = 30_000; - uint16 internal constant MAX_TOKENS_LENGTH = 5; - uint16 internal constant GAS_FOR_CALL_EXACT_CHECK = 5_000; - uint32 internal constant MAX_GAS_LIMIT = 4_000_000; - - MockRMN internal s_mockRMN; IRMNRemote internal s_mockRMNRemote; - - // nonce for pseudo-random number generation, not to be exposed to test suites - uint256 private s_randNonce; + Router internal s_sourceRouter; + Router internal s_destRouter; function setUp() public virtual { // BaseTest.setUp is often called multiple times from tests' setUp due to inheritance. @@ -64,19 +49,18 @@ contract BaseTest is Test { // Set the block time to a constant known value vm.warp(BLOCK_TIME); - // setup mock RMN & RMNRemote - s_mockRMN = new MockRMN(); + // setup RMNRemote s_mockRMNRemote = IRMNRemote(makeAddr("MOCK RMN REMOTE")); vm.etch(address(s_mockRMNRemote), bytes("fake bytecode")); vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); - _setMockRMNGlobalCurse(false); + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed()"), abi.encode(false)); vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(false)); // no curses by defaule - } - function _setMockRMNGlobalCurse( - bool isCursed - ) internal { - vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed()"), abi.encode(isCursed)); + s_sourceRouter = new Router(address(new WETH9()), address(s_mockRMNRemote)); + vm.label(address(s_sourceRouter), "sourceRouter"); + // Deploy a destination router + s_destRouter = new Router(address(new WETH9()), address(s_mockRMNRemote)); + vm.label(address(s_destRouter), "destRouter"); } function _setMockRMNChainCurse(uint64 chainSelector, bool isCursed) internal { @@ -108,18 +92,12 @@ contract BaseTest is Test { return priceUpdates; } - /// @dev returns a pseudo-random bytes32 - function _randomBytes32() internal returns (bytes32) { - return keccak256(abi.encodePacked(++s_randNonce)); - } - - /// @dev returns a pseudo-random number - function _randomNum() internal returns (uint256) { - return uint256(_randomBytes32()); - } - - /// @dev returns a pseudo-random address - function _randomAddress() internal returns (address) { - return address(uint160(_randomNum())); + function _generateSourceTokenData() internal pure returns (Internal.SourceTokenData memory) { + return Internal.SourceTokenData({ + sourcePoolAddress: abi.encode(address(12312412312)), + destTokenAddress: abi.encode(address(9809808909)), + extraData: "", + destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD + }); } } diff --git a/contracts/src/v0.8/ccip/test/NonceManager/NonceManager.applyPreviousRampsUpdates.t.sol b/contracts/src/v0.8/ccip/test/NonceManager/NonceManager.applyPreviousRampsUpdates.t.sol index fe4316423ec..5594b8da995 100644 --- a/contracts/src/v0.8/ccip/test/NonceManager/NonceManager.applyPreviousRampsUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/NonceManager/NonceManager.applyPreviousRampsUpdates.t.sol @@ -5,7 +5,7 @@ import {NonceManager} from "../../NonceManager.sol"; import {OnRampSetup} from "../onRamp/OnRamp/OnRampSetup.t.sol"; contract NonceManager_applyPreviousRampsUpdates is OnRampSetup { - function test_SingleRampUpdate_success() public { + function test_SingleRampUpdate() public { address prevOnRamp = makeAddr("prevOnRamp"); address prevOffRamp = makeAddr("prevOffRamp"); NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); @@ -80,7 +80,7 @@ contract NonceManager_applyPreviousRampsUpdates is OnRampSetup { assertEq(vm.getRecordedLogs().length, 0); } - function test_applyPreviousRampsUpdates_RevertWhen_PreviousRampAlreadySetOnRamp() public { + function test_RevertWhen_applyPreviousRampsUpdatesWhen_PreviousRampAlreadySetOnRamp() public { NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); address prevOnRamp = makeAddr("prevOnRamp"); previousRamps[0] = NonceManager.PreviousRampsArgs({ @@ -101,7 +101,7 @@ contract NonceManager_applyPreviousRampsUpdates is OnRampSetup { s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); } - function test_applyPreviousRampsUpdates_RevertWhen_PreviousRampAlreadySetOffRamp() public { + function test_RevertWhen_applyPreviousRampsUpdatesWhen_PreviousRampAlreadySetOffRamp() public { NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); address prevOffRamp = makeAddr("prevOffRamp"); previousRamps[0] = NonceManager.PreviousRampsArgs({ @@ -122,7 +122,7 @@ contract NonceManager_applyPreviousRampsUpdates is OnRampSetup { s_outboundNonceManager.applyPreviousRampsUpdates(previousRamps); } - function test_applyPreviousRampsUpdates_RevertWhen_PreviousRampAlreadySetOnRampAndOffRamp_Revert() public { + function test_RevertWhen_applyPreviousRampsUpdatesWhen_PreviousRampAlreadySetOnRampAndOffRamp_Revert() public { NonceManager.PreviousRampsArgs[] memory previousRamps = new NonceManager.PreviousRampsArgs[](1); address prevOnRamp = makeAddr("prevOnRamp"); address prevOffRamp = makeAddr("prevOffRamp"); diff --git a/contracts/src/v0.8/ccip/test/TokenSetup.t.sol b/contracts/src/v0.8/ccip/test/TokenSetup.t.sol index db6985c9275..c25d235829d 100644 --- a/contracts/src/v0.8/ccip/test/TokenSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/TokenSetup.t.sol @@ -6,12 +6,12 @@ import {BurnMintTokenPool} from "../pools/BurnMintTokenPool.sol"; import {LockReleaseTokenPool} from "../pools/LockReleaseTokenPool.sol"; import {TokenPool} from "../pools/TokenPool.sol"; import {TokenAdminRegistry} from "../tokenAdminRegistry/TokenAdminRegistry.sol"; +import {BaseTest} from "./BaseTest.t.sol"; import {MaybeRevertingBurnMintTokenPool} from "./helpers/MaybeRevertingBurnMintTokenPool.sol"; -import {RouterSetup} from "./router/Router/RouterSetup.t.sol"; import {IERC20} from "../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; -contract TokenSetup is RouterSetup { +contract TokenSetup is BaseTest { address[] internal s_sourceTokens; address[] internal s_destTokens; @@ -46,7 +46,7 @@ contract TokenSetup is RouterSetup { } LockReleaseTokenPool pool = new LockReleaseTokenPool( - IERC20(token), DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), true, router + IERC20(token), DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), true, router ); if (isSourcePool) { @@ -64,7 +64,7 @@ contract TokenSetup is RouterSetup { } BurnMintTokenPool pool = new MaybeRevertingBurnMintTokenPool( - BurnMintERC20(token), DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), router + BurnMintERC20(token), DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), router ); BurnMintERC20(token).grantMintAndBurnRoles(address(pool)); @@ -77,7 +77,7 @@ contract TokenSetup is RouterSetup { } function setUp() public virtual override { - RouterSetup.setUp(); + super.setUp(); bool isSetup = s_sourceTokens.length != 0; if (isSetup) { diff --git a/contracts/src/v0.8/ccip/test/applications/DefensiveExample/DefensiveExample.t.sol b/contracts/src/v0.8/ccip/test/applications/DefensiveExample/DefensiveExample.t.sol index ddaadbac801..1817476c134 100644 --- a/contracts/src/v0.8/ccip/test/applications/DefensiveExample/DefensiveExample.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/DefensiveExample/DefensiveExample.t.sol @@ -68,7 +68,7 @@ contract DefensiveExampleTest is OnRampSetup { assertEq(IERC20(token).balanceOf(address(s_receiver)), receiverBalancePre - amount); } - function test_HappyPath_Success() public { + function test_HappyPath() public { bytes32 messageId = keccak256("messageId"); address token = address(s_destFeeToken); uint256 amount = 111333333777; diff --git a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipSend.t.sol b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipSend.t.sol index dea42f36098..5f91841ab6e 100644 --- a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipSend.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipSend.t.sol @@ -99,7 +99,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { } } - function test_ccipSend_reverts_insufficientFee_weth() public { + function test_RevertWhen_ccipSends_insufficientFee_weth() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); tokenAmounts[0] = Client.EVMTokenAmount({ token: address(0), // callers may not specify this. @@ -127,7 +127,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { s_etherSenderReceiver.ccipSend{value: AMOUNT}(DESTINATION_CHAIN_SELECTOR, message); } - function test_ccipSend_reverts_insufficientFee_feeToken() public { + function test_RevertWhen_ccipSends_insufficientFee_feeToken() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); tokenAmounts[0] = Client.EVMTokenAmount({ token: address(0), // callers may not specify this. @@ -155,7 +155,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { s_etherSenderReceiver.ccipSend{value: AMOUNT}(DESTINATION_CHAIN_SELECTOR, message); } - function test_ccipSend_reverts_insufficientFee_native() public { + function test_RevertWhen_ccipSends_insufficientFee_native() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); tokenAmounts[0] = Client.EVMTokenAmount({ token: address(0), // callers may not specify this. @@ -181,7 +181,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { s_etherSenderReceiver.ccipSend{value: AMOUNT + FEE_WEI - 1}(DESTINATION_CHAIN_SELECTOR, message); } - function test_ccipSend_success_nativeExcess() public { + function test_ccipSend_nativeExcess() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); tokenAmounts[0] = Client.EVMTokenAmount({ token: address(0), // callers may not specify this. @@ -218,7 +218,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { assertEq(actualMsgId, expectedMsgId, "message id must be correct"); } - function test_ccipSend_success_native() public { + function test_ccipSend_native() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); tokenAmounts[0] = Client.EVMTokenAmount({ token: address(0), // callers may not specify this. @@ -251,7 +251,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { assertEq(actualMsgId, expectedMsgId, "message id must be correct"); } - function test_ccipSend_success_feeToken() public { + function test_ccipSend_feeToken() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); tokenAmounts[0] = Client.EVMTokenAmount({ token: address(0), // callers may not specify this. @@ -287,7 +287,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { assertEq(routerAllowance, FEE_JUELS, "router allowance must be feeJuels"); } - function test_ccipSend_success_weth() public { + function test_ccipSend_weth() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); tokenAmounts[0] = Client.EVMTokenAmount({ token: address(0), // callers may not specify this. diff --git a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validateFeeToken.t.sol b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validateFeeToken.t.sol index ae24ca3deae..29da1a1e068 100644 --- a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validateFeeToken.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validateFeeToken.t.sol @@ -36,7 +36,7 @@ contract EtherSenderReceiverTest_validateFeeToken is EtherSenderReceiverTestSetu s_etherSenderReceiver.validateFeeToken{value: AMOUNT}(message); } - function test_validateFeeToken_reverts_feeToken_tokenAmountNotEqualToMsgValue() public { + function test_RevertWhen_validateFeeTokens_feeToken_tokenAmountNotEqualToMsgValue() public { Client.EVMTokenAmount[] memory tokenAmount = new Client.EVMTokenAmount[](1); tokenAmount[0] = Client.EVMTokenAmount({token: address(s_weth), amount: AMOUNT}); Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ diff --git a/contracts/src/v0.8/ccip/test/applications/ImmutableExample/ImmutableExample.t.sol b/contracts/src/v0.8/ccip/test/applications/ImmutableExample/ImmutableExample.t.sol index 2eb9b736ad4..8cb2cdd97d9 100644 --- a/contracts/src/v0.8/ccip/test/applications/ImmutableExample/ImmutableExample.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/ImmutableExample/ImmutableExample.t.sol @@ -11,7 +11,7 @@ import {ERC165Checker} from "../../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/ERC165Checker.sol"; contract CCIPClientExample_sanity is OnRampSetup { - function test_ImmutableExamples_Success() public { + function test_ImmutableExamples() public { CCIPClientExample exampleContract = new CCIPClientExample(s_sourceRouter, IERC20(s_sourceFeeToken)); deal(address(exampleContract), 100 ether); deal(s_sourceFeeToken, address(exampleContract), 100 ether); diff --git a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.ccipReceive.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.ccipReceive.t.sol index a7559b6dea2..0f010ded627 100644 --- a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.ccipReceive.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.ccipReceive.t.sol @@ -7,7 +7,7 @@ import {Client} from "../../../libraries/Client.sol"; import {PingPongDappSetup} from "./PingPongDappSetup.t.sol"; contract PingPong_ccipReceive is PingPongDappSetup { - function test_CcipReceive_Success() public { + function test_CcipReceive() public { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](0); uint256 pingPongNumber = 5; diff --git a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setOutOfOrderExecution.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setOutOfOrderExecution.t.sol index 0e09e67f7cb..69a8b3fcd4b 100644 --- a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setOutOfOrderExecution.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setOutOfOrderExecution.t.sol @@ -5,7 +5,7 @@ import {PingPongDemo} from "../../../applications/PingPongDemo.sol"; import {PingPongDappSetup} from "./PingPongDappSetup.t.sol"; contract PingPong_setOutOfOrderExecution is PingPongDappSetup { - function test_OutOfOrderExecution_Success() public { + function test_OutOfOrderExecution() public { assertFalse(s_pingPong.getOutOfOrderExecution()); vm.expectEmit(); diff --git a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setPaused.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setPaused.t.sol index 82cd22199ec..fec6a910507 100644 --- a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setPaused.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setPaused.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {PingPongDappSetup} from "./PingPongDappSetup.t.sol"; contract PingPong_setPaused is PingPongDappSetup { - function test_Pausing_Success() public { + function test_Pausing() public { assertFalse(s_pingPong.isPaused()); s_pingPong.setPaused(true); diff --git a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.startPingPong.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.startPingPong.t.sol index d9dfc980154..2aef7f6edfe 100644 --- a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.startPingPong.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.startPingPong.t.sol @@ -10,11 +10,11 @@ import {PingPongDappSetup} from "./PingPongDappSetup.t.sol"; contract PingPong_startPingPong is PingPongDappSetup { uint256 internal s_pingPongNumber = 1; - function test_StartPingPong_With_Sequenced_Ordered_Success() public { + function test_StartPingPong_With_Sequenced_Ordered() public { _assertPingPongSuccess(); } - function test_StartPingPong_With_OOO_Success() public { + function test_StartPingPong_With_OOO() public { s_pingPong.setOutOfOrderExecution(true); _assertPingPongSuccess(); diff --git a/contracts/src/v0.8/ccip/test/attacks/OnRamp/OnRampTokenPoolReentrancy.t.sol b/contracts/src/v0.8/ccip/test/attacks/OnRamp/OnRampTokenPoolReentrancy.t.sol index 54e08a2a5ef..2dd8884ba29 100644 --- a/contracts/src/v0.8/ccip/test/attacks/OnRamp/OnRampTokenPoolReentrancy.t.sol +++ b/contracts/src/v0.8/ccip/test/attacks/OnRamp/OnRampTokenPoolReentrancy.t.sol @@ -29,7 +29,7 @@ contract OnRampTokenPoolReentrancy is OnRampSetup { new FacadeClient(address(s_sourceRouter), DEST_CHAIN_SELECTOR, s_sourceToken, s_feeToken, i_receiver); s_maliciousTokenPool = new ReentrantMaliciousTokenPool( - address(s_facadeClient), s_sourceToken, address(s_mockRMN), address(s_sourceRouter) + address(s_facadeClient), s_sourceToken, address(s_mockRMNRemote), address(s_sourceRouter) ); bytes[] memory remotePoolAddresses = new bytes[](1); @@ -59,7 +59,7 @@ contract OnRampTokenPoolReentrancy is OnRampSetup { /// (reenter)-> Facade -> 2nd call to ccipSend /// In this case, Facade's second call would produce an EVM2Any msg with a lower sequence number. /// The issue was fixed by implementing a reentrancy guard in OnRamp. - function test_OnRampTokenPoolReentrancy_Success() public { + function test_OnRampTokenPoolReentrancy() public { uint256 amount = 1; Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.applyChainConfigUpdates.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.applyChainConfigUpdates.t.sol index 9bf096b9551..8b6a03befaf 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.applyChainConfigUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.applyChainConfigUpdates.t.sol @@ -13,7 +13,7 @@ contract CCIPHome_applyChainConfigUpdates is CCIPHomeTestSetup { s_ccipHome = new CCIPHomeHelper(CAPABILITIES_REGISTRY); } - function test_applyChainConfigUpdates_addChainConfigs_Success() public { + function test_applyChainConfigUpdates_addChainConfigs() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](2); @@ -54,7 +54,7 @@ contract CCIPHome_applyChainConfigUpdates is CCIPHomeTestSetup { assertEq(s_ccipHome.getNumChainConfigurations(), 2, "total chain configs must be 2"); } - function test_getPaginatedCCIPHomes_Success() public { + function test_getPaginatedCCIPHomes() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](2); @@ -106,7 +106,7 @@ contract CCIPHome_applyChainConfigUpdates is CCIPHomeTestSetup { assertEq(configs.length, 0, "chain configs length must be 0"); } - function test_applyChainConfigUpdates_removeChainConfigs_Success() public { + function test_applyChainConfigUpdates_removeChainConfigs() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); @@ -162,7 +162,7 @@ contract CCIPHome_applyChainConfigUpdates is CCIPHomeTestSetup { // Reverts. - function test_applyChainConfigUpdates_selectorNotFound_Reverts() public { + function test_RevertWhen_applyChainConfigUpdates_selectorNotFound() public { uint64[] memory removes = new uint64[](1); removes[0] = uint64(1); @@ -170,7 +170,7 @@ contract CCIPHome_applyChainConfigUpdates is CCIPHomeTestSetup { s_ccipHome.applyChainConfigUpdates(removes, new CCIPHome.ChainConfigArgs[](0)); } - function test_applyChainConfigUpdates_nodeNotInRegistry_Reverts() public { + function test_RevertWhen_applyChainConfigUpdates_nodeNotInRegistry() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](1); @@ -189,7 +189,7 @@ contract CCIPHome_applyChainConfigUpdates is CCIPHomeTestSetup { s_ccipHome.applyChainConfigUpdates(new uint64[](0), adds); } - function test__applyChainConfigUpdates_FChainNotPositive_Reverts() public { + function test_RevertWhen__applyChainConfigUpdates_FChainNotPositive() public { bytes32[] memory chainReaders = new bytes32[](1); chainReaders[0] = keccak256(abi.encode(1)); CCIPHome.ChainConfigArgs[] memory adds = new CCIPHome.ChainConfigArgs[](2); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.beforeCapabilityConfigSet.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.beforeCapabilityConfigSet.t.sol index 090c8336c48..a3ef3c41cda 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.beforeCapabilityConfigSet.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.beforeCapabilityConfigSet.t.sol @@ -13,7 +13,7 @@ contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeTestSetup { vm.startPrank(address(CAPABILITIES_REGISTRY)); } - function test_beforeCapabilityConfigSet_success() public { + function test_beforeCapabilityConfigSet() public { // first set a config bytes memory callData = abi.encodeCall( CCIPHome.setCandidate, @@ -61,7 +61,7 @@ contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeTestSetup { assertEq(activeDigest, newCandidateDigest); } - function test_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall_reverts() public { + function test_RevertWhen_beforeCapabilityConfigSet_OnlyCapabilitiesRegistryCanCall() public { bytes memory callData = abi.encodeCall( CCIPHome.setCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, _getBaseConfig(Internal.OCRPluginType.Commit), ZERO_DIGEST) @@ -74,14 +74,14 @@ contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeTestSetup { s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); } - function test_beforeCapabilityConfigSet_InvalidSelector_reverts() public { + function test_RevertWhen_beforeCapabilityConfigSet_InvalidSelector() public { bytes memory callData = abi.encodeCall(CCIPHome.getConfigDigests, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE)); vm.expectRevert(abi.encodeWithSelector(CCIPHome.InvalidSelector.selector, CCIPHome.getConfigDigests.selector)); s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, DEFAULT_DON_ID); } - function test_beforeCapabilityConfigSet_DONIdMismatch_reverts() public { + function test_RevertWhen_beforeCapabilityConfigSet_DONIdMismatch() public { uint32 wrongDonId = DEFAULT_DON_ID + 1; bytes memory callData = abi.encodeCall( @@ -93,7 +93,7 @@ contract CCIPHome_beforeCapabilityConfigSet is CCIPHomeTestSetup { s_ccipHome.beforeCapabilityConfigSet(new bytes32[](0), callData, 0, wrongDonId); } - function test_beforeCapabilityConfigSet_InnerCallReverts_reverts() public { + function test_RevertWhen_beforeCapabilityConfigSet_InnerCallReverts() public { bytes memory callData = abi.encodeCall(CCIPHome.revokeCandidate, (DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, ZERO_DIGEST)); vm.expectRevert(CCIPHome.RevokingZeroDigestNotAllowed.selector); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.constructor.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.constructor.t.sol index f4c1a777f3d..2760210fda7 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.constructor.t.sol @@ -5,13 +5,13 @@ import {CCIPHome} from "../../../capability/CCIPHome.sol"; import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol"; contract CCIPHome_constructor is CCIPHomeTestSetup { - function test_constructor_success() public { + function test_constructor() public { CCIPHome ccipHome = new CCIPHome(CAPABILITIES_REGISTRY); assertEq(address(ccipHome.getCapabilityRegistry()), CAPABILITIES_REGISTRY); } - function test_constructor_CapabilitiesRegistryAddressZero_reverts() public { + function test_RevertWhen_constructor_CapabilitiesRegistryAddressZero() public { vm.expectRevert(CCIPHome.ZeroAddressNotAllowed.selector); new CCIPHome(address(0)); } diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getAllConfigs.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getAllConfigs.t.sol index 277819e1179..1a8055c8084 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getAllConfigs.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getAllConfigs.t.sol @@ -6,7 +6,7 @@ import {Internal} from "../../../libraries/Internal.sol"; import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol"; contract CCIPHome_getAllConfigs is CCIPHomeTestSetup { - function test_getAllConfigs_success() public { + function test_getAllConfigs() public { CCIPHome.OCR3Config memory config = _getBaseConfig(Internal.OCRPluginType.Commit); bytes32 firstDigest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getCapabilityConfiguration.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getCapabilityConfiguration.t.sol index ea65e111f0d..8af02b83f12 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getCapabilityConfiguration.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getCapabilityConfiguration.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol"; contract CCIPHome_getCapabilityConfiguration is CCIPHomeTestSetup { - function test_getCapabilityConfiguration_success() public view { + function test_getCapabilityConfiguration() public view { bytes memory config = s_ccipHome.getCapabilityConfiguration(DEFAULT_DON_ID); assertEq(config.length, 0); } diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getConfigDigests.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getConfigDigests.t.sol index 8cca6b12589..8ce7910184d 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getConfigDigests.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.getConfigDigests.t.sol @@ -7,7 +7,7 @@ import {Internal} from "../../../libraries/Internal.sol"; import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol"; contract CCIPHome_getConfigDigests is CCIPHomeTestSetup { - function test_getConfigDigests_success() public { + function test_getConfigDigests() public { (bytes32 activeDigest, bytes32 candidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); assertEq(activeDigest, ZERO_DIGEST); assertEq(candidateDigest, ZERO_DIGEST); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.promoteCandidateAndRevokeActive.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.promoteCandidateAndRevokeActive.t.sol index 09f25750ac3..81f7b83e0f4 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.promoteCandidateAndRevokeActive.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.promoteCandidateAndRevokeActive.t.sol @@ -7,7 +7,7 @@ import {Internal} from "../../../libraries/Internal.sol"; import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol"; contract CCIPHome_promoteCandidateAndRevokeActive is CCIPHomeTestSetup { - function test_promoteCandidateAndRevokeActive_multiplePlugins_success() public { + function test_promoteCandidateAndRevokeActive_multiplePlugins() public { promoteCandidateAndRevokeActive(Internal.OCRPluginType.Commit); promoteCandidateAndRevokeActive(Internal.OCRPluginType.Execution); @@ -57,12 +57,12 @@ contract CCIPHome_promoteCandidateAndRevokeActive is CCIPHomeTestSetup { assertEq(keccak256(abi.encode(activeConfig.config)), keccak256(abi.encode(config))); } - function test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() public { + function test_RevertWhen_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed() public { vm.expectRevert(CCIPHome.NoOpStateTransitionNotAllowed.selector); s_ccipHome.promoteCandidateAndRevokeActive(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, ZERO_DIGEST, ZERO_DIGEST); } - function test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() public { + function test_RevertWhen_promoteCandidateAndRevokeActive_ConfigDigestMismatch() public { (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); bytes32 wrongActiveDigest = keccak256("wrongActiveDigest"); @@ -84,7 +84,7 @@ contract CCIPHome_promoteCandidateAndRevokeActive is CCIPHomeTestSetup { ); } - function test_promoteCandidateAndRevokeActive_CanOnlySelfCall_reverts() public { + function test_RevertWhen_promoteCandidateAndRevokeActive_CanOnlySelfCall() public { vm.stopPrank(); vm.expectRevert(CCIPHome.CanOnlySelfCall.selector); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.revokeCandidate.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.revokeCandidate.t.sol index b2793727d59..6712eedef0e 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.revokeCandidate.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.revokeCandidate.t.sol @@ -18,7 +18,7 @@ contract CCIPHome_revokeCandidate is CCIPHomeTestSetup { s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); } - function test_revokeCandidate_success() public { + function test_revokeCandidate() public { (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); @@ -42,7 +42,7 @@ contract CCIPHome_revokeCandidate is CCIPHomeTestSetup { assertTrue(candidateDigest != priorCandidateDigest); } - function test_revokeCandidate_ConfigDigestMismatch_reverts() public { + function test_RevertWhen_revokeCandidate_ConfigDigestMismatch() public { (, bytes32 priorCandidateDigest) = s_ccipHome.getConfigDigests(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE); bytes32 wrongDigest = keccak256("wrong_digest"); @@ -50,12 +50,12 @@ contract CCIPHome_revokeCandidate is CCIPHomeTestSetup { s_ccipHome.revokeCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, wrongDigest); } - function test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() public { + function test_RevertWhen_revokeCandidate_RevokingZeroDigestNotAllowed() public { vm.expectRevert(CCIPHome.RevokingZeroDigestNotAllowed.selector); s_ccipHome.revokeCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, ZERO_DIGEST); } - function test_revokeCandidate_CanOnlySelfCall_reverts() public { + function test_RevertWhen_revokeCandidate_CanOnlySelfCall() public { vm.startPrank(address(0)); vm.expectRevert(CCIPHome.CanOnlySelfCall.selector); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.setCandidate.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.setCandidate.t.sol index 49f365b22cd..f55c4d7f5f2 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.setCandidate.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.setCandidate.t.sol @@ -7,7 +7,7 @@ import {Internal} from "../../../libraries/Internal.sol"; import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol"; contract CCIPHome_setCandidate is CCIPHomeTestSetup { - function test_setCandidate_success() public { + function test_setCandidate() public { CCIPHome.OCR3Config memory config = _getBaseConfig(Internal.OCRPluginType.Commit); CCIPHome.VersionedConfig memory versionedConfig = CCIPHome.VersionedConfig({version: 1, config: config, configDigest: ZERO_DIGEST}); @@ -28,7 +28,7 @@ contract CCIPHome_setCandidate is CCIPHomeTestSetup { assertEq(keccak256(abi.encode(storedVersionedConfig.config)), keccak256(abi.encode(versionedConfig.config))); } - function test_setCandidate_ConfigDigestMismatch_reverts() public { + function test_RevertWhen_setCandidate_ConfigDigestMismatch() public { CCIPHome.OCR3Config memory config = _getBaseConfig(Internal.OCRPluginType.Commit); bytes32 digest = s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, ZERO_DIGEST); @@ -42,7 +42,7 @@ contract CCIPHome_setCandidate is CCIPHomeTestSetup { s_ccipHome.setCandidate(DEFAULT_DON_ID, DEFAULT_PLUGIN_TYPE, config, digest); } - function test_setCandidate_CanOnlySelfCall_reverts() public { + function test_RevertWhen_setCandidate_CanOnlySelfCall() public { vm.stopPrank(); vm.expectRevert(CCIPHome.CanOnlySelfCall.selector); diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.supportsInterface.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.supportsInterface.t.sol index c67f007f735..c26d21cfb05 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.supportsInterface.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.supportsInterface.t.sol @@ -7,7 +7,7 @@ import {IERC165} from "../../../../vendor/openzeppelin-solidity/v5.0.2/contracts import {CCIPHomeTestSetup} from "./CCIPHomeTestSetup.t.sol"; contract CCIPHome_supportsInterface is CCIPHomeTestSetup { - function test_supportsInterface_success() public view { + function test_supportsInterface() public view { assertTrue(s_ccipHome.supportsInterface(type(IERC165).interfaceId)); assertTrue(s_ccipHome.supportsInterface(type(ICapabilityConfiguration).interfaceId)); } diff --git a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.validateConfig.t.sol b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.validateConfig.t.sol index 13c1a0610d7..1f082be2058 100644 --- a/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.validateConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/capability/CCIPHome/CCIPHome.validateConfig.t.sol @@ -96,11 +96,11 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { // Successes. - function test__validateConfig_Success() public { + function test__validateConfig() public { s_ccipHome.validateConfig(_getCorrectOCR3Config()); } - function test__validateConfigLessTransmittersThanSigners_Success() public { + function test__validateConfigLessTransmittersThanSigners() public { // fChain is 1, so there should be at least 4 transmitters. CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(5, 1); config.nodes[1].transmitterKey = bytes(""); @@ -108,7 +108,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfigSmallerFChain_Success() public { + function test__validateConfigSmallerFChain() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(11, 3); // Set fChain to 2 @@ -119,7 +119,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { // Reverts - function test__validateConfig_ChainSelectorNotSet_Reverts() public { + function test_RevertWhen__validateConfig_ChainSelectorNotSet() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.chainSelector = 0; // invalid @@ -127,7 +127,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_OfframpAddressCannotBeZero_Reverts() public { + function test_RevertWhen__validateConfig_OfframpAddressCannotBeZero() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.offrampAddress = ""; // invalid @@ -135,7 +135,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero_Reverts() public { + function test_RevertWhen__validateConfig_ABIEncodedAddress_OfframpAddressCannotBeZero() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.offrampAddress = abi.encode(address(0)); // invalid @@ -143,7 +143,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_RMNHomeAddressCannotBeZero_Reverts() public { + function test_RevertWhen__validateConfig_RMNHomeAddressCannotBeZero() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.rmnHomeAddress = ""; // invalid @@ -151,7 +151,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_ABIEncodedAddress_RMNHomeAddressCannotBeZero_Reverts() public { + function test_RevertWhen__validateConfig_ABIEncodedAddress_RMNHomeAddressCannotBeZero() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.rmnHomeAddress = abi.encode(address(0)); // invalid @@ -159,7 +159,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_ChainSelectorNotFound_Reverts() public { + function test_RevertWhen__validateConfig_ChainSelectorNotFound() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.chainSelector = 2; // not set @@ -167,7 +167,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_NotEnoughTransmitters_Reverts() public { + function test_RevertWhen__validateConfig_NotEnoughTransmitters() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); uint256 numberOfTransmitters = 3; @@ -185,7 +185,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_NotEnoughTransmittersEmptyAddresses_Reverts() public { + function test_RevertWhen__validateConfig_NotEnoughTransmittersEmptyAddresses() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes[0].transmitterKey = bytes(""); @@ -201,7 +201,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_TooManySigners_Reverts() public { + function test_RevertWhen__validateConfig_TooManySigners() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes = new CCIPHome.OCR3Node[](257); @@ -209,7 +209,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_FChainTooHigh_Reverts() public { + function test_RevertWhen__validateConfig_FChainTooHigh() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.FRoleDON = 2; // too low @@ -220,7 +220,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_FMustBePositive_Reverts() public { + function test_RevertWhen__validateConfig_FMustBePositive() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.FRoleDON = 0; // not positive @@ -228,7 +228,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_FTooHigh_Reverts() public { + function test_RevertWhen__validateConfig_FTooHigh() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.FRoleDON = 2; // too high @@ -236,7 +236,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_ZeroP2PId_Reverts() public { + function test_RevertWhen__validateConfig_ZeroP2PId() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes[1].p2pId = bytes32(0); @@ -244,7 +244,7 @@ contract CCIPHome__validateConfig is CCIPHomeTestSetup { s_ccipHome.validateConfig(config); } - function test__validateConfig_ZeroSignerKey_Reverts() public { + function test_RevertWhen__validateConfig_ZeroSignerKey() public { CCIPHome.OCR3Config memory config = _getCorrectOCR3Config(); config.nodes[2].signerKey = bytes(""); diff --git a/contracts/src/v0.8/ccip/test/e2e/End2End.t.sol b/contracts/src/v0.8/ccip/test/e2e/End2End.t.sol index 282784755dd..f93a5f4445e 100644 --- a/contracts/src/v0.8/ccip/test/e2e/End2End.t.sol +++ b/contracts/src/v0.8/ccip/test/e2e/End2End.t.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.24; -import {IRMN} from "../../interfaces/IRMN.sol"; import {IRMNRemote} from "../../interfaces/IRMNRemote.sol"; import {AuthorizedCallers} from "../../../shared/access/AuthorizedCallers.sol"; @@ -45,7 +44,7 @@ contract E2E is OnRampSetup, OffRampSetup { OffRampSetup.setUp(); // Deploy new source router for the new source chain - s_sourceRouter2 = new Router(s_sourceRouter.getWrappedNative(), address(s_mockRMN)); + s_sourceRouter2 = new Router(s_sourceRouter.getWrappedNative(), address(s_mockRMNRemote)); // Deploy new TokenAdminRegistry for the new source chain s_tokenAdminRegistry2 = new TokenAdminRegistry(); @@ -55,7 +54,12 @@ contract E2E is OnRampSetup, OffRampSetup { address token = s_sourceTokens[i]; address pool = address( new LockReleaseTokenPool( - IERC20(token), DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), true, address(s_sourceRouter2) + IERC20(token), + DEFAULT_TOKEN_DECIMALS, + new address[](0), + address(s_mockRMNRemote), + true, + address(s_sourceRouter2) ) ); @@ -78,7 +82,7 @@ contract E2E is OnRampSetup, OffRampSetup { s_nonceManager2 = new NonceManager(new address[](0)); ( - // Deploy the new source chain onramp + // Deploy the new source chain onRamp // Outsource to shared helper function with OnRampSetup s_onRamp2, s_metadataHash2 @@ -97,10 +101,10 @@ contract E2E is OnRampSetup, OffRampSetup { onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: address(s_onRamp2)}); s_sourceRouter2.applyRampUpdates(onRampUpdates, new Router.OffRamp[](0), new Router.OffRamp[](0)); - // Deploy offramp + // Deploy offRamp _deployOffRamp(s_mockRMNRemote, s_inboundNonceManager); - // Enable source chains on offramp + // Enable source chains on offRamp OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](2); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -162,7 +166,7 @@ contract E2E is OnRampSetup, OffRampSetup { merkleRoots[0] = MerkleHelper.getMerkleRoot(hashedMessages1); merkleRoots[1] = MerkleHelper.getMerkleRoot(hashedMessages2); - // TODO make these real sigs :) + // TODO make these real sigs IRMNRemote.Signature[] memory rmnSignatures = new IRMNRemote.Signature[](0); Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](2); @@ -191,9 +195,6 @@ contract E2E is OnRampSetup, OffRampSetup { // Scoped to RMN and verify to reduce stack pressure { - s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(s_offRamp), root: merkleRoots[0]}), true); - s_mockRMN.setTaggedRootBlessed(IRMN.TaggedRoot({commitStore: address(s_offRamp), root: merkleRoots[1]}), true); - bytes32[] memory proofs = new bytes32[](0); bytes32[] memory hashedLeaves = new bytes32[](1); hashedLeaves[0] = merkleRoots[0]; diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol index b663151a96c..3853c84ccc9 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyDestChainConfigUpdates.t.sol @@ -38,7 +38,7 @@ contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { ); } - function test_applyDestChainConfigUpdates_Success() public { + function test_applyDestChainConfigUpdates() public { FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](2); destChainConfigArgs[0] = _generateFeeQuoterDestChainConfigArgs()[0]; destChainConfigArgs[0].destChainConfig.isEnabled = false; @@ -61,7 +61,7 @@ contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { _assertFeeQuoterDestChainConfigsEqual(destChainConfigArgs[1].destChainConfig, gotDestChainConfig1); } - function test_applyDestChainConfigUpdatesZeroInput_Success() public { + function test_applyDestChainConfigUpdatesZeroInput() public { FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](0); vm.recordLogs(); @@ -72,7 +72,7 @@ contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { // Reverts - function test_applyDestChainConfigUpdatesDefaultTxGasLimitEqZero_Revert() public { + function test_RevertWhen_applyDestChainConfigUpdatesDefaultTxGasLimitEqZero() public { FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; @@ -83,7 +83,7 @@ contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); } - function test_applyDestChainConfigUpdatesDefaultTxGasLimitGtMaxPerMessageGasLimit_Revert() public { + function test_RevertWhen_applyDestChainConfigUpdatesDefaultTxGasLimitGtMaxPerMessageGasLimit() public { FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; @@ -99,7 +99,7 @@ contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); } - function test_InvalidDestChainConfigDestChainSelectorEqZero_Revert() public { + function test_RevertWhen_InvalidDestChainConfigDestChainSelectorEqZero() public { FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; @@ -110,7 +110,7 @@ contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { s_feeQuoter.applyDestChainConfigUpdates(destChainConfigArgs); } - function test_InvalidChainFamilySelector_Revert() public { + function test_RevertWhen_InvalidChainFamilySelector() public { FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); FeeQuoter.DestChainConfigArgs memory destChainConfigArg = destChainConfigArgs[0]; diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyFeeTokensUpdates.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyFeeTokensUpdates.t.sol index a32e50bb3e4..70aedd696d2 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyFeeTokensUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyFeeTokensUpdates.t.sol @@ -6,7 +6,7 @@ import {FeeQuoter} from "../../FeeQuoter.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_applyFeeTokensUpdates is FeeQuoterSetup { - function test_ApplyFeeTokensUpdates_Success() public { + function test_ApplyFeeTokensUpdates() public { address[] memory feeTokens = new address[](1); feeTokens[0] = s_sourceTokens[1]; @@ -48,7 +48,7 @@ contract FeeQuoter_applyFeeTokensUpdates is FeeQuoterSetup { s_feeQuoter.applyFeeTokensUpdates(feeTokens, feeTokens); } - function test_OnlyCallableByOwner_Revert() public { + function test_RevertWhen_OnlyCallableByOwner() public { vm.startPrank(STRANGER); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyPremiumMultiplierWeiPerEthUpdates.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyPremiumMultiplierWeiPerEthUpdates.t.sol index 67b1ed9ae92..06695f126a4 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyPremiumMultiplierWeiPerEthUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyPremiumMultiplierWeiPerEthUpdates.t.sol @@ -26,7 +26,7 @@ contract FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates is FeeQuoterSetup { ); } - function test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken_Success() public { + function test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken() public { FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs = new FeeQuoter.PremiumMultiplierWeiPerEthArgs[](1); premiumMultiplierWeiPerEthArgs[0] = s_feeQuoterPremiumMultiplierWeiPerEthArgs[0]; @@ -45,7 +45,7 @@ contract FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates is FeeQuoterSetup { ); } - function test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens_Success() public { + function test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens() public { FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs = new FeeQuoter.PremiumMultiplierWeiPerEthArgs[](2); premiumMultiplierWeiPerEthArgs[0] = s_feeQuoterPremiumMultiplierWeiPerEthArgs[0]; @@ -82,7 +82,7 @@ contract FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates is FeeQuoterSetup { // Reverts - function test_OnlyCallableByOwnerOrAdmin_Revert() public { + function test_RevertWhen_OnlyCallableByOwnerOrAdmin() public { FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs; vm.startPrank(STRANGER); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyTokenTransferFeeConfigUpdates.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyTokenTransferFeeConfigUpdates.t.sol index 711374a2441..68707d39858 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyTokenTransferFeeConfigUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.applyTokenTransferFeeConfigUpdates.t.sol @@ -59,7 +59,7 @@ contract FeeQuoter_applyTokenTransferFeeConfigUpdates is FeeQuoterSetup { } } - function test_ApplyTokenTransferFeeConfig_Success() public { + function test_ApplyTokenTransferFeeConfig() public { FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 2); tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = address(5); @@ -152,7 +152,7 @@ contract FeeQuoter_applyTokenTransferFeeConfigUpdates is FeeQuoterSetup { // Reverts - function test_OnlyCallableByOwnerOrAdmin_Revert() public { + function test_RevertWhen_OnlyCallableByOwnerOrAdmin() public { vm.startPrank(STRANGER); FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs; @@ -163,7 +163,7 @@ contract FeeQuoter_applyTokenTransferFeeConfigUpdates is FeeQuoterSetup { ); } - function test_InvalidDestBytesOverhead_Revert() public { + function test_RevertWhen_InvalidDestBytesOverhead() public { FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 1); tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = address(5); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.constructor.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.constructor.t.sol index c2d36bee96d..ee7aaa87175 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.constructor.t.sol @@ -6,7 +6,7 @@ import {FeeQuoterHelper} from "../helpers/FeeQuoterHelper.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_constructor is FeeQuoterSetup { - function test_Setup_Success() public virtual { + function test_Setup() public virtual { address[] memory priceUpdaters = new address[](2); priceUpdaters[0] = STRANGER; priceUpdaters[1] = OWNER; @@ -78,7 +78,7 @@ contract FeeQuoter_constructor is FeeQuoterSetup { } } - function test_InvalidStalenessThreshold_Revert() public { + function test_RevertWhen_InvalidStalenessThreshold() public { FeeQuoter.StaticConfig memory staticConfig = FeeQuoter.StaticConfig({ linkToken: s_sourceTokens[0], maxFeeJuelsPerMsg: MAX_MSG_FEES_JUELS, @@ -98,7 +98,7 @@ contract FeeQuoter_constructor is FeeQuoterSetup { ); } - function test_InvalidLinkTokenEqZeroAddress_Revert() public { + function test_RevertWhen_InvalidLinkTokenEqZeroAddress() public { FeeQuoter.StaticConfig memory staticConfig = FeeQuoter.StaticConfig({ linkToken: address(0), maxFeeJuelsPerMsg: MAX_MSG_FEES_JUELS, @@ -118,7 +118,7 @@ contract FeeQuoter_constructor is FeeQuoterSetup { ); } - function test_InvalidMaxFeeJuelsPerMsg_Revert() public { + function test_RevertWhen_InvalidMaxFeeJuelsPerMsg() public { FeeQuoter.StaticConfig memory staticConfig = FeeQuoter.StaticConfig({ linkToken: s_sourceTokens[0], maxFeeJuelsPerMsg: 0, diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.convertTokenAmount.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.convertTokenAmount.t.sol index 33e941cfbe3..bd7e9ecc841 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.convertTokenAmount.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.convertTokenAmount.t.sol @@ -6,7 +6,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_convertTokenAmount is FeeQuoterSetup { - function test_ConvertTokenAmount_Success() public view { + function test_ConvertTokenAmount() public view { Internal.PriceUpdates memory initialPriceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); uint256 amount = 3e16; uint256 conversionRate = (uint256(initialPriceUpdates.tokenPriceUpdates[2].usdPerToken) * 1e18) @@ -50,7 +50,7 @@ contract FeeQuoter_convertTokenAmount is FeeQuoterSetup { // Reverts - function test_LinkTokenNotSupported_Revert() public { + function test_RevertWhen_LinkTokenNotSupported() public { vm.expectRevert(abi.encodeWithSelector(FeeQuoter.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); s_feeQuoter.convertTokenAmount(DUMMY_CONTRACT_ADDRESS, 3e16, s_sourceTokens[0]); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getDataAvailabilityCost.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getDataAvailabilityCost.t.sol index 6f2566ac754..321ba0d9896 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getDataAvailabilityCost.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getDataAvailabilityCost.t.sol @@ -6,7 +6,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_getDataAvailabilityCost is FeeQuoterSetup { - function test_EmptyMessageCalculatesDataAvailabilityCost_Success() public { + function test_EmptyMessageCalculatesDataAvailabilityCost() public { uint256 dataAvailabilityCostUSD = s_feeQuoter.getDataAvailabilityCost(DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, 0, 0, 0); @@ -42,7 +42,7 @@ contract FeeQuoter_getDataAvailabilityCost is FeeQuoterSetup { assertFalse(dataAvailabilityCostUSD == dataAvailabilityCostUSD2); } - function test_SimpleMessageCalculatesDataAvailabilityCost_Success() public view { + function test_SimpleMessageCalculatesDataAvailabilityCost() public view { uint256 dataAvailabilityCostUSD = s_feeQuoter.getDataAvailabilityCost(DEST_CHAIN_SELECTOR, USD_PER_DATA_AVAILABILITY_GAS, 100, 5, 50); @@ -58,7 +58,7 @@ contract FeeQuoter_getDataAvailabilityCost is FeeQuoterSetup { assertEq(expectedDataAvailabilityCostUSD, dataAvailabilityCostUSD); } - function test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() public view { + function test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector() public view { uint256 dataAvailabilityCostUSD = s_feeQuoter.getDataAvailabilityCost(0, USD_PER_DATA_AVAILABILITY_GAS, 100, 5, 50); assertEq(dataAvailabilityCostUSD, 0); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenAndGasPrices.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenAndGasPrices.t.sol index 18ccf5efa79..443cc796af6 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenAndGasPrices.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenAndGasPrices.t.sol @@ -6,7 +6,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_getTokenAndGasPrices is FeeQuoterSetup { - function test_GetFeeTokenAndGasPrices_Success() public view { + function test_GetFeeTokenAndGasPrices() public view { (uint224 feeTokenPrice, uint224 gasPrice) = s_feeQuoter.getTokenAndGasPrices(s_sourceFeeToken, DEST_CHAIN_SELECTOR); Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); @@ -15,7 +15,7 @@ contract FeeQuoter_getTokenAndGasPrices is FeeQuoterSetup { assertEq(gasPrice, priceUpdates.gasPriceUpdates[0].usdPerUnitGas); } - function test_StalenessCheckDisabled_Success() public { + function test_StalenessCheckDisabled() public { uint64 neverStaleChainSelector = 345678; FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); destChainConfigArgs[0].destChainSelector = neverStaleChainSelector; @@ -38,7 +38,7 @@ contract FeeQuoter_getTokenAndGasPrices is FeeQuoterSetup { assertEq(gasPrice, 999); } - function test_ZeroGasPrice_Success() public { + function test_ZeroGasPrice() public { uint64 zeroGasDestChainSelector = 345678; FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = _generateFeeQuoterDestChainConfigArgs(); destChainConfigArgs[0].destChainSelector = zeroGasDestChainSelector; @@ -56,12 +56,12 @@ contract FeeQuoter_getTokenAndGasPrices is FeeQuoterSetup { assertEq(gasPrice, 0); } - function test_UnsupportedChain_Revert() public { + function test_RevertWhen_UnsupportedChain() public { vm.expectRevert(abi.encodeWithSelector(FeeQuoter.DestinationChainNotEnabled.selector, DEST_CHAIN_SELECTOR + 1)); s_feeQuoter.getTokenAndGasPrices(s_sourceTokens[0], DEST_CHAIN_SELECTOR + 1); } - function test_StaleGasPrice_Revert() public { + function test_RevertWhen_StaleGasPrice() public { uint256 diff = TWELVE_HOURS + 1; vm.warp(block.timestamp + diff); vm.expectRevert(abi.encodeWithSelector(FeeQuoter.StaleGasPrice.selector, DEST_CHAIN_SELECTOR, TWELVE_HOURS, diff)); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol index c00e750d27f..e55837179f0 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrice.t.sol @@ -7,7 +7,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_getTokenPrice is FeeQuoterSetup { - function test_GetTokenPriceFromFeed_Success() public { + function test_GetTokenPriceFromFeed() public { uint256 originalTimestampValue = block.timestamp; // Above staleness threshold @@ -24,7 +24,7 @@ contract FeeQuoter_getTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer.timestamp, uint32(originalTimestampValue)); } - function test_GetTokenPrice_LocalMoreRecent_Success() public { + function test_GetTokenPrice_LocalMoreRecent() public { uint256 originalTimestampValue = block.timestamp; Internal.PriceUpdates memory update = Internal.PriceUpdates({ diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrices.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrices.t.sol index 63f936332fd..f8db9898934 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrices.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenPrices.t.sol @@ -5,7 +5,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_getTokenPrices is FeeQuoterSetup { - function test_GetTokenPrices_Success() public view { + function test_GetTokenPrices() public view { Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); address[] memory tokens = new address[](3); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenTransferCost.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenTransferCost.t.sol index 9f0aa9440b8..1da33309659 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenTransferCost.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getTokenTransferCost.t.sol @@ -12,7 +12,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { address internal s_selfServeTokenDefaultPricing = makeAddr("self-serve-token-default-pricing"); - function test_NoTokenTransferChargesZeroFee_Success() public view { + function test_NoTokenTransferChargesZeroFee() public view { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); (uint256 feeUSDWei, uint32 destGasOverhead, uint32 destBytesOverhead) = s_feeQuoter.getTokenTransferCost(DEST_CHAIN_SELECTOR, message.feeToken, s_feeTokenPrice, message.tokenAmounts); @@ -22,7 +22,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(0, destBytesOverhead); } - function test_getTokenTransferCost_selfServeUsesDefaults_Success() public view { + function test_getTokenTransferCost_selfServeUsesDefaults() public view { Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_selfServeTokenDefaultPricing, 1000); // Get config to assert it isn't set @@ -40,7 +40,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(DEFAULT_TOKEN_BYTES_OVERHEAD, destBytesOverhead); } - function test_SmallTokenTransferChargesMinFeeAndGas_Success() public view { + function test_SmallTokenTransferChargesMinFeeAndGas() public view { Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1000); FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); @@ -53,7 +53,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); } - function test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() public view { + function test_ZeroAmountTokenTransferChargesMinFeeAndGas() public view { Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 0); FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); @@ -66,7 +66,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); } - function test_LargeTokenTransferChargesMaxFeeAndGas_Success() public view { + function test_LargeTokenTransferChargesMaxFeeAndGas() public view { Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, 1e36); FeeQuoter.TokenTransferFeeConfig memory transferFeeConfig = s_feeQuoter.getTokenTransferFeeConfig(DEST_CHAIN_SELECTOR, message.tokenAmounts[0].token); @@ -79,7 +79,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); } - function test_FeeTokenBpsFee_Success() public view { + function test_FeeTokenBpsFee() public view { uint256 tokenAmount = 10000e18; Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(s_sourceFeeToken, tokenAmount); @@ -99,7 +99,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); } - function test_CustomTokenBpsFee_Success() public view { + function test_CustomTokenBpsFee() public view { uint256 tokenAmount = 200000e18; Client.EVM2AnyMessage memory message = Client.EVM2AnyMessage({ @@ -127,7 +127,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(transferFeeConfig.destBytesOverhead, destBytesOverhead); } - function test_ZeroFeeConfigChargesMinFee_Success() public { + function test_ZeroFeeConfigChargesMinFee() public { FeeQuoter.TokenTransferFeeConfigArgs[] memory tokenTransferFeeConfigArgs = _generateTokenTransferFeeConfigArgs(1, 1); tokenTransferFeeConfigArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; tokenTransferFeeConfigArgs[0].tokenTransferFeeConfigs[0].token = s_sourceFeeToken; @@ -185,7 +185,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(bytesOverheadMultiple, bytesOverheadSingle * transfers); } - function test_MixedTokenTransferFee_Success() public view { + function test_MixedTokenTransferFee() public view { address[3] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative(), CUSTOM_TOKEN]; uint224[3] memory tokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice, CUSTOM_TOKEN_PRICE]; FeeQuoter.TokenTransferFeeConfig[3] memory tokenTransferFeeConfigs = [ diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol index c8912b38e74..5d27d74e44f 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedFee.t.sol @@ -11,7 +11,7 @@ import {FeeQuoterFeeSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { using USDPriceWith18Decimals for uint224; - function test_EmptyMessage_Success() public view { + function test_EmptyMessage() public view { address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; @@ -35,7 +35,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { } } - function test_ZeroDataAvailabilityMultiplier_Success() public { + function test_ZeroDataAvailabilityMultiplier() public { FeeQuoter.DestChainConfigArgs[] memory destChainConfigArgs = new FeeQuoter.DestChainConfigArgs[](1); FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); destChainConfigArgs[0] = @@ -56,7 +56,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { assertEq(totalPriceInFeeToken, feeAmount); } - function test_HighGasMessage_Success() public view { + function test_HighGasMessage() public view { address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; @@ -87,7 +87,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { } } - function test_SingleTokenMessage_Success() public view { + function test_SingleTokenMessage() public view { address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; @@ -122,7 +122,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { } } - function test_MessageWithDataAndTokenTransfer_Success() public view { + function test_MessageWithDataAndTokenTransfer() public view { address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; @@ -203,12 +203,12 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { // Reverts - function test_DestinationChainNotEnabled_Revert() public { + function test_RevertWhen_DestinationChainNotEnabled() public { vm.expectRevert(abi.encodeWithSelector(FeeQuoter.DestinationChainNotEnabled.selector, DEST_CHAIN_SELECTOR + 1)); s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR + 1, _generateEmptyMessage()); } - function test_EnforceOutOfOrder_Revert() public { + function test_RevertWhen_EnforceOutOfOrder() public { // Update config to enforce allowOutOfOrderExecution = true. vm.stopPrank(); vm.startPrank(OWNER); @@ -226,7 +226,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); } - function test_MessageTooLarge_Revert() public { + function test_RevertWhen_MessageTooLarge() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.data = new bytes(MAX_DATA_SIZE + 1); vm.expectRevert(abi.encodeWithSelector(FeeQuoter.MessageTooLarge.selector, MAX_DATA_SIZE, message.data.length)); @@ -234,7 +234,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); } - function test_TooManyTokens_Revert() public { + function test_RevertWhen_TooManyTokens() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); uint256 tooMany = MAX_TOKENS_LENGTH + 1; message.tokenAmounts = new Client.EVMTokenAmount[](tooMany); @@ -243,14 +243,14 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { } // Asserts gasLimit must be <=maxGasLimit - function test_MessageGasLimitTooHigh_Revert() public { + function test_RevertWhen_MessageGasLimitTooHigh() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: MAX_GAS_LIMIT + 1})); vm.expectRevert(abi.encodeWithSelector(FeeQuoter.MessageGasLimitTooHigh.selector)); s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); } - function test_NotAFeeToken_Revert() public { + function test_RevertWhen_NotAFeeToken() public { address notAFeeToken = address(0x111111); Client.EVM2AnyMessage memory message = _generateSingleTokenMessage(notAFeeToken, 1); message.feeToken = notAFeeToken; @@ -260,7 +260,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { s_feeQuoter.getValidatedFee(DEST_CHAIN_SELECTOR, message); } - function test_InvalidEVMAddress_Revert() public { + function test_RevertWhen_InvalidEVMAddress() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.receiver = abi.encode(type(uint208).max); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol index 6d508bc9116..9e2b4f7366f 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.getValidatedTokenPrice.t.sol @@ -7,7 +7,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { - function test_GetValidatedTokenPrice_Success() public view { + function test_GetValidatedTokenPrice() public view { Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); address token = priceUpdates.tokenPriceUpdates[0].sourceToken; @@ -16,7 +16,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(priceUpdates.tokenPriceUpdates[0].usdPerToken, tokenPrice); } - function test_GetValidatedTokenPriceFromFeed_Success() public { + function test_GetValidatedTokenPriceFromFeed() public { uint256 originalTimestampValue = block.timestamp; // Right below staleness threshold @@ -29,7 +29,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(1e18)); } - function test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() public { + function test_GetValidatedTokenPriceFromFeedOverStalenessPeriod() public { uint256 originalTimestampValue = block.timestamp; // Right above staleness threshold @@ -42,7 +42,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(1e18)); } - function test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() public { + function test_GetValidatedTokenPriceFromFeedMaxInt224Value() public { address tokenAddress = _deploySourceToken("testToken", 0, 18); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, int256(uint256(type(uint224).max))); @@ -56,7 +56,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(type(uint224).max)); } - function test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() public { + function test_GetValidatedTokenPriceFromFeedErc20Below18Decimals() public { address tokenAddress = _deploySourceToken("testToken", 0, 6); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 8, 1e8); @@ -70,7 +70,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(1e30)); } - function test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() public { + function test_GetValidatedTokenPriceFromFeedErc20Above18Decimals() public { address tokenAddress = _deploySourceToken("testToken", 0, 24); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 8, 1e8); @@ -84,7 +84,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(1e12)); } - function test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() public { + function test_GetValidatedTokenPriceFromFeedFeedAt18Decimals() public { address tokenAddress = _deploySourceToken("testToken", 0, 18); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, 1e18); @@ -98,7 +98,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(1e18)); } - function test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() public { + function test_GetValidatedTokenPriceFromFeedFeedAt0Decimals() public { address tokenAddress = _deploySourceToken("testToken", 0, 0); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 0, 1e31); @@ -112,7 +112,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(1e67)); } - function test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() public { + function test_GetValidatedTokenPriceFromFeedFlippedDecimals() public { address tokenAddress = _deploySourceToken("testToken", 0, 20); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 20, 1e18); @@ -126,7 +126,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { assertEq(tokenPriceAnswer, uint224(1e14)); } - function test_StaleFeeToken_Success() public { + function test_StaleFeeToken() public { vm.warp(block.timestamp + TWELVE_HOURS + 1); Internal.PriceUpdates memory priceUpdates = abi.decode(s_encodedInitialPriceUpdates, (Internal.PriceUpdates)); @@ -139,7 +139,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { // Reverts - function test_OverflowFeedPrice_Revert() public { + function test_RevertWhen_OverflowFeedPrice() public { address tokenAddress = _deploySourceToken("testToken", 0, 18); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, int256(uint256(type(uint224).max) + 1)); @@ -151,7 +151,7 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { s_feeQuoter.getValidatedTokenPrice(tokenAddress); } - function test_UnderflowFeedPrice_Revert() public { + function test_RevertWhen_UnderflowFeedPrice() public { address tokenAddress = _deploySourceToken("testToken", 0, 18); address feedAddress = _deployTokenPriceDataFeed(tokenAddress, 18, -1); @@ -163,12 +163,12 @@ contract FeeQuoter_getValidatedTokenPrice is FeeQuoterSetup { s_feeQuoter.getValidatedTokenPrice(tokenAddress); } - function test_TokenNotSupported_Revert() public { + function test_RevertWhen_TokenNotSupported() public { vm.expectRevert(abi.encodeWithSelector(FeeQuoter.TokenNotSupported.selector, DUMMY_CONTRACT_ADDRESS)); s_feeQuoter.getValidatedTokenPrice(DUMMY_CONTRACT_ADDRESS); } - function test_TokenNotSupportedFeed_Revert() public { + function test_RevertWhen_TokenNotSupportedFeed() public { address sourceToken = _initialiseSingleTokenPriceFeed(); MockV3Aggregator(s_dataFeedByToken[sourceToken]).updateAnswer(0); Internal.PriceUpdates memory priceUpdates = Internal.PriceUpdates({ diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.onReport.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.onReport.t.sol index ebd800b7d48..898087c5f3c 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.onReport.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.onReport.t.sol @@ -132,7 +132,7 @@ contract FeeQuoter_onReport is FeeQuoterSetup { assertEq(vm.getRecordedLogs().length, 0); } - function test_onReport_RevertWhen_TokenNotSupported() public { + function test_RevertWhen_onReportWhen_TokenNotSupported() public { FeeQuoter.ReceivedCCIPFeedReport[] memory report = new FeeQuoter.ReceivedCCIPFeedReport[](1); report[0] = FeeQuoter.ReceivedCCIPFeedReport({token: s_sourceTokens[1], price: 4e18, timestamp: uint32(block.timestamp)}); @@ -143,7 +143,7 @@ contract FeeQuoter_onReport is FeeQuoterSetup { s_feeQuoter.onReport(encodedPermissionsMetadata, abi.encode(report)); } - function test_onReport_RevertWhen_InvalidForwarder() public { + function test_RevertWhen_onReportWhen_InvalidForwarder() public { FeeQuoter.ReceivedCCIPFeedReport[] memory report = new FeeQuoter.ReceivedCCIPFeedReport[](1); report[0] = FeeQuoter.ReceivedCCIPFeedReport({token: s_sourceTokens[0], price: 4e18, timestamp: uint32(block.timestamp)}); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol index 8f4e3f954ca..d4cb82890e4 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.parseEVMExtraArgsFromBytes.t.sol @@ -13,7 +13,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { s_destChainConfig = _generateFeeQuoterDestChainConfigArgs()[0].destChainConfig; } - function test_EVMExtraArgsV1_Success() public view { + function test_EVMExtraArgsV1() public view { Client.EVMExtraArgsV1 memory inputArgs = Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT}); bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); Client.EVMExtraArgsV2 memory expectedOutputArgs = @@ -25,7 +25,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { ); } - function test_EVMExtraArgsV2_Success() public view { + function test_EVMExtraArgsV2() public view { Client.EVMExtraArgsV2 memory inputArgs = Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: true}); bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); @@ -35,7 +35,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { ); } - function test_EVMExtraArgsDefault_Success() public view { + function test_EVMExtraArgsDefault() public view { Client.EVMExtraArgsV2 memory expectedOutputArgs = Client.EVMExtraArgsV2({gasLimit: s_destChainConfig.defaultTxGasLimit, allowOutOfOrderExecution: false}); @@ -46,7 +46,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { // Reverts - function test_EVMExtraArgsInvalidExtraArgsTag_Revert() public { + function test_RevertWhen_EVMExtraArgsInvalidExtraArgsTag() public { Client.EVMExtraArgsV2 memory inputArgs = Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: true}); bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); @@ -57,7 +57,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); } - function test_EVMExtraArgsEnforceOutOfOrder_Revert() public { + function test_RevertWhen_EVMExtraArgsEnforceOutOfOrder() public { Client.EVMExtraArgsV2 memory inputArgs = Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT, allowOutOfOrderExecution: false}); bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); @@ -67,7 +67,7 @@ contract FeeQuoter_parseEVMExtraArgsFromBytes is FeeQuoterSetup { s_feeQuoter.parseEVMExtraArgsFromBytes(inputExtraArgs, s_destChainConfig); } - function test_EVMExtraArgsGasLimitTooHigh_Revert() public { + function test_RevertWhen_EVMExtraArgsGasLimitTooHigh() public { Client.EVMExtraArgsV2 memory inputArgs = Client.EVMExtraArgsV2({gasLimit: s_destChainConfig.maxPerMsgGasLimit + 1, allowOutOfOrderExecution: true}); bytes memory inputExtraArgs = Client._argsToBytes(inputArgs); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol index 65baa576ead..721addcbe70 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.processMessageArgs.t.sol @@ -15,7 +15,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { super.setUp(); } - function test_processMessageArgs_WithLinkTokenAmount_Success() public view { + function test_processMessageArgs_WithLinkTokenAmount() public view { ( uint256 msgFeeJuels, /* bool isOutOfOrderExecution */ @@ -36,7 +36,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { assertEq(msgFeeJuels, MAX_MSG_FEES_JUELS); } - function test_processMessageArgs_WithConvertedTokenAmount_Success() public view { + function test_processMessageArgs_WithConvertedTokenAmount() public view { address feeToken = s_sourceTokens[1]; uint256 feeTokenAmount = 10_000 gwei; uint256 expectedConvertedAmount = s_feeQuoter.convertTokenAmount(feeToken, feeTokenAmount, s_sourceTokens[0]); @@ -60,7 +60,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { assertEq(msgFeeJuels, expectedConvertedAmount); } - function test_processMessageArgs_WithEmptyEVMExtraArgs_Success() public view { + function test_processMessageArgs_WithEmptyEVMExtraArgs() public view { ( /* uint256 msgFeeJuels */ , @@ -80,7 +80,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { assertEq(convertedExtraArgs, Client._argsToBytes(s_feeQuoter.parseEVMExtraArgsFromBytes("", DEST_CHAIN_SELECTOR))); } - function test_processMessageArgs_WithEVMExtraArgsV1_Success() public view { + function test_processMessageArgs_WithEVMExtraArgsV1() public view { bytes memory extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: 1000})); ( @@ -104,7 +104,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } - function test_processMessageArgs_WitEVMExtraArgsV2_Success() public view { + function test_processMessageArgs_WitEVMExtraArgsV2() public view { bytes memory extraArgs = Client._argsToBytes(Client.EVMExtraArgsV2({gasLimit: 0, allowOutOfOrderExecution: true})); ( @@ -130,7 +130,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { // Reverts - function test_processMessageArgs_MessageFeeTooHigh_Revert() public { + function test_RevertWhen_processMessageArgs_MessageFeeTooHigh() public { vm.expectRevert( abi.encodeWithSelector(FeeQuoter.MessageFeeTooHigh.selector, MAX_MSG_FEES_JUELS + 1, MAX_MSG_FEES_JUELS) ); @@ -145,7 +145,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } - function test_processMessageArgs_InvalidExtraArgs_Revert() public { + function test_RevertWhen_processMessageArgs_InvalidExtraArgs() public { vm.expectRevert(FeeQuoter.InvalidExtraArgsTag.selector); s_feeQuoter.processMessageArgs( @@ -158,7 +158,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } - function test_processMessageArgs_MalformedEVMExtraArgs_Revert() public { + function test_RevertWhen_processMessageArgs_MalformedEVMExtraArgs() public { // abi.decode error vm.expectRevert(); @@ -172,7 +172,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } - function test_processMessageArgs_WithCorrectPoolReturnData_Success() public view { + function test_processMessageArgs_WithCorrectPoolReturnData() public view { Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](2); sourceTokenAmounts[0].amount = 1e18; sourceTokenAmounts[0].token = s_sourceTokens[0]; @@ -199,7 +199,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { } } - function test_processMessageArgs_TokenAmountArraysMismatching_Revert() public { + function test_RevertWhen_processMessageArgs_TokenAmountArraysMismatching() public { Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](2); sourceTokenAmounts[0].amount = 1e18; sourceTokenAmounts[0].token = s_sourceTokens[0]; @@ -220,7 +220,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } - function test_applyTokensTransferFeeConfigUpdates_InvalidFeeRange_Revert() public { + function test_RevertWhen_applyTokensTransferFeeConfigUpdates_InvalidFeeRange() public { address sourceETH = s_sourceTokens[1]; // Set token config to allow larger data @@ -243,7 +243,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } - function test_processMessageArgs_SourceTokenDataTooLarge_Revert() public { + function test_RevertWhen_processMessageArgs_SourceTokenDataTooLarge() public { address sourceETH = s_sourceTokens[1]; Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](1); @@ -300,7 +300,7 @@ contract FeeQuoter_processMessageArgs is FeeQuoterFeeSetup { ); } - function test_processMessageArgs_InvalidEVMAddressDestToken_Revert() public { + function test_RevertWhen_processMessageArgs_InvalidEVMAddressDestToken() public { bytes memory nonEvmAddress = abi.encode(type(uint208).max); Client.EVMTokenAmount[] memory sourceTokenAmounts = new Client.EVMTokenAmount[](1); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.supportsInterface.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.supportsInterface.t.sol index a9352392301..337368a6654 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.supportsInterface.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.supportsInterface.t.sol @@ -9,7 +9,7 @@ import {IFeeQuoter} from "../../interfaces/IFeeQuoter.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_supportsInterface is FeeQuoterSetup { - function test_SupportsInterface_Success() public view { + function test_SupportsInterface() public view { assertTrue(s_feeQuoter.supportsInterface(type(IReceiver).interfaceId)); assertTrue(s_feeQuoter.supportsInterface(type(ITypeAndVersion).interfaceId)); assertTrue(s_feeQuoter.supportsInterface(type(IFeeQuoter).interfaceId)); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updatePrices.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updatePrices.t.sol index d40ac7d33ad..b06246a5a7e 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updatePrices.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updatePrices.t.sol @@ -7,7 +7,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_updatePrices is FeeQuoterSetup { - function test_OnlyTokenPrice_Success() public { + function test_OnlyTokenPrice() public { Internal.PriceUpdates memory update = Internal.PriceUpdates({ tokenPriceUpdates: new Internal.TokenPriceUpdate[](1), gasPriceUpdates: new Internal.GasPriceUpdate[](0) @@ -24,7 +24,7 @@ contract FeeQuoter_updatePrices is FeeQuoterSetup { assertEq(s_feeQuoter.getTokenPrice(s_sourceTokens[0]).value, update.tokenPriceUpdates[0].usdPerToken); } - function test_OnlyGasPrice_Success() public { + function test_OnlyGasPrice() public { Internal.PriceUpdates memory update = Internal.PriceUpdates({ tokenPriceUpdates: new Internal.TokenPriceUpdate[](0), gasPriceUpdates: new Internal.GasPriceUpdate[](1) @@ -44,7 +44,7 @@ contract FeeQuoter_updatePrices is FeeQuoterSetup { ); } - function test_UpdateMultiplePrices_Success() public { + function test_UpdateMultiplePrices() public { Internal.TokenPriceUpdate[] memory tokenPriceUpdates = new Internal.TokenPriceUpdate[](3); tokenPriceUpdates[0] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[0], usdPerToken: 4e18}); tokenPriceUpdates[1] = Internal.TokenPriceUpdate({sourceToken: s_sourceTokens[1], usdPerToken: 1800e18}); @@ -86,7 +86,7 @@ contract FeeQuoter_updatePrices is FeeQuoterSetup { } } - function test_UpdatableByAuthorizedCaller_Success() public { + function test_UpdatableByAuthorizedCaller() public { Internal.PriceUpdates memory priceUpdates = Internal.PriceUpdates({ tokenPriceUpdates: new Internal.TokenPriceUpdate[](1), gasPriceUpdates: new Internal.GasPriceUpdate[](0) @@ -127,7 +127,7 @@ contract FeeQuoter_updatePrices is FeeQuoterSetup { // Reverts - function test_OnlyCallableByUpdater_Revert() public { + function test_RevertWhen_OnlyCallableByUpdater() public { Internal.PriceUpdates memory priceUpdates = Internal.PriceUpdates({ tokenPriceUpdates: new Internal.TokenPriceUpdate[](0), gasPriceUpdates: new Internal.GasPriceUpdate[](0) diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updateTokenPriceFeeds.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updateTokenPriceFeeds.t.sol index 9341fab121b..79e7be62985 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updateTokenPriceFeeds.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.updateTokenPriceFeeds.t.sol @@ -9,7 +9,7 @@ import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; import {Vm} from "forge-std/Vm.sol"; contract FeeQuoter_updateTokenPriceFeeds is FeeQuoterSetup { - function test_ZeroFeeds_Success() public { + function test_ZeroFeeds() public { Vm.Log[] memory logEntries = vm.getRecordedLogs(); FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](0); @@ -20,7 +20,7 @@ contract FeeQuoter_updateTokenPriceFeeds is FeeQuoterSetup { assertEq(logEntries.length, 0); } - function test_SingleFeedUpdate_Success() public { + function test_SingleFeedUpdate() public { FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); @@ -37,7 +37,7 @@ contract FeeQuoter_updateTokenPriceFeeds is FeeQuoterSetup { ); } - function test_MultipleFeedUpdate_Success() public { + function test_MultipleFeedUpdate() public { FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](2); for (uint256 i = 0; i < 2; ++i) { @@ -62,7 +62,7 @@ contract FeeQuoter_updateTokenPriceFeeds is FeeQuoterSetup { ); } - function test_FeedUnset_Success() public { + function test_FeedUnset() public { Internal.TimestampedPackedUint224 memory priceQueryInitial = s_feeQuoter.getTokenPrice(s_sourceTokens[0]); assertFalse(priceQueryInitial.value == 0); assertFalse(priceQueryInitial.timestamp == 0); @@ -106,7 +106,7 @@ contract FeeQuoter_updateTokenPriceFeeds is FeeQuoterSetup { // Reverts - function test_FeedUpdatedByNonOwner_Revert() public { + function test_RevertWhen_FeedUpdatedByNonOwner() public { FeeQuoter.TokenPriceFeedUpdate[] memory tokenPriceFeedUpdates = new FeeQuoter.TokenPriceFeedUpdate[](1); tokenPriceFeedUpdates[0] = _getSingleTokenPriceFeedUpdateStruct(s_sourceTokens[0], s_dataFeedByToken[s_sourceTokens[0]], 18); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol index 761cb7546a9..3bb3b8ee5de 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoter.validateDestFamilyAddress.t.sol @@ -5,30 +5,30 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_validateDestFamilyAddress is FeeQuoterSetup { - function test_ValidEVMAddress_Success() public view { + function test_ValidEVMAddress() public view { bytes memory encodedAddress = abi.encode(address(10000)); s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, encodedAddress); } - function test_ValidNonEVMAddress_Success() public view { + function test_ValidNonEVMAddress() public view { s_feeQuoter.validateDestFamilyAddress(bytes4(uint32(1)), abi.encode(type(uint208).max)); } // Reverts - function test_InvalidEVMAddress_Revert() public { + function test_RevertWhen_InvalidEVMAddress() public { bytes memory invalidAddress = abi.encode(type(uint208).max); vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); } - function test_InvalidEVMAddressEncodePacked_Revert() public { + function test_RevertWhen_InvalidEVMAddressEncodePacked() public { bytes memory invalidAddress = abi.encodePacked(address(234)); vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); s_feeQuoter.validateDestFamilyAddress(Internal.CHAIN_FAMILY_SELECTOR_EVM, invalidAddress); } - function test_InvalidEVMAddressPrecompiles_Revert() public { + function test_RevertWhen_InvalidEVMAddressPrecompiles() public { for (uint160 i = 0; i < Internal.PRECOMPILE_SPACE; ++i) { bytes memory invalidAddress = abi.encode(address(i)); vm.expectRevert(abi.encodeWithSelector(Internal.InvalidEVMAddress.selector, invalidAddress)); diff --git a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol index 92c2b3fe309..b06a8c605e9 100644 --- a/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/feeQuoter/FeeQuoterSetup.t.sol @@ -17,6 +17,18 @@ contract FeeQuoterSetup is TokenSetup { address internal constant CUSTOM_TOKEN = address(12345); address internal constant CUSTOM_TOKEN_2 = address(bytes20(keccak256("CUSTOM_TOKEN_2"))); + uint32 internal constant MAX_DATA_SIZE = 30_000; + uint16 internal constant MAX_TOKENS_LENGTH = 5; + uint32 internal constant MAX_GAS_LIMIT = 4_000_000; + + // OnRamp + uint96 internal constant MAX_MSG_FEES_JUELS = 1_000e18; + uint32 internal constant DEST_GAS_OVERHEAD = 300_000; + uint16 internal constant DEST_GAS_PER_PAYLOAD_BYTE = 16; + + uint16 internal constant DEFAULT_TOKEN_FEE_USD_CENTS = 50; + uint32 internal constant DEFAULT_TOKEN_BYTES_OVERHEAD = 32; + // Use 16 gas per data availability byte in our tests. // This is an overestimation in OP stack, it ignores 4 gas per 0 byte rule. // Arbitrum on the other hand, does always use 16 gas per data availability byte. diff --git a/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol b/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol index 4f03f3e6f55..1991b08e031 100644 --- a/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol +++ b/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol @@ -160,14 +160,14 @@ contract MerkleMultiProofTest is Test { assertEq(MerkleMultiProof._merkleRoot(leaves, proofs, 7), finalResult); } - function test_MerkleRootSingleLeaf_Success() public pure { + function test_MerkleRootSingleLeaf() public pure { bytes32[] memory leaves = new bytes32[](1); leaves[0] = "root"; bytes32[] memory proofs = new bytes32[](0); assertEq(MerkleMultiProof._merkleRoot(leaves, proofs, 0), leaves[0]); } - function test_EmptyLeaf_Revert() public { + function test_RevertWhen_EmptyLeaf() public { bytes32[] memory leaves = new bytes32[](0); bytes32[] memory proofs = new bytes32[](0); diff --git a/contracts/src/v0.8/ccip/test/libraries/RateLimiter.t.sol b/contracts/src/v0.8/ccip/test/libraries/RateLimiter.t.sol index da6a6f9ada7..e88e9a4150a 100644 --- a/contracts/src/v0.8/ccip/test/libraries/RateLimiter.t.sol +++ b/contracts/src/v0.8/ccip/test/libraries/RateLimiter.t.sol @@ -18,7 +18,7 @@ contract RateLimiterSetup is Test { } contract RateLimiter_constructor is RateLimiterSetup { - function test_Constructor_Success() public view { + function test_Constructor() public view { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); assertEq(s_config.rate, rateLimiter.rate); assertEq(s_config.capacity, rateLimiter.capacity); @@ -29,7 +29,7 @@ contract RateLimiter_constructor is RateLimiterSetup { } contract RateLimiter_setTokenBucketConfig is RateLimiterSetup { - function test_SetRateLimiterConfig_Success() public { + function test_SetRateLimiterConfig() public { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); assertEq(s_config.rate, rateLimiter.rate); assertEq(s_config.capacity, rateLimiter.capacity); @@ -52,7 +52,7 @@ contract RateLimiter_setTokenBucketConfig is RateLimiterSetup { } contract RateLimiter_currentTokenBucketState is RateLimiterSetup { - function test_CurrentTokenBucketState_Success() public { + function test_CurrentTokenBucketState() public { RateLimiter.TokenBucket memory bucket = s_helper.currentTokenBucketState(); assertEq(s_config.rate, bucket.rate); assertEq(s_config.capacity, bucket.capacity); @@ -72,7 +72,7 @@ contract RateLimiter_currentTokenBucketState is RateLimiterSetup { assertEq(BLOCK_TIME, bucket.lastUpdated); } - function test_Refill_Success() public { + function test_Refill() public { RateLimiter.TokenBucket memory bucket = s_helper.currentTokenBucketState(); assertEq(s_config.rate, bucket.rate); assertEq(s_config.capacity, bucket.capacity); @@ -109,7 +109,7 @@ contract RateLimiter_currentTokenBucketState is RateLimiterSetup { contract RateLimiter_consume is RateLimiterSetup { address internal s_token = address(100); - function test_ConsumeAggregateValue_Success() public { + function test_ConsumeAggregateValue() public { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); assertEq(s_config.rate, rateLimiter.rate); assertEq(s_config.capacity, rateLimiter.capacity); @@ -132,7 +132,7 @@ contract RateLimiter_consume is RateLimiterSetup { assertEq(BLOCK_TIME, rateLimiter.lastUpdated); } - function test_ConsumeTokens_Success() public { + function test_ConsumeTokens() public { uint256 requestTokens = 50; vm.expectEmit(); @@ -141,7 +141,7 @@ contract RateLimiter_consume is RateLimiterSetup { s_helper.consume(requestTokens, s_token); } - function test_Refill_Success() public { + function test_Refill() public { uint256 requestTokens = 50; vm.expectEmit(); @@ -172,7 +172,7 @@ contract RateLimiter_consume is RateLimiterSetup { assertEq(BLOCK_TIME + warpTime, rateLimiter.lastUpdated); } - function test_ConsumeUnlimited_Success() public { + function test_ConsumeUnlimited() public { s_helper.consume(0, address(0)); RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); @@ -204,7 +204,7 @@ contract RateLimiter_consume is RateLimiterSetup { // Reverts - function test_AggregateValueMaxCapacityExceeded_Revert() public { + function test_RevertWhen_AggregateValueMaxCapacityExceeded() public { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); vm.expectRevert( @@ -215,7 +215,7 @@ contract RateLimiter_consume is RateLimiterSetup { s_helper.consume(rateLimiter.capacity + 1, address(0)); } - function test_TokenMaxCapacityExceeded_Revert() public { + function test_RevertWhen_TokenMaxCapacityExceeded() public { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); vm.expectRevert( @@ -226,7 +226,7 @@ contract RateLimiter_consume is RateLimiterSetup { s_helper.consume(rateLimiter.capacity + 1, s_token); } - function test_ConsumingMoreThanUint128_Revert() public { + function test_RevertWhen_ConsumingMoreThanUint128() public { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); uint256 request = uint256(type(uint128).max) + 1; @@ -237,7 +237,7 @@ contract RateLimiter_consume is RateLimiterSetup { s_helper.consume(request, address(0)); } - function test_AggregateValueRateLimitReached_Revert() public { + function test_RevertWhen_AggregateValueRateLimitReached() public { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); uint256 overLimit = 20; @@ -256,7 +256,7 @@ contract RateLimiter_consume is RateLimiterSetup { s_helper.consume(requestTokens2, address(0)); } - function test_TokenRateLimitReached_Revert() public { + function test_RevertWhen_TokenRateLimitReached() public { RateLimiter.TokenBucket memory rateLimiter = s_helper.getRateLimiter(); uint256 overLimit = 20; @@ -275,7 +275,7 @@ contract RateLimiter_consume is RateLimiterSetup { s_helper.consume(requestTokens2, s_token); } - function test_RateLimitReachedOverConsecutiveBlocks_Revert() public { + function test_RevertWhen_RateLimitReachedOverConsecutiveBlocks() public { uint256 initBlockTime = BLOCK_TIME + 10000; vm.warp(initBlockTime); diff --git a/contracts/src/v0.8/ccip/test/mocks/MockRMN.sol b/contracts/src/v0.8/ccip/test/mocks/MockRMN.sol deleted file mode 100644 index 435c6697632..00000000000 --- a/contracts/src/v0.8/ccip/test/mocks/MockRMN.sol +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.24; - -import {IRMN} from "../../interfaces/IRMN.sol"; - -/// @notice WARNING: This contract is to be only used for testing, all methods are unprotected. -contract MockRMN is IRMN { - error CustomError(bytes err); - - bytes private s_isCursedRevert; - - bool private s_globalCursed; - mapping(bytes16 subject => bool cursed) private s_cursedBySubject; - mapping(address commitStore => mapping(bytes32 root => bool blessed)) private s_blessedByRoot; - - function setTaggedRootBlessed(IRMN.TaggedRoot calldata taggedRoot, bool blessed) external { - s_blessedByRoot[taggedRoot.commitStore][taggedRoot.root] = blessed; - } - - function setGlobalCursed( - bool cursed - ) external { - s_globalCursed = cursed; - } - - function setChainCursed(uint64 chainSelector, bool cursed) external { - s_cursedBySubject[bytes16(uint128(chainSelector))] = cursed; - } - - /// @notice Setting a revert error with length of 0 will disable reverts - /// @dev Useful to test revert handling of ARMProxy - function setIsCursedRevert( - bytes calldata revertErr - ) external { - s_isCursedRevert = revertErr; - } - - // IRMN implementation follows - - function isCursed() external view returns (bool) { - if (s_isCursedRevert.length > 0) { - revert CustomError(s_isCursedRevert); - } - return s_globalCursed; - } - - function isCursed( - bytes16 subject - ) external view returns (bool) { - if (s_isCursedRevert.length > 0) { - revert CustomError(s_isCursedRevert); - } - return s_globalCursed || s_cursedBySubject[subject]; - } - - function isBlessed( - IRMN.TaggedRoot calldata taggedRoot - ) external view returns (bool) { - return s_blessedByRoot[taggedRoot.commitStore][taggedRoot.root]; - } -} diff --git a/contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol b/contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol index 549d6b8f843..11371d71f95 100644 --- a/contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol +++ b/contracts/src/v0.8/ccip/test/mocks/test/MockRouterTest.t.sol @@ -1,7 +1,6 @@ pragma solidity ^0.8.0; import {Client} from "../../../libraries/Client.sol"; - import {TokenSetup} from "../../TokenSetup.t.sol"; import {IRouterClient, MockCCIPRouter} from "../MockRouter.sol"; @@ -31,32 +30,32 @@ contract MockRouterTest is TokenSetup { s_sourceFeeToken = _deploySourceToken("sLINK", type(uint256).max, 18); } - function test_ccipSendWithInsufficientNativeTokens_Revert() public { + function test_RevertWhen_ccipSendWithInsufficientNativeTokens() public { //Should revert because did not include sufficient eth to pay for fees vm.expectRevert(IRouterClient.InsufficientFeeTokenAmount.selector); mockRouter.ccipSend(MOCK_CHAIN_SELECTOR, message); } - function test_ccipSendWithSufficientNativeFeeTokens_Success() public { + function test_ccipSendWithSufficientNativeFeeTokens() public { //ccipSend with sufficient native tokens for fees mockRouter.ccipSend{value: 0.1 ether}(MOCK_CHAIN_SELECTOR, message); } - function test_ccipSendWithInvalidMsgValue_Revert() public { + function test_RevertWhen_ccipSendWithInvalidMsgValue() public { message.feeToken = address(1); //Set to non native-token fees vm.expectRevert(IRouterClient.InvalidMsgValue.selector); mockRouter.ccipSend{value: 0.1 ether}(MOCK_CHAIN_SELECTOR, message); } - function test_ccipSendWithLinkFeeTokenbutInsufficientAllowance_Revert() public { + function test_RevertWhen_ccipSendWithLinkFeeTokenbutInsufficientAllowance() public { message.feeToken = s_sourceFeeToken; vm.expectRevert(bytes("ERC20: insufficient allowance")); mockRouter.ccipSend(MOCK_CHAIN_SELECTOR, message); } - function test_ccipSendWithLinkFeeTokenAndValidMsgValue_Success() public { + function test_ccipSendWithLinkFeeTokenAndValidMsgValue() public { message.feeToken = s_sourceFeeToken; vm.startPrank(OWNER, OWNER); @@ -66,19 +65,19 @@ contract MockRouterTest is TokenSetup { mockRouter.ccipSend(MOCK_CHAIN_SELECTOR, message); } - function test_ccipSendWithEVMExtraArgsV1_Success() public { + function test_ccipSendWithEVMExtraArgsV1() public { Client.EVMExtraArgsV1 memory extraArgs = Client.EVMExtraArgsV1({gasLimit: 500_000}); message.extraArgs = Client._argsToBytes(extraArgs); mockRouter.ccipSend{value: 0.1 ether}(MOCK_CHAIN_SELECTOR, message); } - function test_ccipSendWithEVMExtraArgsV2_Success() public { + function test_ccipSendWithEVMExtraArgsV2() public { Client.EVMExtraArgsV2 memory extraArgs = Client.EVMExtraArgsV2({gasLimit: 500_000, allowOutOfOrderExecution: true}); message.extraArgs = Client._argsToBytes(extraArgs); mockRouter.ccipSend{value: 0.1 ether}(MOCK_CHAIN_SELECTOR, message); } - function test_ccipSendWithInvalidEVMExtraArgs_Revert() public { + function test_RevertWhen_ccipSendWithInvalidEVMExtraArgs() public { uint256 gasLimit = 500_000; bytes4 invalidExtraArgsTag = bytes4(keccak256("CCIP EVMExtraArgsInvalid")); message.extraArgs = abi.encodeWithSelector(invalidExtraArgsTag, gasLimit); diff --git a/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.setOCR3Configs.t.sol b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.setOCR3Configs.t.sol index c70a8666654..59ce42e7b0d 100644 --- a/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.setOCR3Configs.t.sol +++ b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.setOCR3Configs.t.sol @@ -8,7 +8,7 @@ import {MultiOCR3BaseSetup} from "./MultiOCR3BaseSetup.t.sol"; import {Vm} from "forge-std/Vm.sol"; contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { - function test_SetConfigsZeroInput_Success() public { + function test_SetConfigsZeroInput() public { vm.recordLogs(); s_multiOCR3.setOCR3Configs(new MultiOCR3Base.OCRConfigArgs[](0)); @@ -17,7 +17,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { assertEq(logEntries.length, 0); } - function test_SetConfigWithSigners_Success() public { + function test_SetConfigWithSigners() public { uint8 F = 2; _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); @@ -59,7 +59,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); } - function test_SetConfigWithSignersMismatchingTransmitters_Success() public { + function test_SetConfigWithSignersMismatchingTransmitters() public { uint8 F = 2; _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); @@ -101,7 +101,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); } - function test_SetConfigWithoutSigners_Success() public { + function test_SetConfigWithoutSigners() public { uint8 F = 1; address[] memory signers = new address[](0); @@ -144,7 +144,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(0), expectedConfig); } - function test_SetConfigIgnoreSigners_Success() public { + function test_SetConfigIgnoreSigners() public { uint8 F = 1; _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); @@ -192,7 +192,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { } } - function test_SetMultipleConfigs_Success() public { + function test_SetMultipleConfigs() public { _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(1)); _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(2)); @@ -321,7 +321,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { _assertOCRConfigEquality(s_multiOCR3.latestConfigDetails(ocrConfig.ocrPluginType), expectedConfig); } - function test_UpdateConfigTransmittersWithoutSigners_Success() public { + function test_UpdateConfigTransmittersWithoutSigners() public { _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); @@ -380,7 +380,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { } } - function test_UpdateConfigSigners_Success() public { + function test_UpdateConfigSigners() public { _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); @@ -450,7 +450,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { // Reverts - function test_RepeatTransmitterAddress_Revert() public { + function test_RevertWhen_RepeatTransmitterAddress() public { address[] memory signers = s_validSigners; address[] memory transmitters = s_validTransmitters; transmitters[0] = signers[0]; @@ -473,7 +473,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_RepeatSignerAddress_Revert() public { + function test_RevertWhen_RepeatSignerAddress() public { address[] memory signers = s_validSigners; address[] memory transmitters = s_validTransmitters; signers[1] = signers[0]; @@ -496,7 +496,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_SignerCannotBeZeroAddress_Revert() public { + function test_RevertWhen_SignerCannotBeZeroAddress() public { uint8 F = 1; address[] memory signers = new address[](3 * F + 1); address[] memory transmitters = new address[](3 * F + 1); @@ -521,7 +521,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_TransmitterCannotBeZeroAddress_Revert() public { + function test_RevertWhen_TransmitterCannotBeZeroAddress() public { uint8 F = 1; address[] memory signers = new address[](3 * F + 1); address[] memory transmitters = new address[](3 * F + 1); @@ -546,7 +546,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_StaticConfigChange_Revert() public { + function test_RevertWhen_StaticConfigChange() public { uint8 F = 1; _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(0)); @@ -569,7 +569,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_FTooHigh_Revert() public { + function test_RevertWhen_FTooHigh() public { address[] memory signers = new address[](0); address[] memory transmitters = new address[](1); @@ -589,7 +589,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_FMustBePositive_Revert() public { + function test_RevertWhen_FMustBePositive() public { MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ ocrPluginType: 0, @@ -608,7 +608,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_NoTransmitters_Revert() public { + function test_RevertWhen_NoTransmitters() public { address[] memory signers = new address[](0); address[] memory transmitters = new address[](0); @@ -628,7 +628,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_TooManyTransmitters_Revert() public { + function test_RevertWhen_TooManyTransmitters() public { address[] memory signers = new address[](0); address[] memory transmitters = new address[](257); @@ -650,7 +650,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_TooManySigners_Revert() public { + function test_RevertWhen_TooManySigners() public { address[] memory signers = new address[](257); MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); @@ -671,7 +671,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_MoreTransmittersThanSigners_Revert() public { + function test_RevertWhen_MoreTransmittersThanSigners() public { MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); ocrConfigs[0] = MultiOCR3Base.OCRConfigArgs({ ocrPluginType: 0, diff --git a/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.transmit.t.sol b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.transmit.t.sol index 2855b47eeea..99bad484737 100644 --- a/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.transmit.t.sol +++ b/contracts/src/v0.8/ccip/test/ocr/MultiOCR3Base/MultiOCR3Base.transmit.t.sol @@ -45,7 +45,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.setOCR3Configs(ocrConfigs); } - function test_TransmitSigners_gas_Success() public { + function test_TransmitSigners_gas() public { vm.pauseGasMetering(); bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; @@ -63,7 +63,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); } - function test_TransmitWithoutSignatureVerification_gas_Success() public { + function test_TransmitWithoutSignatureVerification_gas() public { vm.pauseGasMetering(); bytes32[2] memory reportContext = [s_configDigest3, s_configDigest3]; @@ -137,7 +137,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { } // Reverts - function test_ForkedChain_Revert() public { + function test_RevertWhen_ForkedChain() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = @@ -154,7 +154,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); } - function test_ZeroSignatures_Revert() public { + function test_RevertWhen_ZeroSignatures() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; s_multiOCR3.setTransmitOcrPluginType(0); @@ -164,7 +164,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, new bytes32[](0), new bytes32[](0), bytes32("")); } - function test_TooManySignatures_Revert() public { + function test_RevertWhen_TooManySignatures() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; // 1 signature too many @@ -178,7 +178,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); } - function test_InsufficientSignatures_Revert() public { + function test_RevertWhen_InsufficientSignatures() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; // Missing 1 signature for unique report @@ -192,7 +192,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); } - function test_ConfigDigestMismatch_Revert() public { + function test_RevertWhen_ConfigDigestMismatch() public { bytes32 configDigest; bytes32[2] memory reportContext = [configDigest, configDigest]; @@ -204,7 +204,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, new bytes32[](0), new bytes32[](0), rawVs); } - function test_SignatureOutOfRegistration_Revert() public { + function test_RevertWhen_SignatureOutOfRegistration() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; bytes32[] memory rs = new bytes32[](2); @@ -217,7 +217,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, bytes32("")); } - function test_UnAuthorizedTransmitter_Revert() public { + function test_RevertWhen_UnAuthorizedTransmitter() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; bytes32[] memory rs = new bytes32[](2); bytes32[] memory ss = new bytes32[](2); @@ -228,7 +228,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, bytes32("")); } - function test_NonUniqueSignature_Revert() public { + function test_RevertWhen_NonUniqueSignature() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; (bytes32[] memory rs, bytes32[] memory ss, uint8[] memory vs, bytes32 rawVs) = @@ -246,7 +246,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); } - function test_UnauthorizedSigner_Revert() public { + function test_RevertWhen_UnauthorizedSigner() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; (bytes32[] memory rs, bytes32[] memory ss,, bytes32 rawVs) = @@ -262,7 +262,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithSignatures(reportContext, REPORT, rs, ss, rawVs); } - function test_UnconfiguredPlugin_Revert() public { + function test_RevertWhen_UnconfiguredPlugin() public { bytes32 configDigest; bytes32[2] memory reportContext = [configDigest, configDigest]; @@ -272,7 +272,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithoutSignatures(reportContext, REPORT); } - function test_TransmitWithLessCalldataArgs_Revert() public { + function test_RevertWhen_TransmitWithLessCalldataArgs() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; s_multiOCR3.setTransmitOcrPluginType(0); @@ -293,7 +293,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithoutSignatures(reportContext, REPORT); } - function test_TransmitWithExtraCalldataArgs_Revert() public { + function test_RevertWhen_TransmitWithExtraCalldataArgs() public { bytes32[2] memory reportContext = [s_configDigest1, s_configDigest1]; bytes32[] memory rs = new bytes32[](2); bytes32[] memory ss = new bytes32[](2); diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.afterOC3ConfigSet.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.afterOC3ConfigSet.t.sol index d2edb7a261a..2d374222cd6 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.afterOC3ConfigSet.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.afterOC3ConfigSet.t.sol @@ -8,7 +8,7 @@ import {OffRampHelper} from "../../helpers/OffRampHelper.sol"; import {OffRampSetup} from "./OffRampSetup.t.sol"; contract OffRamp_afterOC3ConfigSet is OffRampSetup { - function test_afterOCR3ConfigSet_SignatureVerificationDisabled_Revert() public { + function test_RevertWhen_afterOCR3ConfigSet_SignatureVerificationDisabled() public { s_offRamp = new OffRampHelper( OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.applySourceChainConfigUpdates.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.applySourceChainConfigUpdates.t.sol index 84c522108ae..22fc42ff8dd 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.applySourceChainConfigUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.applySourceChainConfigUpdates.t.sol @@ -10,7 +10,7 @@ import {OffRampSetup} from "./OffRampSetup.t.sol"; import {Vm} from "forge-std/Vm.sol"; contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { - function test_ApplyZeroUpdates_Success() public { + function test_ApplyZeroUpdates() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](0); vm.recordLogs(); @@ -23,7 +23,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { assertEq(s_offRamp.getSourceChainSelectors().length, 0); } - function test_AddNewChain_Success() public { + function test_AddNewChain() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -46,7 +46,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { _assertSourceChainConfigEquality(s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR_1), expectedSourceChainConfig); } - function test_ReplaceExistingChain_Success() public { + function test_ReplaceExistingChain() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -77,7 +77,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { assertEq(resultSourceChainSelectors.length, 1); } - function test_AddMultipleChains_Success() public { + function test_AddMultipleChains() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](3); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -171,7 +171,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { ); } - function test_ReplaceExistingChainOnRamp_Success() public { + function test_ReplaceExistingChainOnRamp() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -192,7 +192,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); } - function test_allowNonOnRampUpdateAfterLaneIsUsed_success() public { + function test_allowNonOnRampUpdateAfterLaneIsUsed() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -233,7 +233,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { // Reverts - function test_ZeroOnRampAddress_Revert() public { + function test_RevertWhen_ZeroOnRampAddress() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -250,7 +250,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); } - function test_RouterAddress_Revert() public { + function test_RevertWhen_RouterAddress() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: IRouter(address(0)), @@ -263,7 +263,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); } - function test_ZeroSourceChainSelector_Revert() public { + function test_RevertWhen_ZeroSourceChainSelector() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, @@ -276,7 +276,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { s_offRamp.applySourceChainConfigUpdates(sourceChainConfigs); } - function test_InvalidOnRampUpdate_Revert() public { + function test_RevertWhen_InvalidOnRampUpdate() public { OffRamp.SourceChainConfigArgs[] memory sourceChainConfigs = new OffRamp.SourceChainConfigArgs[](1); sourceChainConfigs[0] = OffRamp.SourceChainConfigArgs({ router: s_destRouter, diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.batchExecute.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.batchExecute.t.sol index aef54612945..3055d38c874 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.batchExecute.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.batchExecute.t.sol @@ -15,7 +15,7 @@ contract OffRamp_batchExecute is OffRampSetup { s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); } - function test_SingleReport_Success() public { + function test_SingleReport() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -37,7 +37,7 @@ contract OffRamp_batchExecute is OffRampSetup { assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), nonceBefore); } - function test_MultipleReportsSameChain_Success() public { + function test_MultipleReportsSameChain() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); @@ -87,7 +87,7 @@ contract OffRamp_batchExecute is OffRampSetup { assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages1[0].sender), nonceBefore); } - function test_MultipleReportsDifferentChains_Success() public { + function test_MultipleReportsDifferentChains() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); @@ -143,7 +143,7 @@ contract OffRamp_batchExecute is OffRampSetup { assertGt(nonceChain3, 0); } - function test_MultipleReportsDifferentChainsSkipCursedChain_Success() public { + function test_MultipleReportsDifferentChainsSkipCursedChain() public { _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); @@ -182,7 +182,7 @@ contract OffRamp_batchExecute is OffRampSetup { } } - function test_MultipleReportsSkipDuplicate_Success() public { + function test_MultipleReportsSkipDuplicate() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -205,7 +205,7 @@ contract OffRamp_batchExecute is OffRampSetup { ); } - function test_Unhealthy_Success() public { + function test_Unhealthy() public { _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); vm.expectEmit(); emit OffRamp.SkippedReportExecution(SOURCE_CHAIN_SELECTOR_1); @@ -230,12 +230,12 @@ contract OffRamp_batchExecute is OffRampSetup { } // Reverts - function test_ZeroReports_Revert() public { + function test_RevertWhen_ZeroReports() public { vm.expectRevert(OffRamp.EmptyBatch.selector); s_offRamp.batchExecute(new Internal.ExecutionReport[](0), new OffRamp.GasLimitOverride[][](1)); } - function test_OutOfBoundsGasLimitsAccess_Revert() public { + function test_RevertWhen_OutOfBoundsGasLimitsAccess() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.commit.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.commit.t.sol index 7cfb9cd36b7..2a78d76d813 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.commit.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.commit.t.sol @@ -20,7 +20,7 @@ contract OffRamp_commit is OffRampSetup { s_latestSequenceNumber = uint64(uint256(s_configDigestCommit)); } - function test_ReportAndPriceUpdate_Success() public { + function test_ReportAndPriceUpdate() public { OffRamp.CommitReport memory commitReport = _constructCommitReport(); vm.expectEmit(); @@ -64,7 +64,7 @@ contract OffRamp_commit is OffRampSetup { assertEq(block.timestamp, s_offRamp.getMerkleRoot(SOURCE_CHAIN_SELECTOR_1, root)); } - function test_RootWithRMNDisabled_success() public { + function test_RootWithRMNDisabled() public { // force RMN verification to fail vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); @@ -101,7 +101,7 @@ contract OffRamp_commit is OffRampSetup { assertEq(block.timestamp, s_offRamp.getMerkleRoot(SOURCE_CHAIN_SELECTOR_1, root)); } - function test_StaleReportWithRoot_Success() public { + function test_StaleReportWithRoot() public { uint64 maxSeq = 12; uint224 tokenStartPrice = IFeeQuoter(s_offRamp.getDynamicConfig().feeQuoter).getTokenPrice(s_sourceFeeToken).value; @@ -144,7 +144,7 @@ contract OffRamp_commit is OffRampSetup { assertEq(tokenStartPrice, IFeeQuoter(s_offRamp.getDynamicConfig().feeQuoter).getTokenPrice(s_sourceFeeToken).value); } - function test_OnlyTokenPriceUpdates_Success() public { + function test_OnlyTokenPriceUpdates() public { // force RMN verification to fail vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); @@ -166,7 +166,7 @@ contract OffRamp_commit is OffRampSetup { assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); } - function test_OnlyGasPriceUpdates_Success() public { + function test_OnlyGasPriceUpdates() public { // force RMN verification to fail vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); @@ -187,7 +187,7 @@ contract OffRamp_commit is OffRampSetup { assertEq(s_latestSequenceNumber, s_offRamp.getLatestPriceSequenceNumber()); } - function test_PriceSequenceNumberCleared_Success() public { + function test_PriceSequenceNumberCleared() public { Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), @@ -236,7 +236,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_ValidPriceUpdateThenStaleReportWithRoot_Success() public { + function test_ValidPriceUpdateThenStaleReportWithRoot() public { uint64 maxSeq = 12; uint224 tokenPrice1 = 4e18; uint224 tokenPrice2 = 5e18; @@ -282,7 +282,7 @@ contract OffRamp_commit is OffRampSetup { // Reverts - function test_UnauthorizedTransmitter_Revert() public { + function test_RevertWhen_UnauthorizedTransmitter() public { OffRamp.CommitReport memory commitReport = _constructCommitReport(); bytes32[2] memory reportContext = [s_configDigestCommit, bytes32(uint256(s_latestSequenceNumber))]; @@ -294,7 +294,7 @@ contract OffRamp_commit is OffRampSetup { s_offRamp.commit(reportContext, abi.encode(commitReport), rs, ss, rawVs); } - function test_NoConfig_Revert() public { + function test_RevertWhen_NoConfig() public { _redeployOffRampWithNoOCRConfigs(); OffRamp.CommitReport memory commitReport = _constructCommitReport(); @@ -308,7 +308,7 @@ contract OffRamp_commit is OffRampSetup { s_offRamp.commit(reportContext, abi.encode(commitReport), rs, ss, rawVs); } - function test_NoConfigWithOtherConfigPresent_Revert() public { + function test_RevertWhen_NoConfigWithOtherConfigPresent() public { _redeployOffRampWithNoOCRConfigs(); MultiOCR3Base.OCRConfigArgs[] memory ocrConfigs = new MultiOCR3Base.OCRConfigArgs[](1); @@ -333,7 +333,7 @@ contract OffRamp_commit is OffRampSetup { s_offRamp.commit(reportContext, abi.encode(commitReport), rs, ss, rawVs); } - function test_FailedRMNVerification_Reverts() public { + function test_RevertWhen_FailedRMNVerifications() public { // force RMN verification to fail vm.mockCallRevert(address(s_mockRMNRemote), abi.encodeWithSelector(IRMNRemote.verify.selector), bytes("")); @@ -342,7 +342,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_Unhealthy_Revert() public { + function test_RevertWhen_Unhealthy() public { _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); roots[0] = Internal.MerkleRoot({ @@ -360,7 +360,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_InvalidRootRevert() public { + function test_RevertWhen_InvalidRoot() public { Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); roots[0] = Internal.MerkleRoot({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, @@ -376,7 +376,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_InvalidInterval_Revert() public { + function test_RevertWhen_InvalidInterval() public { Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); roots[0] = Internal.MerkleRoot({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, @@ -396,7 +396,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_InvalidIntervalMinLargerThanMax_Revert() public { + function test_RevertWhen_InvalidIntervalMinLargerThanMax() public { s_offRamp.getSourceChainConfig(SOURCE_CHAIN_SELECTOR); Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); roots[0] = Internal.MerkleRoot({ @@ -417,7 +417,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_ZeroEpochAndRound_Revert() public { + function test_RevertWhen_ZeroEpochAndRound() public { Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), @@ -429,7 +429,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, 0); } - function test_OnlyPriceUpdateStaleReport_Revert() public { + function test_RevertWhen_OnlyPriceUpdateStaleReport() public { Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](0); OffRamp.CommitReport memory commitReport = OffRamp.CommitReport({ priceUpdates: _getSingleTokenPriceUpdateStruct(s_sourceFeeToken, 4e18), @@ -445,7 +445,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_SourceChainNotEnabled_Revert() public { + function test_RevertWhen_SourceChainNotEnabled() public { Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); roots[0] = Internal.MerkleRoot({ sourceChainSelector: 0, @@ -462,7 +462,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, s_latestSequenceNumber); } - function test_RootAlreadyCommitted_Revert() public { + function test_RevertWhen_RootAlreadyCommitted() public { Internal.MerkleRoot[] memory roots = new Internal.MerkleRoot[](1); roots[0] = Internal.MerkleRoot({ sourceChainSelector: SOURCE_CHAIN_SELECTOR_1, @@ -484,7 +484,7 @@ contract OffRamp_commit is OffRampSetup { _commit(commitReport, ++s_latestSequenceNumber); } - function test_CommitOnRampMismatch_Revert() public { + function test_RevertWhen_CommitOnRampMismatch() public { OffRamp.CommitReport memory commitReport = _constructCommitReport(); commitReport.merkleRoots[0].onRampAddress = ON_RAMP_ADDRESS_2; diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.constructor.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.constructor.t.sol index d31b7939d9c..a62a57b68cd 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.constructor.t.sol @@ -10,7 +10,7 @@ import {OffRampHelper} from "../../helpers/OffRampHelper.sol"; import {OffRampSetup} from "./OffRampSetup.t.sol"; contract OffRamp_constructor is OffRampSetup { - function test_Constructor_Success() public { + function test_Constructor() public { OffRamp.StaticConfig memory staticConfig = OffRamp.StaticConfig({ chainSelector: DEST_CHAIN_SELECTOR, gasForCallExactCheck: GAS_FOR_CALL_EXACT_CHECK, @@ -126,7 +126,7 @@ contract OffRamp_constructor is OffRampSetup { } // Revert - function test_ZeroOnRampAddress_Revert() public { + function test_RevertWhen_ZeroOnRampAddress() public { uint64[] memory sourceChainSelectors = new uint64[](1); sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; @@ -153,7 +153,7 @@ contract OffRamp_constructor is OffRampSetup { ); } - function test_SourceChainSelector_Revert() public { + function test_RevertWhen_SourceChainSelector() public { uint64[] memory sourceChainSelectors = new uint64[](1); sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; @@ -180,7 +180,7 @@ contract OffRamp_constructor is OffRampSetup { ); } - function test_ZeroRMNRemote_Revert() public { + function test_RevertWhen_ZeroRMNRemote() public { uint64[] memory sourceChainSelectors = new uint64[](1); sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; @@ -201,7 +201,7 @@ contract OffRamp_constructor is OffRampSetup { ); } - function test_ZeroChainSelector_Revert() public { + function test_RevertWhen_ZeroChainSelector() public { uint64[] memory sourceChainSelectors = new uint64[](1); sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; @@ -222,7 +222,7 @@ contract OffRamp_constructor is OffRampSetup { ); } - function test_ZeroTokenAdminRegistry_Revert() public { + function test_RevertWhen_ZeroTokenAdminRegistry() public { uint64[] memory sourceChainSelectors = new uint64[](1); sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; @@ -243,7 +243,7 @@ contract OffRamp_constructor is OffRampSetup { ); } - function test_ZeroNonceManager_Revert() public { + function test_RevertWhen_ZeroNonceManager() public { uint64[] memory sourceChainSelectors = new uint64[](1); sourceChainSelectors[0] = SOURCE_CHAIN_SELECTOR_1; diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.execute.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.execute.t.sol index f12ca7b4609..ee46221f60f 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.execute.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.execute.t.sol @@ -18,7 +18,7 @@ contract OffRamp_execute is OffRampSetup { } // Asserts that execute completes - function test_SingleReport_Success() public { + function test_SingleReport() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); Internal.ExecutionReport[] memory reports = _generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); @@ -42,7 +42,7 @@ contract OffRamp_execute is OffRampSetup { ); } - function test_MultipleReports_Success() public { + function test_MultipleReports() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); @@ -95,7 +95,7 @@ contract OffRamp_execute is OffRampSetup { ); } - function test_LargeBatch_Success() public { + function test_LargeBatch() public { Internal.ExecutionReport[] memory reports = new Internal.ExecutionReport[](10); for (uint64 i = 0; i < reports.length; ++i) { Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](3); @@ -131,7 +131,7 @@ contract OffRamp_execute is OffRampSetup { } } - function test_MultipleReportsWithPartialValidationFailures_Success() public { + function test_MultipleReportsWithPartialValidationFailures() public { _enableInboundMessageInterceptor(); Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); @@ -197,7 +197,7 @@ contract OffRamp_execute is OffRampSetup { // Reverts - function test_UnauthorizedTransmitter_Revert() public { + function test_RevertWhen_UnauthorizedTransmitter() public { bytes32[2] memory reportContext = [s_configDigestExec, s_configDigestExec]; Internal.Any2EVMRampMessage[] memory messages = @@ -208,7 +208,7 @@ contract OffRamp_execute is OffRampSetup { s_offRamp.execute(reportContext, abi.encode(reports)); } - function test_NoConfig_Revert() public { + function test_RevertWhen_NoConfig() public { _redeployOffRampWithNoOCRConfigs(); s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); @@ -223,7 +223,7 @@ contract OffRamp_execute is OffRampSetup { s_offRamp.execute(reportContext, abi.encode(reports)); } - function test_NoConfigWithOtherConfigPresent_Revert() public { + function test_RevertWhen_NoConfigWithOtherConfigPresent() public { _redeployOffRampWithNoOCRConfigs(); s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); @@ -249,7 +249,7 @@ contract OffRamp_execute is OffRampSetup { s_offRamp.execute(reportContext, abi.encode(reports)); } - function test_WrongConfigWithSigners_Revert() public { + function test_RevertWhen_WrongConfigWithSigners() public { _redeployOffRampWithNoOCRConfigs(); s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 1); @@ -269,14 +269,14 @@ contract OffRamp_execute is OffRampSetup { s_offRamp.setOCR3Configs(ocrConfigs); } - function test_ZeroReports_Revert() public { + function test_RevertWhen_ZeroReports() public { Internal.ExecutionReport[] memory reports = new Internal.ExecutionReport[](0); vm.expectRevert(OffRamp.EmptyBatch.selector); _execute(reports); } - function test_IncorrectArrayType_Revert() public { + function test_RevertWhen_IncorrectArrayType() public { bytes32[2] memory reportContext = [s_configDigestExec, s_configDigestExec]; uint256[] memory wrongData = new uint256[](2); @@ -287,7 +287,7 @@ contract OffRamp_execute is OffRampSetup { s_offRamp.execute(reportContext, abi.encode(wrongData)); } - function test_NonArray_Revert() public { + function test_RevertWhen_NonArray() public { bytes32[2] memory reportContext = [s_configDigestExec, s_configDigestExec]; Internal.Any2EVMRampMessage[] memory messages = diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleMessage.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleMessage.t.sol index 20b711f529e..4781ea07e53 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleMessage.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleMessage.t.sol @@ -106,7 +106,7 @@ contract OffRamp_executeSingleMessage is OffRampSetup { // Reverts - function test_executeSingleMessage_RevertWhen_TokenHandlingError() public { + function test_RevertWhen_executeSingleMessageWhen_TokenHandlingError() public { Internal.Any2EVMRampMessage memory message = _generateAny2EVMMessageWithMaybeRevertingSingleToken(1, 50); address destPool = s_destPoolByToken[message.tokenAmounts[0].destTokenAddress]; @@ -119,7 +119,7 @@ contract OffRamp_executeSingleMessage is OffRampSetup { s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); } - function test_executeSingleMessage_RevertWhen_ZeroGasDONExecution() public { + function test_RevertWhen_executeSingleMessageWhen_ZeroGasDONExecution() public { Internal.Any2EVMRampMessage memory message = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); message.gasLimit = 0; @@ -129,7 +129,7 @@ contract OffRamp_executeSingleMessage is OffRampSetup { s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); } - function test_executeSingleMessage_RevertWhen_MessageSender() public { + function test_RevertWhen_executeSingleMessageWhen_MessageSender() public { vm.stopPrank(); Internal.Any2EVMRampMessage memory message = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); @@ -137,7 +137,7 @@ contract OffRamp_executeSingleMessage is OffRampSetup { s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); } - function test_executeSingleMessage_RevertWhen_MessageValidationError() public { + function test_RevertWhen_executeSingleMessageWhen_MessageValidationError() public { vm.stopPrank(); vm.startPrank(OWNER); _enableInboundMessageInterceptor(); @@ -154,7 +154,7 @@ contract OffRamp_executeSingleMessage is OffRampSetup { s_offRamp.executeSingleMessage(message, new bytes[](message.tokenAmounts.length), new uint32[](0)); } - function test_executeSingleMessage_RevertWhen_WithFailingValidationNoRouterCall() public { + function test_RevertWhen_executeSingleMessageWhen_WithFailingValidationNoRouterCall() public { vm.stopPrank(); vm.startPrank(OWNER); _enableInboundMessageInterceptor(); diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleReport.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleReport.t.sol index 7facff30cc4..2251cf01d9d 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleReport.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.executeSingleReport.t.sol @@ -22,7 +22,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); } - function test_SingleMessageNoTokens_Success() public { + function test_SingleMessageNoTokens() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -59,7 +59,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { assertGt(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messages[0].sender), nonceBefore); } - function test_SingleMessageNoTokensUnordered_Success() public { + function test_SingleMessageNoTokensUnordered() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); messages[0].header.nonce = 0; @@ -110,7 +110,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_SingleMessageNoTokensOtherChain_Success() public { + function test_SingleMessageNoTokensOtherChain() public { Internal.Any2EVMRampMessage[] memory messagesChain1 = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); s_offRamp.executeSingleReport( @@ -133,7 +133,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { assertEq(s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, messagesChain1[0].sender), nonceChain1); } - function test_ReceiverError_Success() public { + function test_ReceiverError() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -165,7 +165,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { assertEq(uint64(1), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); } - function test_SkippedIncorrectNonce_Success() public { + function test_SkippedIncorrectNonce() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -182,7 +182,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_SkippedIncorrectNonceStillExecutes_Success() public { + function test_SkippedIncorrectNonceStillExecutes() public { Internal.Any2EVMRampMessage[] memory messages = _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -206,7 +206,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test__execute_SkippedAlreadyExecutedMessage_Success() public { + function test__execute_SkippedAlreadyExecutedMessage() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -231,7 +231,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test__execute_SkippedAlreadyExecutedMessageUnordered_Success() public { + function test__execute_SkippedAlreadyExecutedMessageUnordered() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); messages[0].header.nonce = 0; @@ -260,7 +260,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { // Send a message to a contract that does not implement the CCIPReceiver interface // This should execute successfully. - function test_SingleMessageToNonCCIPReceiver_Success() public { + function test_SingleMessageToNonCCIPReceiver() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); MaybeRevertMessageReceiverNo165 newReceiver = new MaybeRevertMessageReceiverNo165(true); @@ -337,7 +337,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_TwoMessagesWithTokensAndGE_Success() public { + function test_TwoMessagesWithTokensAndGE() public { Internal.Any2EVMRampMessage[] memory messages = _generateMessagesWithTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); // Set message 1 to use another receiver to simulate more fair gas costs @@ -456,7 +456,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_WithCurseOnAnotherSourceChain_Success() public { + function test_WithCurseOnAnotherSourceChain() public { _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_2, true); s_offRamp.executeSingleReport( _generateReportFromMessages( @@ -466,7 +466,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_Unhealthy_Success() public { + function test_Unhealthy() public { _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); vm.expectEmit(); @@ -492,7 +492,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { // Reverts - function test_MismatchingDestChainSelector_Revert() public { + function test_RevertWhen_MismatchingDestChainSelector() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_3, ON_RAMP_ADDRESS_3); messages[0].header.destChainSelector = DEST_CHAIN_SELECTOR + 1; @@ -505,7 +505,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { s_offRamp.executeSingleReport(executionReport, new OffRamp.GasLimitOverride[](0)); } - function test_UnhealthySingleChainCurse_Revert() public { + function test_RevertWhen_UnhealthySingleChainCurse() public { _setMockRMNChainCurse(SOURCE_CHAIN_SELECTOR_1, true); vm.expectEmit(); emit OffRamp.SkippedReportExecution(SOURCE_CHAIN_SELECTOR_1); @@ -527,7 +527,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { _assertNoEmit(OffRamp.SkippedReportExecution.selector); } - function test_UnexpectedTokenData_Revert() public { + function test_RevertWhen_UnexpectedTokenData() public { Internal.ExecutionReport memory report = _generateReportFromMessages( SOURCE_CHAIN_SELECTOR_1, _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1) ); @@ -538,7 +538,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { s_offRamp.executeSingleReport(report, new OffRamp.GasLimitOverride[](0)); } - function test_EmptyReport_Revert() public { + function test_RevertWhen_EmptyReport() public { vm.expectRevert(abi.encodeWithSelector(OffRamp.EmptyReport.selector, SOURCE_CHAIN_SELECTOR_1)); s_offRamp.executeSingleReport( @@ -553,7 +553,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_RootNotCommitted_Revert() public { + function test_RevertWhen_RootNotCommitted() public { s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, 0); vm.expectRevert(abi.encodeWithSelector(OffRamp.RootNotCommitted.selector, SOURCE_CHAIN_SELECTOR_1)); @@ -564,7 +564,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_ManualExecutionNotYetEnabled_Revert() public { + function test_RevertWhen_ManualExecutionNotYetEnabled() public { s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_1, BLOCK_TIME); vm.expectRevert(abi.encodeWithSelector(OffRamp.ManualExecutionNotYetEnabled.selector, SOURCE_CHAIN_SELECTOR_1)); @@ -576,7 +576,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_NonExistingSourceChain_Revert() public { + function test_RevertWhen_NonExistingSourceChain() public { uint64 newSourceChainSelector = SOURCE_CHAIN_SELECTOR_1 + 1; bytes memory newOnRamp = abi.encode(ON_RAMP_ADDRESS, 1); @@ -588,7 +588,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_DisabledSourceChain_Revert() public { + function test_RevertWhen_DisabledSourceChain() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_2, ON_RAMP_ADDRESS_2); @@ -598,7 +598,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_TokenDataMismatch_Revert() public { + function test_RevertWhen_TokenDataMismatch() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); Internal.ExecutionReport memory report = _generateReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages); @@ -613,7 +613,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { s_offRamp.executeSingleReport(report, new OffRamp.GasLimitOverride[](0)); } - function test_RouterYULCall_Revert() public { + function test_RevertWhen_RouterYULCall() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -636,7 +636,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { ); } - function test_RetryFailedMessageWithoutManualExecution_Revert() public { + function test_RevertWhen_RetryFailedMessageWithoutManualExecution() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.getExecutionState.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.getExecutionState.t.sol index ac9cfe86cd9..6e239fa1377 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.getExecutionState.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.getExecutionState.t.sol @@ -32,7 +32,7 @@ contract OffRamp_getExecutionState is OffRampSetup { } } - function test_GetExecutionState_Success() public { + function test_GetExecutionState() public { s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 0, Internal.MessageExecutionState.FAILURE); assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3); @@ -72,7 +72,7 @@ contract OffRamp_getExecutionState is OffRampSetup { ); } - function test_GetDifferentChainExecutionState_Success() public { + function test_GetDifferentChainExecutionState() public { s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, 0, Internal.MessageExecutionState.FAILURE); assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1, 0), 3); assertEq(s_offRamp.getExecutionStateBitMap(SOURCE_CHAIN_SELECTOR_1 + 1, 0), 0); @@ -119,7 +119,7 @@ contract OffRamp_getExecutionState is OffRampSetup { ); } - function test_FillExecutionState_Success() public { + function test_FillExecutionState() public { for (uint64 i = 0; i < 384; ++i) { s_offRamp.setExecutionStateHelper(SOURCE_CHAIN_SELECTOR_1, i, Internal.MessageExecutionState.FAILURE); } diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.manuallyExecute.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.manuallyExecute.t.sol index 0422053bdd7..4fff911237a 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.manuallyExecute.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.manuallyExecute.t.sol @@ -23,7 +23,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.setVerifyOverrideResult(SOURCE_CHAIN_SELECTOR_3, 1); } - function test_manuallyExecute_Success() public { + function test_manuallyExecute() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); messages[0].receiver = address(s_reverting_receiver); @@ -49,7 +49,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { ); } - function test_manuallyExecute_WithGasOverride_Success() public { + function test_manuallyExecute_WithGasOverride() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); messages[0].receiver = address(s_reverting_receiver); @@ -75,7 +75,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { ); } - function test_manuallyExecute_DoesNotRevertIfUntouched_Success() public { + function test_manuallyExecute_DoesNotRevertIfUntouched() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); messages[0].receiver = address(s_reverting_receiver); @@ -108,7 +108,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { ); } - function test_manuallyExecute_WithMultiReportGasOverride_Success() public { + function test_manuallyExecute_WithMultiReportGasOverride() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](3); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](2); @@ -174,7 +174,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { } } - function test_manuallyExecute_WithPartialMessages_Success() public { + function test_manuallyExecute_WithPartialMessages() public { Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](3); for (uint64 i = 0; i < 3; ++i) { @@ -246,7 +246,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { ); } - function test_manuallyExecute_LowGasLimit_Success() public { + function test_manuallyExecute_LowGasLimit() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); messages[0].gasLimit = 1; @@ -287,7 +287,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { // Reverts - function test_manuallyExecute_ForkedChain_Revert() public { + function test_RevertWhen_manuallyExecute_ForkedChain() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -303,7 +303,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(reports, gasLimitOverrides); } - function test_ManualExecGasLimitMismatchSingleReport_Revert() public { + function test_RevertWhen_ManualExecGasLimitMismatchSingleReport() public { Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](2); messages[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); messages[1] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 2); @@ -333,7 +333,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(reports, gasLimitOverrides); } - function test_manuallyExecute_GasLimitMismatchMultipleReports_Revert() public { + function test_RevertWhen_manuallyExecute_GasLimitMismatchMultipleReports() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](2); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); @@ -376,7 +376,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(reports, gasLimitOverrides); } - function test_manuallyExecute_InvalidReceiverExecutionGasLimit_Revert() public { + function test_RevertWhen_manuallyExecute_InvalidReceiverExecutionGasLimit() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -395,7 +395,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); } - function test_manuallyExecute_DestinationGasAmountCountMismatch_Revert() public { + function test_RevertWhen_manuallyExecute_DestinationGasAmountCountMismatch() public { uint256[] memory amounts = new uint256[](2); amounts[0] = 1000; amounts[1] = 1000; @@ -418,7 +418,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); } - function test_manuallyExecute_InvalidTokenGasOverride_Revert() public { + function test_RevertWhen_manuallyExecute_InvalidTokenGasOverride() public { uint256[] memory amounts = new uint256[](2); amounts[0] = 1000; amounts[1] = 1000; @@ -444,7 +444,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); } - function test_manuallyExecute_FailedTx_Revert() public { + function test_RevertWhen_manuallyExecute_FailedTx() public { Internal.Any2EVMRampMessage[] memory messages = _generateSingleBasicMessage(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1); @@ -473,7 +473,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(_generateBatchReportFromMessages(SOURCE_CHAIN_SELECTOR_1, messages), gasLimitOverrides); } - function test_manuallyExecute_ReentrancyFails_Success() public { + function test_manuallyExecute_ReentrancyFails() public { uint256 tokenAmount = 1e9; IERC20 tokenToAbuse = IERC20(s_destFeeToken); @@ -531,7 +531,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { assertEq(tokenToAbuse.balanceOf(address(receiver)), balancePre + tokenAmount); } - function test_manuallyExecute_MultipleReportsWithSingleCursedLane_Revert() public { + function test_RevertWhen_manuallyExecute_MultipleReportsWithSingleCursedLane() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](3); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](2); @@ -562,7 +562,7 @@ contract OffRamp_manuallyExecute is OffRampSetup { s_offRamp.manuallyExecute(reports, gasLimitOverrides); } - function test_manuallyExecute_SourceChainSelectorMismatch_Revert() public { + function test_RevertWhen_manuallyExecute_SourceChainSelectorMismatch() public { Internal.Any2EVMRampMessage[] memory messages1 = new Internal.Any2EVMRampMessage[](1); Internal.Any2EVMRampMessage[] memory messages2 = new Internal.Any2EVMRampMessage[](1); messages1[0] = _generateAny2EVMMessageNoTokens(SOURCE_CHAIN_SELECTOR_1, ON_RAMP_ADDRESS_1, 1); diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintSingleToken.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintSingleToken.t.sol index f35db67abf6..25b6f6827cb 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintSingleToken.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintSingleToken.t.sol @@ -17,7 +17,7 @@ contract OffRamp_releaseOrMintSingleToken is OffRampSetup { _setupMultipleOffRamps(); } - function test__releaseOrMintSingleToken_Success() public { + function test__releaseOrMintSingleToken() public { uint256 amount = 123123; address token = s_sourceTokens[0]; bytes memory originalSender = abi.encode(OWNER); @@ -56,7 +56,7 @@ contract OffRamp_releaseOrMintSingleToken is OffRampSetup { assertEq(startingBalance + amount, dstToken1.balanceOf(OWNER)); } - function test_releaseOrMintToken_InvalidDataLength_Revert() public { + function test_RevertWhen_releaseOrMintToken_InvalidDataLength() public { uint256 amount = 123123; address token = s_sourceTokens[0]; @@ -78,7 +78,7 @@ contract OffRamp_releaseOrMintSingleToken is OffRampSetup { s_offRamp.releaseOrMintSingleToken(tokenAmount, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR, ""); } - function test_releaseOrMintToken_RevertWhen_TokenHandlingError_BalanceOf() public { + function test_RevertWhen_releaseOrMintTokenWhen_TokenHandlingError_BalanceOf() public { uint256 amount = 123123; address token = s_sourceTokens[0]; address destTokenAddress = s_destTokenBySourceToken[token]; @@ -101,7 +101,7 @@ contract OffRamp_releaseOrMintSingleToken is OffRampSetup { s_offRamp.releaseOrMintSingleToken(tokenAmount, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR, ""); } - function test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() public { + function test_RevertWhen_releaseOrMintToken_ReleaseOrMintBalanceMismatch() public { uint256 amount = 123123; address token = s_sourceTokens[0]; uint256 mockedStaticBalance = 50000; @@ -129,7 +129,7 @@ contract OffRamp_releaseOrMintSingleToken is OffRampSetup { s_offRamp.releaseOrMintSingleToken(tokenAmount, abi.encode(OWNER), OWNER, SOURCE_CHAIN_SELECTOR, ""); } - function test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() public { + function test_RevertWhen_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool() public { uint256 amount = 123123; address token = s_sourceTokens[0]; uint256 mockedStaticBalance = 50000; @@ -154,7 +154,7 @@ contract OffRamp_releaseOrMintSingleToken is OffRampSetup { ); } - function test__releaseOrMintSingleToken_NotACompatiblePool_Revert() public { + function test_RevertWhen__releaseOrMintSingleToken_NotACompatiblePool() public { uint256 amount = 123123; address token = s_sourceTokens[0]; address destToken = s_destTokenBySourceToken[token]; @@ -197,7 +197,7 @@ contract OffRamp_releaseOrMintSingleToken is OffRampSetup { s_offRamp.releaseOrMintSingleToken(tokenAmount, originalSender, OWNER, SOURCE_CHAIN_SELECTOR_1, offchainTokenData); } - function test_releaseOrMintSingleToken_RevertWhen_TokenHandlingError_transfer() public { + function test_RevertWhen_releaseOrMintSingleTokenWhen_TokenHandlingError_transfer() public { address receiver = makeAddr("receiver"); uint256 amount = 123123; address token = s_sourceTokens[0]; diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintTokens.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintTokens.t.sol index d2636ee08c8..fb277faab8b 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintTokens.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.releaseOrMintTokens.t.sol @@ -118,7 +118,7 @@ contract OffRamp_releaseOrMintTokens is OffRampSetup { // Revert - function test_releaseOrMintTokens_RevertWhen_TokenHandlingError() public { + function test_RevertWhen_releaseOrMintTokensWhen_TokenHandlingError() public { Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); bytes memory unknownError = bytes("unknown error"); @@ -138,7 +138,7 @@ contract OffRamp_releaseOrMintTokens is OffRampSetup { ); } - function test_releaseOrMintTokens_RevertWhenInvalidDataLengthReturnData() public { + function test_RevertWhen_releaseOrMintTokensWhenInvalidDataLengthReturnData() public { uint256 amount = 100; Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); srcTokenAmounts[0].amount = amount; @@ -172,7 +172,7 @@ contract OffRamp_releaseOrMintTokens is OffRampSetup { ); } - function test_releaseOrMintTokens_RevertWhen_PoolIsNotAPool() public { + function test_RevertWhen_releaseOrMintTokensWhen_PoolIsNotAPool() public { // The offRamp is a contract, but not a pool address fakePoolAddress = address(s_offRamp); @@ -191,7 +191,7 @@ contract OffRamp_releaseOrMintTokens is OffRampSetup { ); } - function test_releaseOrMintTokens_RevertWhenPoolDoesNotSupportDest() public { + function test_RevertWhen_releaseOrMintTokensWhenPoolDoesNotSupportDest() public { Client.EVMTokenAmount[] memory srcTokenAmounts = _getCastedSourceEVMTokenAmountsWithZeroAmounts(); uint256 amount1 = 100; srcTokenAmounts[0].amount = amount1; diff --git a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.setDynamicConfig.t.sol b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.setDynamicConfig.t.sol index 384d9b446aa..cb7b3d56444 100644 --- a/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.setDynamicConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/offRamp/OffRamp/OffRamp.setDynamicConfig.t.sol @@ -6,7 +6,7 @@ import {OffRamp} from "../../../offRamp/OffRamp.sol"; import {OffRampSetup} from "./OffRampSetup.t.sol"; contract OffRamp_setDynamicConfig is OffRampSetup { - function test_SetDynamicConfig_Success() public { + function test_SetDynamicConfig() public { OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(s_feeQuoter)); vm.expectEmit(); @@ -18,7 +18,7 @@ contract OffRamp_setDynamicConfig is OffRampSetup { _assertSameConfig(dynamicConfig, newConfig); } - function test_SetDynamicConfigWithInterceptor_Success() public { + function test_SetDynamicConfigWithInterceptor() public { OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(s_feeQuoter)); dynamicConfig.messageInterceptor = address(s_inboundMessageInterceptor); @@ -33,7 +33,7 @@ contract OffRamp_setDynamicConfig is OffRampSetup { // Reverts - function test_NonOwner_Revert() public { + function test_RevertWhen_NonOwner() public { vm.startPrank(STRANGER); OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(s_feeQuoter)); @@ -42,7 +42,7 @@ contract OffRamp_setDynamicConfig is OffRampSetup { s_offRamp.setDynamicConfig(dynamicConfig); } - function test_FeeQuoterZeroAddress_Revert() public { + function test_RevertWhen_FeeQuoterZeroAddress() public { OffRamp.DynamicConfig memory dynamicConfig = _generateDynamicOffRampConfig(address(0)); vm.expectRevert(OffRamp.ZeroAddressNotAllowed.selector); diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.applyDestChainConfigUpdates.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.applyDestChainConfigUpdates.t.sol index 2b99fd423be..05099447b83 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.applyDestChainConfigUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.applyDestChainConfigUpdates.t.sol @@ -7,7 +7,7 @@ import {OnRamp} from "../../../onRamp/OnRamp.sol"; import {OnRampSetup} from "./OnRampSetup.t.sol"; contract OnRamp_applyDestChainConfigUpdates is OnRampSetup { - function test_ApplyDestChainConfigUpdates_Success() external { + function test_ApplyDestChainConfigUpdates() external { OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](1); configArgs[0].destChainSelector = DEST_CHAIN_SELECTOR; @@ -53,7 +53,7 @@ contract OnRamp_applyDestChainConfigUpdates is OnRampSetup { assertEq(numLogs, vm.getRecordedLogs().length); // indicates no changes made } - function test_ApplyDestChainConfigUpdates_WithInvalidChainSelector_Revert() external { + function test_RevertWhen_ApplyDestChainConfigUpdates_WithInvalidChainSelector() external { OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](1); configArgs[0].destChainSelector = 0; // invalid vm.expectRevert(abi.encodeWithSelector(OnRamp.InvalidDestChainConfig.selector, 0)); @@ -62,7 +62,7 @@ contract OnRamp_applyDestChainConfigUpdates is OnRampSetup { } contract OnRamp_applyAllowlistUpdates is OnRampSetup { - function test_applyAllowlistUpdates_Success() public { + function test_applyAllowlistUpdates() public { OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](2); configArgs[0] = OnRamp.DestChainConfigArgs({ destChainSelector: DEST_CHAIN_SELECTOR, @@ -162,7 +162,7 @@ contract OnRamp_applyAllowlistUpdates is OnRampSetup { assertTrue(isActive); } - function test_applyAllowlistUpdates_Revert() public { + function test_RevertWhen_applyAllowlistUpdates() public { OnRamp.DestChainConfigArgs[] memory configArgs = new OnRamp.DestChainConfigArgs[](2); configArgs[0] = OnRamp.DestChainConfigArgs({ destChainSelector: DEST_CHAIN_SELECTOR, diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.constructor.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.constructor.t.sol index 1e31a2a1377..19dfed1fde9 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.constructor.t.sol @@ -10,7 +10,7 @@ import {OnRampHelper} from "../../helpers/OnRampHelper.sol"; import {OnRampSetup} from "./OnRampSetup.t.sol"; contract OnRamp_constructor is OnRampSetup { - function test_Constructor_Success() public { + function test_Constructor() public { OnRamp.StaticConfig memory staticConfig = OnRamp.StaticConfig({ chainSelector: SOURCE_CHAIN_SELECTOR, rmnRemote: s_mockRMNRemote, @@ -41,7 +41,7 @@ contract OnRamp_constructor is OnRampSetup { assertEq(1, s_onRamp.getExpectedNextSequenceNumber(DEST_CHAIN_SELECTOR)); } - function test_Constructor_EnableAllowList_ForwardFromRouter_Reverts() public { + function test_RevertWhen_Constructor_EnableAllowList_ForwardFromRouter() public { OnRamp.StaticConfig memory staticConfig = OnRamp.StaticConfig({ chainSelector: SOURCE_CHAIN_SELECTOR, rmnRemote: s_mockRMNRemote, @@ -74,7 +74,7 @@ contract OnRamp_constructor is OnRampSetup { tempOnRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); } - function test_Constructor_InvalidConfigChainSelectorEqZero_Revert() public { + function test_RevertWhen_Constructor_InvalidConfigChainSelectorEqZero() public { vm.expectRevert(OnRamp.InvalidConfig.selector); new OnRampHelper( OnRamp.StaticConfig({ @@ -88,7 +88,7 @@ contract OnRamp_constructor is OnRampSetup { ); } - function test_Constructor_InvalidConfigRMNProxyEqAddressZero_Revert() public { + function test_RevertWhen_Constructor_InvalidConfigRMNProxyEqAddressZero() public { vm.expectRevert(OnRamp.InvalidConfig.selector); s_onRamp = new OnRampHelper( OnRamp.StaticConfig({ @@ -102,7 +102,7 @@ contract OnRamp_constructor is OnRampSetup { ); } - function test_Constructor_InvalidConfigNonceManagerEqAddressZero_Revert() public { + function test_RevertWhen_Constructor_InvalidConfigNonceManagerEqAddressZero() public { vm.expectRevert(OnRamp.InvalidConfig.selector); new OnRampHelper( OnRamp.StaticConfig({ @@ -116,7 +116,7 @@ contract OnRamp_constructor is OnRampSetup { ); } - function test_Constructor_InvalidConfigTokenAdminRegistryEqAddressZero_Revert() public { + function test_RevertWhen_Constructor_InvalidConfigTokenAdminRegistryEqAddressZero() public { vm.expectRevert(OnRamp.InvalidConfig.selector); new OnRampHelper( OnRamp.StaticConfig({ diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.forwardFromRouter.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.forwardFromRouter.t.sol index 7f53f9c5b3c..59783bded26 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.forwardFromRouter.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.forwardFromRouter.t.sol @@ -68,7 +68,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); } - function test_ForwardFromRouter_Success_ConfigurableSourceRouter() public { + function test_ForwardFromRouter_ConfigurableSourceRouter() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.extraArgs = Client._argsToBytes(Client.EVMExtraArgsV1({gasLimit: GAS_LIMIT * 2})); uint256 feeAmount = 1234567890; @@ -117,7 +117,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); } - function test_ForwardFromRouter_Success() public { + function test_ForwardFromRouter() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); uint256 feeAmount = 1234567890; @@ -129,7 +129,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); } - function test_ForwardFromRouterExtraArgsV2_Success() public { + function test_ForwardFromRouterExtraArgsV2() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.extraArgs = abi.encodeWithSelector( Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: false}) @@ -143,7 +143,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); } - function test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() public { + function test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.extraArgs = abi.encodeWithSelector( Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: true}) @@ -157,7 +157,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); } - function test_ShouldIncrementSeqNumAndNonce_Success() public { + function test_ShouldIncrementSeqNumAndNonce() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); for (uint64 i = 1; i < 4; ++i) { @@ -176,7 +176,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { } } - function test_ShouldIncrementNonceOnlyOnOrdered_Success() public { + function test_ShouldIncrementNonceOnlyOnOrdered() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.extraArgs = abi.encodeWithSelector( Client.EVM_EXTRA_ARGS_V2_TAG, Client.EVMExtraArgsV2({gasLimit: GAS_LIMIT * 2, allowOutOfOrderExecution: true}) @@ -281,7 +281,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { ); } - function test_forwardFromRouter_WithInterception_Success() public { + function test_forwardFromRouter_WithInterception() public { _enableOutboundMessageInterceptor(); Client.EVM2AnyMessage memory message = _generateEmptyMessage(); @@ -301,7 +301,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { // Reverts - function test_Paused_Revert() public { + function test_RevertWhen_Paused() public { // We pause by disabling the whitelist vm.stopPrank(); vm.startPrank(OWNER); @@ -310,7 +310,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, OWNER); } - function test_InvalidExtraArgsTag_Revert() public { + function test_RevertWhen_InvalidExtraArgsTag() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.extraArgs = bytes("bad args"); @@ -319,26 +319,26 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); } - function test_Permissions_Revert() public { + function test_RevertWhen_Permissions() public { vm.stopPrank(); vm.startPrank(OWNER); vm.expectRevert(OnRamp.MustBeCalledByRouter.selector); s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, OWNER); } - function test_OriginalSender_Revert() public { + function test_RevertWhen_OriginalSender() public { vm.expectRevert(OnRamp.RouterMustSetOriginalSender.selector); s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, address(0)); } - function test_UnAllowedOriginalSender_Revert() public { + function test_RevertWhen_UnAllowedOriginalSender() public { vm.stopPrank(); vm.startPrank(STRANGER); vm.expectRevert(abi.encodeWithSelector(OnRamp.SenderNotAllowed.selector, STRANGER)); s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, _generateEmptyMessage(), 0, STRANGER); } - function test_MessageInterceptionError_Revert() public { + function test_RevertWhen_MessageInterceptionError() public { _enableOutboundMessageInterceptor(); Client.EVM2AnyMessage memory message = _generateEmptyMessage(); @@ -357,7 +357,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, feeAmount, OWNER); } - function test_MultiCannotSendZeroTokens_Revert() public { + function test_RevertWhen_MultiCannotSendZeroTokens() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.tokenAmounts = new Client.EVMTokenAmount[](1); message.tokenAmounts[0].amount = 0; @@ -366,7 +366,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); } - function test_UnsupportedToken_Revert() public { + function test_RevertWhen_UnsupportedToken() public { address wrongToken = address(1); Client.EVM2AnyMessage memory message = _generateEmptyMessage(); @@ -389,7 +389,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); } - function test_forwardFromRouter_UnsupportedToken_Revert() public { + function test_RevertWhen_forwardFromRouter_UnsupportedToken() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.tokenAmounts = new Client.EVMTokenAmount[](1); message.tokenAmounts[0].amount = 1; @@ -400,7 +400,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, 0, OWNER); } - function test_MesssageFeeTooHigh_Revert() public { + function test_RevertWhen_MesssageFeeTooHigh() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); vm.expectRevert( @@ -410,7 +410,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { s_onRamp.forwardFromRouter(DEST_CHAIN_SELECTOR, message, MAX_MSG_FEES_JUELS + 1, OWNER); } - function test_SourceTokenDataTooLarge_Revert() public { + function test_RevertWhen_SourceTokenDataTooLarge() public { address sourceETH = s_sourceTokens[1]; vm.stopPrank(); vm.startPrank(OWNER); diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getFee.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getFee.t.sol index 63a4c0c322e..7140b29360a 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getFee.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getFee.t.sol @@ -10,7 +10,7 @@ import {OnRampSetup} from "./OnRampSetup.t.sol"; contract OnRamp_getFee is OnRampSetup { using USDPriceWith18Decimals for uint224; - function test_EmptyMessage_Success() public view { + function test_EmptyMessage() public view { address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; @@ -25,7 +25,7 @@ contract OnRamp_getFee is OnRampSetup { } } - function test_SingleTokenMessage_Success() public view { + function test_SingleTokenMessage() public view { address[2] memory testTokens = [s_sourceFeeToken, s_sourceRouter.getWrappedNative()]; uint224[2] memory feeTokenPrices = [s_feeTokenPrice, s_wrappedTokenPrice]; @@ -41,7 +41,7 @@ contract OnRamp_getFee is OnRampSetup { } } - function test_GetFeeOfZeroForTokenMessage_Success() public { + function test_GetFeeOfZeroForTokenMessage() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); uint256 feeAmount = s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); @@ -63,13 +63,13 @@ contract OnRamp_getFee is OnRampSetup { // Reverts - function test_Unhealthy_Revert() public { + function test_RevertWhen_Unhealthy() public { _setMockRMNChainCurse(DEST_CHAIN_SELECTOR, true); vm.expectRevert(abi.encodeWithSelector(OnRamp.CursedByRMN.selector, DEST_CHAIN_SELECTOR)); s_onRamp.getFee(DEST_CHAIN_SELECTOR, _generateEmptyMessage()); } - function test_EnforceOutOfOrder_Revert() public { + function test_RevertWhen_EnforceOutOfOrder() public { // Update dynamic config to enforce allowOutOfOrderExecution = true. vm.stopPrank(); vm.startPrank(OWNER); @@ -87,7 +87,7 @@ contract OnRamp_getFee is OnRampSetup { s_onRamp.getFee(DEST_CHAIN_SELECTOR, message); } - function test_NotAFeeTokenButPricedToken_Revert() public { + function test_RevertWhen_NotAFeeTokenButPricedToken() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.feeToken = s_sourceTokens[1]; diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getSupportedTokens.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getSupportedTokens.t.sol index c04f3cf3d51..997b7fc81d1 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getSupportedTokens.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getSupportedTokens.t.sol @@ -5,7 +5,7 @@ import {OnRamp} from "../../../onRamp/OnRamp.sol"; import {OnRampSetup} from "./OnRampSetup.t.sol"; contract OnRamp_getSupportedTokens is OnRampSetup { - function test_GetSupportedTokens_Revert() public { + function test_RevertWhen_GetSupportedTokens() public { vm.expectRevert(OnRamp.GetSupportedTokensFunctionalityRemovedCheckAdminRegistry.selector); s_onRamp.getSupportedTokens(DEST_CHAIN_SELECTOR); } diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getTokenPool.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getTokenPool.t.sol index 8612ce86e36..81c8757ffcd 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getTokenPool.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.getTokenPool.t.sol @@ -6,7 +6,7 @@ import {OnRampSetup} from "./OnRampSetup.t.sol"; import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; contract OnRamp_getTokenPool is OnRampSetup { - function test_GetTokenPool_Success() public view { + function test_GetTokenPool() public view { assertEq( s_sourcePoolByToken[s_sourceTokens[0]], address(s_onRamp.getPoolBySourceToken(DEST_CHAIN_SELECTOR, IERC20(s_sourceTokens[0]))) diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.setDynamicConfig.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.setDynamicConfig.t.sol index 057ed0a79dd..243f0e028ce 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.setDynamicConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.setDynamicConfig.t.sol @@ -6,7 +6,7 @@ import {OnRamp} from "../../../onRamp/OnRamp.sol"; import {OnRampSetup} from "./OnRampSetup.t.sol"; contract OnRamp_setDynamicConfig is OnRampSetup { - function test_setDynamicConfig_Success() public { + function test_setDynamicConfig() public { OnRamp.StaticConfig memory staticConfig = s_onRamp.getStaticConfig(); OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ feeQuoter: address(23423), @@ -27,7 +27,7 @@ contract OnRamp_setDynamicConfig is OnRampSetup { // Reverts - function test_setDynamicConfig_InvalidConfigFeeQuoterEqAddressZero_Revert() public { + function test_RevertWhen_setDynamicConfig_InvalidConfigFeeQuoterEqAddressZero() public { OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ feeQuoter: address(0), reentrancyGuardEntered: false, @@ -40,7 +40,7 @@ contract OnRamp_setDynamicConfig is OnRampSetup { s_onRamp.setDynamicConfig(newConfig); } - function test_setDynamicConfig_InvalidConfigInvalidConfig_Revert() public { + function test_RevertWhen_setDynamicConfig_InvalidConfigInvalidConfig() public { OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ feeQuoter: address(23423), reentrancyGuardEntered: false, @@ -55,7 +55,7 @@ contract OnRamp_setDynamicConfig is OnRampSetup { s_onRamp.setDynamicConfig(newConfig); } - function test_setDynamicConfig_InvalidConfigFeeAggregatorEqAddressZero_Revert() public { + function test_RevertWhen_setDynamicConfig_InvalidConfigFeeAggregatorEqAddressZero() public { OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ feeQuoter: address(23423), reentrancyGuardEntered: false, @@ -68,13 +68,13 @@ contract OnRamp_setDynamicConfig is OnRampSetup { s_onRamp.setDynamicConfig(newConfig); } - function test_setDynamicConfig_InvalidConfigOnlyOwner_Revert() public { + function test_RevertWhen_setDynamicConfig_InvalidConfigOnlyOwner() public { vm.startPrank(STRANGER); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); s_onRamp.setDynamicConfig(_generateDynamicOnRampConfig(address(2))); } - function test_setDynamicConfig_InvalidConfigReentrancyGuardEnteredEqTrue_Revert() public { + function test_RevertWhen_setDynamicConfig_InvalidConfigReentrancyGuardEnteredEqTrue() public { OnRamp.DynamicConfig memory newConfig = OnRamp.DynamicConfig({ feeQuoter: address(23423), reentrancyGuardEntered: true, diff --git a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.withdrawFeeTokens.t.sol b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.withdrawFeeTokens.t.sol index 2af7242150a..d2230e52b8f 100644 --- a/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.withdrawFeeTokens.t.sol +++ b/contracts/src/v0.8/ccip/test/onRamp/OnRamp/OnRamp.withdrawFeeTokens.t.sol @@ -57,7 +57,7 @@ contract OnRamp_withdrawFeeTokens is OnRampSetup { } } - function test_WithdrawFeeTokens_Success() public { + function test_WithdrawFeeTokens() public { vm.expectEmit(); emit OnRamp.FeeTokenWithdrawn(FEE_AGGREGATOR, s_sourceFeeToken, s_nopFees[s_sourceFeeToken]); diff --git a/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPool.lockOrBurn.t.sol index 44a8f2299af..ab870618dae 100644 --- a/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPool.lockOrBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPool.lockOrBurn.t.sol @@ -9,15 +9,15 @@ import {BurnFromMintTokenPoolSetup} from "./BurnFromMintTokenPoolSetup.t.sol"; import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; contract BurnFromMintTokenPool_lockOrBurn is BurnFromMintTokenPoolSetup { - function test_setup_Success() public view { + function test_setup() public view { assertEq(address(s_burnMintERC20), address(s_pool.getToken())); - assertEq(address(s_mockRMN), s_pool.getRmnProxy()); + assertEq(address(s_mockRMNRemote), s_pool.getRmnProxy()); assertEq(false, s_pool.getAllowListEnabled()); assertEq(type(uint256).max, s_burnMintERC20.allowance(address(s_pool), address(s_pool))); assertEq("BurnFromMintTokenPool 1.5.1", s_pool.typeAndVersion()); } - function test_PoolBurn_Success() public { + function test_PoolBurn() public { uint256 burnAmount = 20_000e18; deal(address(s_burnMintERC20), address(s_pool), burnAmount); @@ -51,8 +51,9 @@ contract BurnFromMintTokenPool_lockOrBurn is BurnFromMintTokenPoolSetup { } // Should not burn tokens if cursed. - function test_PoolBurnRevertNotHealthy_Revert() public { - s_mockRMN.setGlobalCursed(true); + function test_RevertWhen_PoolBurnRevertNotHealthy() public { + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(true)); + uint256 before = s_burnMintERC20.balanceOf(address(s_pool)); vm.startPrank(s_burnMintOnRamp); @@ -70,7 +71,7 @@ contract BurnFromMintTokenPool_lockOrBurn is BurnFromMintTokenPoolSetup { assertEq(s_burnMintERC20.balanceOf(address(s_pool)), before); } - function test_ChainNotAllowed_Revert() public { + function test_RevertWhen_ChainNotAllowed() public { uint64 wrongChainSelector = 8838833; vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); s_pool.releaseOrMint( diff --git a/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPoolSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPoolSetup.t.sol index 98de04ea3fa..d59e95cdb53 100644 --- a/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPoolSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/BurnFromMintTokenPool/BurnFromMintTokenPoolSetup.t.sol @@ -11,7 +11,7 @@ contract BurnFromMintTokenPoolSetup is BurnMintSetup { BurnMintSetup.setUp(); s_pool = new BurnFromMintTokenPool( - s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); s_burnMintERC20.grantMintAndBurnRoles(address(s_pool)); diff --git a/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintSetup.t.sol index 6c5d4dd6369..fda53740351 100644 --- a/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintSetup.t.sol @@ -5,9 +5,9 @@ import {BurnMintERC20} from "../../../../shared/token/ERC20/BurnMintERC20.sol"; import {Router} from "../../../Router.sol"; import {BurnMintTokenPool} from "../../../pools/BurnMintTokenPool.sol"; import {TokenPool} from "../../../pools/TokenPool.sol"; -import {RouterSetup} from "../../router/Router/RouterSetup.t.sol"; +import {BaseTest} from "../../BaseTest.t.sol"; -contract BurnMintSetup is RouterSetup { +contract BurnMintSetup is BaseTest { BurnMintERC20 internal s_burnMintERC20; address internal s_burnMintOffRamp = makeAddr("burn_mint_offRamp"); address internal s_burnMintOnRamp = makeAddr("burn_mint_onRamp"); @@ -16,7 +16,7 @@ contract BurnMintSetup is RouterSetup { address internal s_remoteToken = makeAddr("remote_token"); function setUp() public virtual override { - RouterSetup.setUp(); + super.setUp(); s_burnMintERC20 = new BurnMintERC20("Chainlink Token", "LINK", 18, 0, 0); } diff --git a/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.lockOrBurn.t.sol index e0bbffa9919..91e087c84e4 100644 --- a/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.lockOrBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.lockOrBurn.t.sol @@ -16,7 +16,7 @@ contract BurnMintTokenPoolSetup is BurnMintSetup { BurnMintSetup.setUp(); s_pool = new BurnMintTokenPool( - s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); s_burnMintERC20.grantMintAndBurnRoles(address(s_pool)); @@ -25,14 +25,14 @@ contract BurnMintTokenPoolSetup is BurnMintSetup { } contract BurnMintTokenPool_lockOrBurn is BurnMintTokenPoolSetup { - function test_Setup_Success() public view { + function test_Setup() public view { assertEq(address(s_burnMintERC20), address(s_pool.getToken())); - assertEq(address(s_mockRMN), s_pool.getRmnProxy()); + assertEq(address(s_mockRMNRemote), s_pool.getRmnProxy()); assertEq(false, s_pool.getAllowListEnabled()); assertEq("BurnMintTokenPool 1.5.1", s_pool.typeAndVersion()); } - function test_PoolBurn_Success() public { + function test_PoolBurn() public { uint256 burnAmount = 20_000e18; deal(address(s_burnMintERC20), address(s_pool), burnAmount); @@ -66,8 +66,8 @@ contract BurnMintTokenPool_lockOrBurn is BurnMintTokenPoolSetup { } // Should not burn tokens if cursed. - function test_PoolBurnRevertNotHealthy_Revert() public { - s_mockRMN.setGlobalCursed(true); + function test_RevertWhen_PoolBurnRevertNotHealthy() public { + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(true)); uint256 before = s_burnMintERC20.balanceOf(address(s_pool)); vm.startPrank(s_burnMintOnRamp); @@ -85,7 +85,7 @@ contract BurnMintTokenPool_lockOrBurn is BurnMintTokenPoolSetup { assertEq(s_burnMintERC20.balanceOf(address(s_pool)), before); } - function test_ChainNotAllowed_Revert() public { + function test_RevertWhen_ChainNotAllowed() public { uint64 wrongChainSelector = 8838833; vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); diff --git a/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.releaseOrMint.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.releaseOrMint.t.sol index e950b079889..fe94b3da7bd 100644 --- a/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.releaseOrMint.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/BurnMintTokenPool/BurnMintTokenPool.releaseOrMint.t.sol @@ -15,7 +15,7 @@ contract BurnMintTokenPoolSetup is BurnMintSetup { BurnMintSetup.setUp(); s_pool = new BurnMintTokenPool( - s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); s_burnMintERC20.grantMintAndBurnRoles(address(s_pool)); @@ -24,7 +24,7 @@ contract BurnMintTokenPoolSetup is BurnMintSetup { } contract BurnMintTokenPool_releaseOrMint is BurnMintTokenPoolSetup { - function test_PoolMint_Success() public { + function test_PoolMint() public { uint256 amount = 1e19; address receiver = makeAddr("receiver_address"); @@ -49,9 +49,9 @@ contract BurnMintTokenPool_releaseOrMint is BurnMintTokenPoolSetup { assertEq(s_burnMintERC20.balanceOf(receiver), amount); } - function test_PoolMintNotHealthy_Revert() public { + function test_RevertWhen_PoolMintNotHealthy() public { // Should not mint tokens if cursed. - s_mockRMN.setGlobalCursed(true); + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(true)); uint256 before = s_burnMintERC20.balanceOf(OWNER); vm.startPrank(s_burnMintOffRamp); @@ -72,7 +72,7 @@ contract BurnMintTokenPool_releaseOrMint is BurnMintTokenPoolSetup { assertEq(s_burnMintERC20.balanceOf(OWNER), before); } - function test_ChainNotAllowed_Revert() public { + function test_RevertWhen_ChainNotAllowed() public { uint64 wrongChainSelector = 8838833; vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); diff --git a/contracts/src/v0.8/ccip/test/pools/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.lockOrBurn.t.sol index bb58afd254a..ba9f42dcbf8 100644 --- a/contracts/src/v0.8/ccip/test/pools/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.lockOrBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/BurnMintWithLockReleaseFlagTokenPool/BurnMintWithLockReleaseFlagTokenPool.lockOrBurn.t.sol @@ -18,7 +18,7 @@ contract BurnMintWithLockReleaseFlagTokenPoolSetup is BurnMintSetup { BurnMintSetup.setUp(); s_pool = new BurnMintWithLockReleaseFlagTokenPool( - s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); s_burnMintERC20.grantMintAndBurnRoles(address(s_pool)); @@ -27,7 +27,7 @@ contract BurnMintWithLockReleaseFlagTokenPoolSetup is BurnMintSetup { } contract BurnMintWithLockReleaseFlagTokenPool_lockOrBurn is BurnMintWithLockReleaseFlagTokenPoolSetup { - function test_LockOrBurn_CorrectReturnData_Success() public { + function test_LockOrBurn_CorrectReturnData() public { uint256 burnAmount = 20_000e18; deal(address(s_burnMintERC20), address(s_pool), burnAmount); diff --git a/contracts/src/v0.8/ccip/test/pools/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.lockOrBurn.t.sol index b96dcd78b5d..671cf05cb88 100644 --- a/contracts/src/v0.8/ccip/test/pools/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.lockOrBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/BurnWithFromMintTokenPool/BurnWithFromMintTokenPool.lockOrBurn.t.sol @@ -16,7 +16,7 @@ contract BurnWithFromMintTokenPoolSetup is BurnMintSetup { BurnMintSetup.setUp(); s_pool = new BurnWithFromMintTokenPool( - s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_burnMintERC20, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); s_burnMintERC20.grantMintAndBurnRoles(address(s_pool)); @@ -25,15 +25,15 @@ contract BurnWithFromMintTokenPoolSetup is BurnMintSetup { } contract BurnWithFromMintTokenPool_lockOrBurn is BurnWithFromMintTokenPoolSetup { - function test_Setup_Success() public view { + function test_Setup() public view { assertEq(address(s_burnMintERC20), address(s_pool.getToken())); - assertEq(address(s_mockRMN), s_pool.getRmnProxy()); + assertEq(address(s_mockRMNRemote), s_pool.getRmnProxy()); assertEq(false, s_pool.getAllowListEnabled()); assertEq(type(uint256).max, s_burnMintERC20.allowance(address(s_pool), address(s_pool))); assertEq("BurnWithFromMintTokenPool 1.5.1", s_pool.typeAndVersion()); } - function test_PoolBurn_Success() public { + function test_PoolBurn() public { uint256 burnAmount = 20_000e18; deal(address(s_burnMintERC20), address(s_pool), burnAmount); @@ -67,8 +67,8 @@ contract BurnWithFromMintTokenPool_lockOrBurn is BurnWithFromMintTokenPoolSetup } // Should not burn tokens if cursed. - function test_PoolBurnRevertNotHealthy_Revert() public { - s_mockRMN.setGlobalCursed(true); + function test_RevertWhen_PoolBurnRevertNotHealthy() public { + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(true)); uint256 before = s_burnMintERC20.balanceOf(address(s_pool)); vm.startPrank(s_burnMintOnRamp); @@ -86,7 +86,7 @@ contract BurnWithFromMintTokenPool_lockOrBurn is BurnWithFromMintTokenPoolSetup assertEq(s_burnMintERC20.balanceOf(address(s_pool)), before); } - function test_ChainNotAllowed_Revert() public { + function test_RevertWhen_ChainNotAllowed() public { uint64 wrongChainSelector = 8838833; vm.expectRevert(abi.encodeWithSelector(TokenPool.ChainNotAllowed.selector, wrongChainSelector)); s_pool.releaseOrMint( diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.canAcceptLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.canAcceptLiquidity.t.sol index 63b6e0bc351..43b6afed812 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.canAcceptLiquidity.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.canAcceptLiquidity.t.sol @@ -5,11 +5,11 @@ import {LockReleaseTokenPool} from "../../../pools/LockReleaseTokenPool.sol"; import {LockReleaseTokenPoolSetup} from "./LockReleaseTokenPoolSetup.t.sol"; contract LockReleaseTokenPool_canAcceptLiquidity is LockReleaseTokenPoolSetup { - function test_CanAcceptLiquidity_Success() public { + function test_CanAcceptLiquidity() public { assertEq(true, s_lockReleaseTokenPool.canAcceptLiquidity()); s_lockReleaseTokenPool = new LockReleaseTokenPool( - s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), false, address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), false, address(s_sourceRouter) ); assertEq(false, s_lockReleaseTokenPool.canAcceptLiquidity()); } diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.lockOrBurn.t.sol index 7c87fbcc95d..484e73541bc 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.lockOrBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.lockOrBurn.t.sol @@ -30,7 +30,7 @@ contract LockReleaseTokenPool_lockOrBurn is LockReleaseTokenPoolSetup { ); } - function test_LockOrBurnWithAllowList_Success() public { + function test_LockOrBurnWithAllowList() public { uint256 amount = 100; vm.startPrank(s_allowedOnRamp); @@ -63,7 +63,7 @@ contract LockReleaseTokenPool_lockOrBurn is LockReleaseTokenPoolSetup { ); } - function test_LockOrBurnWithAllowList_Revert() public { + function test_RevertWhen_LockOrBurnWithAllowList() public { vm.startPrank(s_allowedOnRamp); vm.expectRevert(abi.encodeWithSelector(TokenPool.SenderNotAllowed.selector, STRANGER)); @@ -79,9 +79,9 @@ contract LockReleaseTokenPool_lockOrBurn is LockReleaseTokenPoolSetup { ); } - function test_PoolBurnRevertNotHealthy_Revert() public { + function test_RevertWhen_PoolBurnRevertNotHealthy() public { // Should not burn tokens if cursed. - s_mockRMN.setGlobalCursed(true); + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(true)); uint256 before = s_token.balanceOf(address(s_lockReleaseTokenPoolWithAllowList)); vm.startPrank(s_allowedOnRamp); diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.provideLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.provideLiquidity.t.sol index 6ef52e88467..5fe451a2959 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.provideLiquidity.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.provideLiquidity.t.sol @@ -21,7 +21,7 @@ contract LockReleaseTokenPool_provideLiquidity is LockReleaseTokenPoolSetup { // Reverts - function test_Unauthorized_Revert() public { + function test_RevertWhen_Unauthorized() public { vm.startPrank(STRANGER); vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); @@ -36,9 +36,9 @@ contract LockReleaseTokenPool_provideLiquidity is LockReleaseTokenPoolSetup { s_lockReleaseTokenPool.provideLiquidity(amount); } - function test_LiquidityNotAccepted_Revert() public { + function test_RevertWhen_LiquidityNotAccepted() public { s_lockReleaseTokenPool = new LockReleaseTokenPool( - s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), false, address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), false, address(s_sourceRouter) ); vm.expectRevert(LockReleaseTokenPool.LiquidityNotAccepted.selector); diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.releaseOrMint.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.releaseOrMint.t.sol index 9a67f766448..6d53f2c2d8e 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.releaseOrMint.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.releaseOrMint.t.sol @@ -27,7 +27,7 @@ contract LockReleaseTokenPool_releaseOrMint is LockReleaseTokenPoolSetup { s_lockReleaseTokenPoolWithAllowList.applyChainUpdates(new uint64[](0), chainUpdate); } - function test_ReleaseOrMint_Success() public { + function test_ReleaseOrMint() public { vm.startPrank(s_allowedOffRamp); uint256 amount = 100; @@ -93,7 +93,7 @@ contract LockReleaseTokenPool_releaseOrMint is LockReleaseTokenPoolSetup { ); } - function test_ChainNotAllowed_Revert() public { + function test_RevertWhen_ChainNotAllowed() public { uint64[] memory chainsToRemove = new uint64[](1); chainsToRemove[0] = SOURCE_CHAIN_SELECTOR; @@ -116,9 +116,9 @@ contract LockReleaseTokenPool_releaseOrMint is LockReleaseTokenPoolSetup { ); } - function test_PoolMintNotHealthy_Revert() public { + function test_RevertWhen_PoolMintNotHealthy() public { // Should not mint tokens if cursed. - s_mockRMN.setGlobalCursed(true); + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed(bytes16)"), abi.encode(true)); uint256 before = s_token.balanceOf(OWNER); vm.startPrank(s_allowedOffRamp); vm.expectRevert(TokenPool.CursedByRMN.selector); diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.setRebalancer.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.setRebalancer.t.sol index 25286c1a376..a7f13d75be0 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.setRebalancer.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.setRebalancer.t.sol @@ -5,13 +5,13 @@ import {Ownable2Step} from "../../../../shared/access/Ownable2Step.sol"; import {LockReleaseTokenPoolSetup} from "./LockReleaseTokenPoolSetup.t.sol"; contract LockReleaseTokenPool_setRebalancer is LockReleaseTokenPoolSetup { - function test_SetRebalancer_Success() public { + function test_SetRebalancer() public { assertEq(address(s_lockReleaseTokenPool.getRebalancer()), OWNER); s_lockReleaseTokenPool.setRebalancer(STRANGER); assertEq(address(s_lockReleaseTokenPool.getRebalancer()), STRANGER); } - function test_SetRebalancer_Revert() public { + function test_RevertWhen_SetRebalancer() public { vm.startPrank(STRANGER); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.supportsInterface.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.supportsInterface.t.sol index 9a08fc38c96..5837040760c 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.supportsInterface.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.supportsInterface.t.sol @@ -8,7 +8,7 @@ import {LockReleaseTokenPoolSetup} from "./LockReleaseTokenPoolSetup.t.sol"; import {IERC165} from "../../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; contract LockReleaseTokenPool_supportsInterface is LockReleaseTokenPoolSetup { - function test_SupportsInterface_Success() public view { + function test_SupportsInterface() public view { assertTrue(s_lockReleaseTokenPool.supportsInterface(type(IPoolV1).interfaceId)); assertTrue(s_lockReleaseTokenPool.supportsInterface(type(IERC165).interfaceId)); } diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.transferLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.transferLiquidity.t.sol index 60b9c935bd3..4708872295a 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.transferLiquidity.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.transferLiquidity.t.sol @@ -12,13 +12,13 @@ contract LockReleaseTokenPool_transferLiquidity is LockReleaseTokenPoolSetup { super.setUp(); s_oldLockReleaseTokenPool = new LockReleaseTokenPool( - s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), true, address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), true, address(s_sourceRouter) ); deal(address(s_token), address(s_oldLockReleaseTokenPool), s_amount); } - function test_transferLiquidity_Success() public { + function test_transferLiquidity() public { uint256 balancePre = s_token.balanceOf(address(s_lockReleaseTokenPool)); s_oldLockReleaseTokenPool.setRebalancer(address(s_lockReleaseTokenPool)); @@ -31,7 +31,7 @@ contract LockReleaseTokenPool_transferLiquidity is LockReleaseTokenPoolSetup { assertEq(s_token.balanceOf(address(s_lockReleaseTokenPool)), balancePre + s_amount); } - function test_transferLiquidity_transferTooMuch_Revert() public { + function test_RevertWhen_transferLiquidity_transferTooMuch() public { uint256 balancePre = s_token.balanceOf(address(s_lockReleaseTokenPool)); s_oldLockReleaseTokenPool.setRebalancer(address(s_lockReleaseTokenPool)); diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.withdrawalLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.withdrawalLiquidity.t.sol index 29b6ef6c7f8..fe124706e65 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.withdrawalLiquidity.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPool.withdrawalLiquidity.t.sol @@ -20,14 +20,14 @@ contract LockReleaseTokenPool_withdrawalLiquidity is LockReleaseTokenPoolSetup { } // Reverts - function test_Unauthorized_Revert() public { + function test_RevertWhen_Unauthorized() public { vm.startPrank(STRANGER); vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); s_lockReleaseTokenPool.withdrawLiquidity(1); } - function test_InsufficientLiquidity_Revert() public { + function test_RevertWhen_InsufficientLiquidity() public { uint256 maxUint256 = 2 ** 256 - 1; s_token.approve(address(s_lockReleaseTokenPool), maxUint256); s_lockReleaseTokenPool.provideLiquidity(maxUint256); diff --git a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPoolSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPoolSetup.t.sol index 13bcb8cfdee..915789f0aae 100644 --- a/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPoolSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/LockReleaseTokenPool/LockReleaseTokenPoolSetup.t.sol @@ -5,11 +5,11 @@ import {BurnMintERC20} from "../../../../shared/token/ERC20/BurnMintERC20.sol"; import {Router} from "../../../Router.sol"; import {LockReleaseTokenPool} from "../../../pools/LockReleaseTokenPool.sol"; import {TokenPool} from "../../../pools/TokenPool.sol"; +import {BaseTest} from "../../BaseTest.t.sol"; import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; -import {RouterSetup} from "../../router/Router/RouterSetup.t.sol"; -contract LockReleaseTokenPoolSetup is RouterSetup { +contract LockReleaseTokenPoolSetup is BaseTest { IERC20 internal s_token; LockReleaseTokenPool internal s_lockReleaseTokenPool; LockReleaseTokenPool internal s_lockReleaseTokenPoolWithAllowList; @@ -22,17 +22,17 @@ contract LockReleaseTokenPoolSetup is RouterSetup { address internal s_sourcePoolAddress = address(53852352095); function setUp() public virtual override { - RouterSetup.setUp(); + super.setUp(); s_token = new BurnMintERC20("LINK", "LNK", 18, 0, 0); deal(address(s_token), OWNER, type(uint256).max); s_lockReleaseTokenPool = new LockReleaseTokenPool( - s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), true, address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), true, address(s_sourceRouter) ); - s_allowedList.push(USER_1); + s_allowedList.push(vm.randomAddress()); s_allowedList.push(OWNER); s_lockReleaseTokenPoolWithAllowList = new LockReleaseTokenPool( - s_token, DEFAULT_TOKEN_DECIMALS, s_allowedList, address(s_mockRMN), true, address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, s_allowedList, address(s_mockRMNRemote), true, address(s_sourceRouter) ); bytes[] memory remotePoolAddresses = new bytes[](1); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.addRemotePool.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.addRemotePool.t.sol index 287ee796f67..29f462fe6d2 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.addRemotePool.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.addRemotePool.t.sol @@ -7,7 +7,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {TokenPoolSetup} from "./TokenPoolSetup.t.sol"; contract TokenPool_addRemotePool is TokenPoolSetup { - function test_addRemotePool_Success() public { + function test_addRemotePool() public { // Use a longer data type to ensure it also works for non-evm bytes memory remotePool = abi.encode(makeAddr("non-evm-1"), makeAddr("non-evm-2")); @@ -130,7 +130,7 @@ contract TokenPool_addRemotePool is TokenPoolSetup { // Reverts - function test_NonExistentChain_Revert() public { + function test_RevertWhen_NonExistentChain() public { uint64 chainSelector = DEST_CHAIN_SELECTOR + 1; bytes memory remotePool = abi.encode(type(uint256).max); @@ -139,7 +139,7 @@ contract TokenPool_addRemotePool is TokenPoolSetup { s_tokenPool.addRemotePool(chainSelector, remotePool); } - function test_ZeroLengthAddressNotAllowed_Revert() public { + function test_RevertWhen_ZeroLengthAddressNotAllowed() public { bytes memory remotePool = ""; vm.expectRevert(abi.encodeWithSelector(TokenPool.ZeroAddressNotAllowed.selector)); @@ -147,7 +147,7 @@ contract TokenPool_addRemotePool is TokenPoolSetup { s_tokenPool.addRemotePool(DEST_CHAIN_SELECTOR, remotePool); } - function test_PoolAlreadyAdded_Revert() public { + function test_RevertWhen_PoolAlreadyAdded() public { uint64 chainSelector = DEST_CHAIN_SELECTOR; bytes memory remotePool = abi.encode(type(uint256).max); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyAllowListUpdates.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyAllowListUpdates.t.sol index 96629445810..bdc58d7c0e7 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyAllowListUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyAllowListUpdates.t.sol @@ -8,7 +8,7 @@ import {TokenPoolHelper} from "../../helpers/TokenPoolHelper.sol"; import {TokenPoolWithAllowListSetup} from "./TokenPoolWithAllowListSetup.t.sol"; contract TokenPoolWithAllowList_applyAllowListUpdates is TokenPoolWithAllowListSetup { - function test_SetAllowList_Success() public { + function test_SetAllowList() public { address[] memory newAddresses = new address[](2); newAddresses[0] = address(1); newAddresses[1] = address(2); @@ -60,7 +60,7 @@ contract TokenPoolWithAllowList_applyAllowListUpdates is TokenPoolWithAllowListS assertEq(0, setAddresses.length); } - function test_SetAllowListSkipsZero_Success() public { + function test_SetAllowListSkipsZero() public { uint256 setAddressesLength = s_tokenPool.getAllowList().length; address[] memory newAddresses = new address[](1); @@ -74,16 +74,16 @@ contract TokenPoolWithAllowList_applyAllowListUpdates is TokenPoolWithAllowListS // Reverts - function test_OnlyOwner_Revert() public { + function test_RevertWhen_OnlyOwner() public { vm.stopPrank(); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); address[] memory newAddresses = new address[](2); s_tokenPool.applyAllowListUpdates(new address[](0), newAddresses); } - function test_AllowListNotEnabled_Revert() public { + function test_RevertWhen_AllowListNotEnabled() public { s_tokenPool = new TokenPoolHelper( - s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); vm.expectRevert(TokenPool.AllowListNotEnabled.selector); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyChainUpdates.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyChainUpdates.t.sol index 1ecfc83c5ce..c94acdd8aa0 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyChainUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.applyChainUpdates.t.sol @@ -5,23 +5,22 @@ import {Ownable2Step} from "../../../../shared/access/Ownable2Step.sol"; import {BurnMintERC677} from "../../../../shared/token/ERC677/BurnMintERC677.sol"; import {RateLimiter} from "../../../libraries/RateLimiter.sol"; import {TokenPool} from "../../../pools/TokenPool.sol"; - +import {BaseTest} from "../../BaseTest.t.sol"; import {TokenPoolHelper} from "../../helpers/TokenPoolHelper.sol"; -import {RouterSetup} from "../../router/Router/RouterSetup.t.sol"; import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; -contract TokenPool_applyChainUpdates is RouterSetup { +contract TokenPool_applyChainUpdates is BaseTest { IERC20 internal s_token; TokenPoolHelper internal s_tokenPool; function setUp() public virtual override { - RouterSetup.setUp(); + super.setUp(); s_token = new BurnMintERC677("LINK", "LNK", 18, 0); deal(address(s_token), OWNER, type(uint256).max); s_tokenPool = new TokenPoolHelper( - s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); } @@ -48,7 +47,7 @@ contract TokenPool_applyChainUpdates is RouterSetup { } } - function test_applyChainUpdates_Success() public { + function test_applyChainUpdates() public { RateLimiter.Config memory outboundRateLimit1 = RateLimiter.Config({isEnabled: true, capacity: 100e28, rate: 1e18}); RateLimiter.Config memory inboundRateLimit1 = RateLimiter.Config({isEnabled: true, capacity: 100e29, rate: 1e19}); RateLimiter.Config memory outboundRateLimit2 = RateLimiter.Config({isEnabled: true, capacity: 100e26, rate: 1e16}); @@ -200,13 +199,13 @@ contract TokenPool_applyChainUpdates is RouterSetup { // Reverts - function test_applyChainUpdates_OnlyCallableByOwner_Revert() public { + function test_RevertWhen_applyChainUpdates_OnlyCallableByOwner() public { vm.startPrank(STRANGER); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); s_tokenPool.applyChainUpdates(new uint64[](0), new TokenPool.ChainUpdate[](0)); } - function test_applyChainUpdates_ZeroAddressNotAllowed_Revert() public { + function test_RevertWhen_applyChainUpdates_ZeroAddressNotAllowed() public { bytes[] memory remotePoolAddresses = new bytes[](1); remotePoolAddresses[0] = ""; @@ -235,7 +234,7 @@ contract TokenPool_applyChainUpdates is RouterSetup { s_tokenPool.applyChainUpdates(new uint64[](0), chainUpdates); } - function test_applyChainUpdates_NonExistentChain_Revert() public { + function test_RevertWhen_applyChainUpdates_NonExistentChain() public { uint64[] memory chainRemoves = new uint64[](1); chainRemoves[0] = 1; @@ -243,7 +242,7 @@ contract TokenPool_applyChainUpdates is RouterSetup { s_tokenPool.applyChainUpdates(chainRemoves, new TokenPool.ChainUpdate[](0)); } - function test_applyChainUpdates_InvalidRateLimitRate_Revert() public { + function test_RevertWhen_applyChainUpdates_InvalidRateLimitRate() public { uint64 unusedChainSelector = 2 ** 64 - 1; TokenPool.ChainUpdate[] memory chainUpdates = new TokenPool.ChainUpdate[](1); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.calculateLocalAmount.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.calculateLocalAmount.t.sol index 4262fac2218..ad578d4d9ce 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.calculateLocalAmount.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.calculateLocalAmount.t.sol @@ -36,7 +36,7 @@ contract TokenPool_calculateLocalAmount is TokenPoolSetup { // Reverts - function test_calculateLocalAmount_RevertWhen_LowRemoteDecimalsOverflows() public { + function test_RevertWhen_calculateLocalAmountWhen_LowRemoteDecimalsOverflows() public { uint8 remoteDecimals = 0; uint8 localDecimals = 78; uint256 remoteAmount = 1; @@ -44,7 +44,7 @@ contract TokenPool_calculateLocalAmount is TokenPoolSetup { vm.mockCall(address(s_token), abi.encodeWithSelector(IERC20Metadata.decimals.selector), abi.encode(localDecimals)); s_tokenPool = - new TokenPoolHelper(s_token, localDecimals, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + new TokenPoolHelper(s_token, localDecimals, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter)); vm.expectRevert( abi.encodeWithSelector(TokenPool.OverflowDetected.selector, remoteDecimals, localDecimals, remoteAmount) @@ -53,7 +53,7 @@ contract TokenPool_calculateLocalAmount is TokenPoolSetup { s_tokenPool.calculateLocalAmount(remoteAmount, remoteDecimals); } - function test_calculateLocalAmount_RevertWhen_HighLocalDecimalsOverflows() public { + function test_RevertWhen_calculateLocalAmountWhen_HighLocalDecimalsOverflows() public { uint8 remoteDecimals = 18; uint8 localDecimals = 18 + 78; uint256 remoteAmount = 1; @@ -61,7 +61,7 @@ contract TokenPool_calculateLocalAmount is TokenPoolSetup { vm.mockCall(address(s_token), abi.encodeWithSelector(IERC20Metadata.decimals.selector), abi.encode(localDecimals)); s_tokenPool = - new TokenPoolHelper(s_token, localDecimals, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + new TokenPoolHelper(s_token, localDecimals, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter)); vm.expectRevert( abi.encodeWithSelector(TokenPool.OverflowDetected.selector, remoteDecimals, localDecimals, remoteAmount) @@ -70,7 +70,7 @@ contract TokenPool_calculateLocalAmount is TokenPoolSetup { s_tokenPool.calculateLocalAmount(remoteAmount, remoteDecimals); } - function test_calculateLocalAmount_RevertWhen_HighRemoteDecimalsOverflows() public { + function test_RevertWhen_calculateLocalAmountWhen_HighRemoteDecimalsOverflows() public { uint8 remoteDecimals = 18 + 78; uint8 localDecimals = 18; uint256 remoteAmount = 1; @@ -82,7 +82,7 @@ contract TokenPool_calculateLocalAmount is TokenPoolSetup { s_tokenPool.calculateLocalAmount(remoteAmount, remoteDecimals); } - function test_calculateLocalAmount_RevertWhen_HighAmountOverflows() public { + function test_RevertWhen_calculateLocalAmountWhen_HighAmountOverflows() public { uint8 remoteDecimals = 18; uint8 localDecimals = 18 + 28; uint256 remoteAmount = 1e50; @@ -90,7 +90,7 @@ contract TokenPool_calculateLocalAmount is TokenPoolSetup { vm.mockCall(address(s_token), abi.encodeWithSelector(IERC20Metadata.decimals.selector), abi.encode(localDecimals)); s_tokenPool = - new TokenPoolHelper(s_token, localDecimals, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + new TokenPoolHelper(s_token, localDecimals, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter)); vm.expectRevert( abi.encodeWithSelector(TokenPool.OverflowDetected.selector, remoteDecimals, localDecimals, remoteAmount) diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.constructor.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.constructor.t.sol index 4b643d66b9e..fe3b84dc4cd 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.constructor.t.sol @@ -12,7 +12,7 @@ import {IERC20Metadata} from contract TokenPool_constructor is TokenPoolSetup { function test_constructor() public view { assertEq(address(s_token), address(s_tokenPool.getToken())); - assertEq(address(s_mockRMN), s_tokenPool.getRmnProxy()); + assertEq(address(s_mockRMNRemote), s_tokenPool.getRmnProxy()); assertFalse(s_tokenPool.getAllowListEnabled()); assertEq(address(s_sourceRouter), s_tokenPool.getRouter()); assertEq(DEFAULT_TOKEN_DECIMALS, s_tokenPool.getTokenDecimals()); @@ -23,22 +23,23 @@ contract TokenPool_constructor is TokenPoolSetup { vm.mockCallRevert(address(s_token), abi.encodeWithSelector(IERC20Metadata.decimals.selector), "decimals fails"); - s_tokenPool = new TokenPoolHelper(s_token, decimals, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + s_tokenPool = + new TokenPoolHelper(s_token, decimals, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter)); assertEq(s_tokenPool.getTokenDecimals(), decimals); } // Reverts - function test_constructor_RevertWhen_ZeroAddressNotAllowed() public { + function test_RevertWhen_constructorWhen_ZeroAddressNotAllowed() public { vm.expectRevert(TokenPool.ZeroAddressNotAllowed.selector); s_tokenPool = new TokenPoolHelper( - IERC20(address(0)), DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + IERC20(address(0)), DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); } - function test_constructor_RevertWhen_InvalidDecimalArgs() public { + function test_RevertWhen_constructorWhen_InvalidDecimalArgs() public { uint8 invalidDecimals = DEFAULT_TOKEN_DECIMALS + 1; vm.expectRevert( @@ -46,6 +47,6 @@ contract TokenPool_constructor is TokenPoolSetup { ); s_tokenPool = - new TokenPoolHelper(s_token, invalidDecimals, new address[](0), address(s_mockRMN), address(s_sourceRouter)); + new TokenPoolHelper(s_token, invalidDecimals, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter)); } } diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowList.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowList.t.sol index 8d4256d3479..10cc385c2fb 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowList.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowList.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {TokenPoolWithAllowListSetup} from "./TokenPoolWithAllowListSetup.t.sol"; contract TokenPoolWithAllowList_getAllowList is TokenPoolWithAllowListSetup { - function test_GetAllowList_Success() public view { + function test_GetAllowList() public view { address[] memory setAddresses = s_tokenPool.getAllowList(); assertEq(2, setAddresses.length); assertEq(s_allowedSenders[0], setAddresses[0]); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowListEnabled.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowListEnabled.t.sol index 2a36a846999..b6c89d9754b 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowListEnabled.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.getAllowListEnabled.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {TokenPoolWithAllowListSetup} from "./TokenPoolWithAllowListSetup.t.sol"; contract TokenPoolWithAllowList_getAllowListEnabled is TokenPoolWithAllowListSetup { - function test_GetAllowListEnabled_Success() public view { + function test_GetAllowListEnabled() public view { assertTrue(s_tokenPool.getAllowListEnabled()); } } diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOffRamp.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOffRamp.t.sol index 8df07a285f3..a8900fa18fa 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOffRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOffRamp.t.sol @@ -6,7 +6,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {TokenPoolSetup} from "./TokenPoolSetup.t.sol"; contract TokenPool_onlyOffRamp is TokenPoolSetup { - function test_onlyOffRamp_Success() public { + function test_onlyOffRamp() public { uint64 chainSelector = DEST_CHAIN_SELECTOR; address offRamp = makeAddr("onRamp"); @@ -19,7 +19,7 @@ contract TokenPool_onlyOffRamp is TokenPoolSetup { s_tokenPool.onlyOffRampModifier(chainSelector); } - function test_ChainNotAllowed_Revert() public { + function test_RevertWhen_ChainNotAllowed() public { uint64 chainSelector = DEST_CHAIN_SELECTOR + 1; address offRamp = makeAddr("onRamp"); @@ -60,7 +60,7 @@ contract TokenPool_onlyOffRamp is TokenPoolSetup { s_tokenPool.onlyOffRampModifier(chainSelector); } - function test_CallerIsNotARampOnRouter_Revert() public { + function test_RevertWhen_CallerIsNotARampOnRouter() public { uint64 chainSelector = DEST_CHAIN_SELECTOR; address offRamp = makeAddr("offRamp"); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOnRamp.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOnRamp.t.sol index be0c21e4c1e..8f2d1a300fd 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOnRamp.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.onlyOnRamp.t.sol @@ -6,7 +6,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {TokenPoolSetup} from "./TokenPoolSetup.t.sol"; contract TokenPool_onlyOnRamp is TokenPoolSetup { - function test_onlyOnRamp_Success() public { + function test_onlyOnRamp() public { uint64 chainSelector = DEST_CHAIN_SELECTOR; address onRamp = makeAddr("onRamp"); @@ -19,7 +19,7 @@ contract TokenPool_onlyOnRamp is TokenPoolSetup { s_tokenPool.onlyOnRampModifier(chainSelector); } - function test_ChainNotAllowed_Revert() public { + function test_RevertWhen_ChainNotAllowed() public { uint64 chainSelector = DEST_CHAIN_SELECTOR + 1; address onRamp = makeAddr("onRamp"); @@ -60,7 +60,7 @@ contract TokenPool_onlyOnRamp is TokenPoolSetup { s_tokenPool.onlyOffRampModifier(chainSelector); } - function test_CallerIsNotARampOnRouter_Revert() public { + function test_RevertWhen_CallerIsNotARampOnRouter() public { uint64 chainSelector = DEST_CHAIN_SELECTOR; address onRamp = makeAddr("onRamp"); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.parseRemoteDecimals.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.parseRemoteDecimals.t.sol index 9817fe227e4..018d9762a0d 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.parseRemoteDecimals.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.parseRemoteDecimals.t.sol @@ -18,7 +18,7 @@ contract TokenPool_parseRemoteDecimals is TokenPoolSetup { assertEq(s_tokenPool.parseRemoteDecimals(""), s_tokenPool.getTokenDecimals()); } - function test_parseRemoteDecimals_RevertWhen_InvalidRemoteChainDecimals_DigitTooLarge() public { + function test_RevertWhen_parseRemoteDecimalsWhen_InvalidRemoteChainDecimals_DigitTooLarge() public { bytes memory encodedDecimals = abi.encode(uint256(256)); vm.expectRevert(abi.encodeWithSelector(TokenPool.InvalidRemoteChainDecimals.selector, encodedDecimals)); @@ -26,7 +26,7 @@ contract TokenPool_parseRemoteDecimals is TokenPoolSetup { s_tokenPool.parseRemoteDecimals(encodedDecimals); } - function test_parseRemoteDecimals_RevertWhen_InvalidRemoteChainDecimals_WrongType() public { + function test_RevertWhen_parseRemoteDecimalsWhen_InvalidRemoteChainDecimals_WrongType() public { bytes memory encodedDecimals = abi.encode(uint256(256), "wrong type"); vm.expectRevert(abi.encodeWithSelector(TokenPool.InvalidRemoteChainDecimals.selector, encodedDecimals)); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.removeRemotePool.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.removeRemotePool.t.sol index 2fa9ef16624..0b2ed0d02c5 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.removeRemotePool.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.removeRemotePool.t.sol @@ -5,7 +5,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {TokenPoolSetup} from "./TokenPoolSetup.t.sol"; contract TokenPool_removeRemotePool is TokenPoolSetup { - function test_removeRemotePool_Success() public { + function test_removeRemotePool() public { uint64 chainSelector = DEST_CHAIN_SELECTOR; // Use a longer data type to ensure it also works for non-evm bytes memory remotePool = abi.encode(makeAddr("non-evm-1"), makeAddr("non-evm-2")); @@ -41,7 +41,7 @@ contract TokenPool_removeRemotePool is TokenPoolSetup { // Reverts - function test_NonExistentChain_Revert() public { + function test_RevertWhen_NonExistentChain() public { uint64 chainSelector = DEST_CHAIN_SELECTOR + 1; bytes memory remotePool = abi.encode(type(uint256).max); @@ -50,7 +50,7 @@ contract TokenPool_removeRemotePool is TokenPoolSetup { s_tokenPool.removeRemotePool(chainSelector, remotePool); } - function test_InvalidRemotePoolForChain_Revert() public { + function test_RevertWhen_InvalidRemotePoolForChain() public { uint64 chainSelector = DEST_CHAIN_SELECTOR; bytes memory remotePool = abi.encode(type(uint256).max); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfig.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfig.t.sol index 4dea9bf4032..01f58496d25 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfig.t.sol @@ -50,7 +50,7 @@ contract TokenPool_setChainRateLimiterConfig is TokenPoolSetup { // Reverts - function test_OnlyOwnerOrRateLimitAdmin_Revert() public { + function test_RevertWhen_OnlyOwnerOrRateLimitAdmin() public { vm.startPrank(STRANGER); vm.expectRevert(abi.encodeWithSelector(TokenPool.Unauthorized.selector, STRANGER)); @@ -59,7 +59,7 @@ contract TokenPool_setChainRateLimiterConfig is TokenPoolSetup { ); } - function test_NonExistentChain_Revert() public { + function test_RevertWhen_NonExistentChain() public { uint64 wrongChainSelector = 9084102894; vm.expectRevert(abi.encodeWithSelector(TokenPool.NonExistentChain.selector, wrongChainSelector)); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfigs.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfigs.t.sol index 716e06734ee..b9c6bbda79e 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfigs.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setChainRateLimiterConfigs.t.sol @@ -79,7 +79,7 @@ contract TokenPool_setChainRateLimiterConfigs is TokenPoolSetup { // Reverts - function test_OnlyOwnerOrRateLimitAdmin_Revert() public { + function test_RevertWhen_OnlyOwnerOrRateLimitAdmin() public { uint64[] memory chainSelectors = new uint64[](1); chainSelectors[0] = DEST_CHAIN_SELECTOR; @@ -95,7 +95,7 @@ contract TokenPool_setChainRateLimiterConfigs is TokenPoolSetup { s_tokenPool.setChainRateLimiterConfigs(chainSelectors, newOutboundConfigs, newInboundConfigs); } - function test_NonExistentChain_Revert() public { + function test_RevertWhen_NonExistentChain() public { uint64 wrongChainSelector = 9084102894; uint64[] memory chainSelectors = new uint64[](1); @@ -108,7 +108,7 @@ contract TokenPool_setChainRateLimiterConfigs is TokenPoolSetup { s_tokenPool.setChainRateLimiterConfigs(chainSelectors, newOutboundConfigs, newInboundConfigs); } - function test_MismatchedArrayLengths_Revert() public { + function test_RevertWhen_MismatchedArrayLengths() public { uint64[] memory chainSelectors = new uint64[](1); RateLimiter.Config[] memory newOutboundConfigs = new RateLimiter.Config[](1); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRateLimitAdmin.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRateLimitAdmin.t.sol index 7c57741cf42..681685eef8a 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRateLimitAdmin.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRateLimitAdmin.t.sol @@ -7,7 +7,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {TokenPoolSetup} from "./TokenPoolSetup.t.sol"; contract TokenPool_setRateLimitAdmin is TokenPoolSetup { - function test_SetRateLimitAdmin_Success() public { + function test_SetRateLimitAdmin() public { assertEq(address(0), s_tokenPool.getRateLimitAdmin()); vm.expectEmit(); emit TokenPool.RateLimitAdminSet(OWNER); @@ -17,7 +17,7 @@ contract TokenPool_setRateLimitAdmin is TokenPoolSetup { // Reverts - function test_SetRateLimitAdmin_Revert() public { + function test_RevertWhen_SetRateLimitAdmin() public { vm.startPrank(STRANGER); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRouter.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRouter.t.sol index 4bf85f3af9f..53d34b97864 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRouter.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPool.setRouter.t.sol @@ -5,7 +5,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {TokenPoolWithAllowListSetup} from "./TokenPoolWithAllowListSetup.t.sol"; contract TokenPoolWithAllowList_setRouter is TokenPoolWithAllowListSetup { - function test_SetRouter_Success() public { + function test_SetRouter() public { assertEq(address(s_sourceRouter), s_tokenPool.getRouter()); address newRouter = makeAddr("newRouter"); @@ -20,7 +20,7 @@ contract TokenPoolWithAllowList_setRouter is TokenPoolWithAllowListSetup { // Reverts - function test_ZeroAddressNotAllowed_Revert() public { + function test_RevertWhen_ZeroAddressNotAllowed() public { address newRouter = address(0); vm.expectRevert(TokenPool.ZeroAddressNotAllowed.selector); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolSetup.t.sol index b2bdeefee12..b75010dddfb 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolSetup.t.sol @@ -3,12 +3,12 @@ pragma solidity 0.8.24; import {BurnMintERC20} from "../../../../shared/token/ERC20/BurnMintERC20.sol"; import {TokenPool} from "../../../pools/TokenPool.sol"; +import {BaseTest} from "../../BaseTest.t.sol"; import {TokenPoolHelper} from "../../helpers/TokenPoolHelper.sol"; -import {RouterSetup} from "../../router/Router/RouterSetup.t.sol"; import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/token/ERC20/IERC20.sol"; -contract TokenPoolSetup is RouterSetup { +contract TokenPoolSetup is BaseTest { IERC20 internal s_token; TokenPoolHelper internal s_tokenPool; @@ -16,12 +16,12 @@ contract TokenPoolSetup is RouterSetup { address internal s_initialRemoteToken = makeAddr("initialRemoteToken"); function setUp() public virtual override { - RouterSetup.setUp(); + super.setUp(); s_token = new BurnMintERC20("LINK", "LNK", 18, 0, 0); deal(address(s_token), OWNER, type(uint256).max); s_tokenPool = new TokenPoolHelper( - s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMN), address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, new address[](0), address(s_mockRMNRemote), address(s_sourceRouter) ); bytes[] memory remotePoolAddresses = new bytes[](1); diff --git a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolWithAllowListSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolWithAllowListSetup.t.sol index 478e8996376..d0b55650f70 100644 --- a/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolWithAllowListSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/TokenPool/TokenPoolWithAllowListSetup.t.sol @@ -14,7 +14,7 @@ contract TokenPoolWithAllowListSetup is TokenPoolSetup { s_allowedSenders.push(OWNER); s_tokenPool = new TokenPoolHelper( - s_token, DEFAULT_TOKEN_DECIMALS, s_allowedSenders, address(s_mockRMN), address(s_sourceRouter) + s_token, DEFAULT_TOKEN_DECIMALS, s_allowedSenders, address(s_mockRMNRemote), address(s_sourceRouter) ); } } diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.lockOrBurn.t.sol index 394357f213f..ad1de5ba29c 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.lockOrBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.lockOrBurn.t.sol @@ -11,7 +11,7 @@ import {USDCTokenPool} from "../../../../pools/USDC/USDCTokenPool.sol"; import {HybridLockReleaseUSDCTokenPoolSetup} from "./HybridLockReleaseUSDCTokenPoolSetup.t.sol"; contract HybridLockReleaseUSDCTokenPool_lockOrBurn is HybridLockReleaseUSDCTokenPoolSetup { - function test_onLockReleaseMechanism_Success() public { + function test_onLockReleaseMechanism() public { bytes32 receiver = bytes32(uint256(uint160(STRANGER))); // Mark the destination chain as supporting CCTP, so use L/R instead. @@ -47,7 +47,7 @@ contract HybridLockReleaseUSDCTokenPool_lockOrBurn is HybridLockReleaseUSDCToken assertEq(s_token.balanceOf(address(s_usdcTokenPool)), amount, "Incorrect token amount in the tokenPool"); } - function test_PrimaryMechanism_Success() public { + function test_PrimaryMechanism() public { bytes32 receiver = bytes32(uint256(uint160(STRANGER))); uint256 amount = 1; @@ -91,9 +91,9 @@ contract HybridLockReleaseUSDCTokenPool_lockOrBurn is HybridLockReleaseUSDCToken assertEq(s_mockUSDC.s_nonce() - 1, nonce); } - function test_onLockReleaseMechanism_thenSwitchToPrimary_Success() public { + function test_onLockReleaseMechanism_thenSwitchToPrimary() public { // Test Enabling the LR mechanism and sending an outgoing message - test_PrimaryMechanism_Success(); + test_PrimaryMechanism(); // Disable the LR mechanism so that primary CCTP is used and then attempt to send a message uint64[] memory destChainRemoves = new uint64[](1); @@ -107,10 +107,10 @@ contract HybridLockReleaseUSDCTokenPool_lockOrBurn is HybridLockReleaseUSDCToken s_usdcTokenPool.updateChainSelectorMechanisms(destChainRemoves, new uint64[](0)); // Send an outgoing message - test_PrimaryMechanism_Success(); + test_PrimaryMechanism(); } - function test_WhileMigrationPause_Revert() public { + function test_RevertWhen_WhileMigrationPause() public { // Mark the destination chain as supporting CCTP, so use L/R instead. uint64[] memory destChainAdds = new uint64[](1); destChainAdds[0] = DEST_CHAIN_SELECTOR; diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.releaseOrMint.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.releaseOrMint.t.sol index ea3c581ea52..07b36b7b506 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.releaseOrMint.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.releaseOrMint.t.sol @@ -12,7 +12,7 @@ import {MockE2EUSDCTransmitter} from "../../../mocks/MockE2EUSDCTransmitter.sol" import {HybridLockReleaseUSDCTokenPoolSetup} from "./HybridLockReleaseUSDCTokenPoolSetup.t.sol"; contract HybridLockReleaseUSDCTokenPool_releaseOrMint is HybridLockReleaseUSDCTokenPoolSetup { - function test_OnLockReleaseMechanism_Success() public { + function test_OnLockReleaseMechanism() public { address recipient = address(1234); // Designate the SOURCE_CHAIN as not using native-USDC, and so the L/R mechanism must be used instead @@ -120,7 +120,7 @@ contract HybridLockReleaseUSDCTokenPool_releaseOrMint is HybridLockReleaseUSDCTo ); } - function test_WhileMigrationPause_Revert() public { + function test_RevertWhen_WhileMigrationPause() public { address recipient = address(1234); // Designate the SOURCE_CHAIN as not using native-USDC, and so the L/R mechanism must be used instead diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol index 4e5a45a1438..a00e4e8de4f 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.transferLiquidity.t.sol @@ -7,7 +7,7 @@ import {HybridLockReleaseUSDCTokenPool} from "../../../../pools/USDC/HybridLockR import {HybridLockReleaseUSDCTokenPoolSetup} from "./HybridLockReleaseUSDCTokenPoolSetup.t.sol"; contract HybridLockReleaseUSDCTokenPool_TransferLiquidity is HybridLockReleaseUSDCTokenPoolSetup { - function test_transferLiquidity_Success() public { + function test_transferLiquidity() public { // Set as the OWNER so we can provide liquidity vm.startPrank(OWNER); @@ -63,7 +63,7 @@ contract HybridLockReleaseUSDCTokenPool_TransferLiquidity is HybridLockReleaseUS ); } - function test_cannotTransferLiquidityDuringPendingMigration_Revert() public { + function test_RevertWhen_cannotTransferLiquidityDuringPendingMigration() public { // Set as the OWNER so we can provide liquidity vm.startPrank(OWNER); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPoolSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPoolSetup.t.sol index 9b318b782ce..3106f25b5c6 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPoolSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPoolSetup.t.sol @@ -15,11 +15,13 @@ contract HybridLockReleaseUSDCTokenPoolSetup is USDCSetup { function setUp() public virtual override { super.setUp(); - s_usdcTokenPool = - new HybridLockReleaseUSDCTokenPool(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + s_usdcTokenPool = new HybridLockReleaseUSDCTokenPool( + s_mockUSDC, s_token, new address[](0), address(s_mockRMNRemote), address(s_router) + ); - s_usdcTokenPoolTransferLiquidity = - new HybridLockReleaseUSDCTokenPool(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + s_usdcTokenPoolTransferLiquidity = new HybridLockReleaseUSDCTokenPool( + s_mockUSDC, s_token, new address[](0), address(s_mockRMNRemote), address(s_router) + ); BurnMintERC677(address(s_token)).grantMintAndBurnRoles(address(s_usdcTokenPool)); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.burnLockedUSDC.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.burnLockedUSDC.t.sol index 52ddb9dad4c..d2bc0d7e135 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.burnLockedUSDC.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.burnLockedUSDC.t.sol @@ -8,7 +8,7 @@ import {HybridLockReleaseUSDCTokenPool_lockOrBurn} from "../HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.lockOrBurn.t.sol"; contract USDCBridgeMigrator_BurnLockedUSDC is HybridLockReleaseUSDCTokenPool_lockOrBurn { - function test_lockOrBurn_then_BurnInCCTPMigration_Success() public { + function test_lockOrBurn_then_BurnInCCTPMigration() public { bytes32 receiver = bytes32(uint256(uint160(STRANGER))); address CIRCLE = makeAddr("CIRCLE CCTP Migrator"); @@ -96,10 +96,10 @@ contract USDCBridgeMigrator_BurnLockedUSDC is HybridLockReleaseUSDCTokenPool_loc s_usdcTokenPool.shouldUseLockRelease(DEST_CHAIN_SELECTOR), "Lock/Release mech should be disabled after a burn" ); - test_PrimaryMechanism_Success(); + test_PrimaryMechanism(); } - function test_invalidPermissions_Revert() public { + function test_RevertWhen_invalidPermissions() public { address CIRCLE = makeAddr("CIRCLE"); vm.startPrank(OWNER); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.cancelMigrationProposal.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.cancelMigrationProposal.t.sol index f4f56cba3e6..2ca4ba005ab 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.cancelMigrationProposal.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.cancelMigrationProposal.t.sol @@ -5,7 +5,7 @@ import {USDCBridgeMigrator} from "../../../../pools/USDC/USDCBridgeMigrator.sol" import {HybridLockReleaseUSDCTokenPoolSetup} from "./USDCBridgeMigratorSetup.t.sol"; contract USDCBridgeMigrator_cancelMigrationProposal is HybridLockReleaseUSDCTokenPoolSetup { - function test_cancelExistingCCTPMigrationProposal_Success() public { + function test_cancelExistingCCTPMigrationProposal() public { vm.startPrank(OWNER); // Mark the destination chain as supporting CCTP, so use L/R instead. @@ -40,7 +40,7 @@ contract USDCBridgeMigrator_cancelMigrationProposal is HybridLockReleaseUSDCToke s_usdcTokenPool.cancelExistingCCTPMigrationProposal(); } - function test_cannotCancelANonExistentMigrationProposal_Revert() public { + function test_RevertWhen_cannotCancelANonExistentMigrationProposal() public { vm.expectRevert(USDCBridgeMigrator.NoMigrationProposalPending.selector); // Proposal to migrate doesn't exist, and so the chain selector is zero, and therefore should revert diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.excludeTokensFromBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.excludeTokensFromBurn.t.sol index 855db7c5c64..30b92e25495 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.excludeTokensFromBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.excludeTokensFromBurn.t.sol @@ -5,7 +5,7 @@ import {USDCBridgeMigrator} from "../../../../pools/USDC/USDCBridgeMigrator.sol" import {HybridLockReleaseUSDCTokenPoolSetup} from "./USDCBridgeMigratorSetup.t.sol"; contract USDCBridgeMigrator_excludeTokensFromBurn is HybridLockReleaseUSDCTokenPoolSetup { - function test_excludeTokensWhenNoMigrationProposalPending_Revert() public { + function test_RevertWhen_excludeTokensWhenNoMigrationProposalPending() public { vm.expectRevert(abi.encodeWithSelector(USDCBridgeMigrator.NoMigrationProposalPending.selector)); vm.startPrank(OWNER); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.proposeMigration.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.proposeMigration.t.sol index b2668bde801..8477e009d59 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.proposeMigration.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.proposeMigration.t.sol @@ -5,7 +5,7 @@ import {USDCBridgeMigrator} from "../../../../pools/USDC/USDCBridgeMigrator.sol" import {HybridLockReleaseUSDCTokenPoolSetup} from "./USDCBridgeMigratorSetup.t.sol"; contract USDCBridgeMigrator_proposeMigration is HybridLockReleaseUSDCTokenPoolSetup { - function test_ChainNotUsingLockRelease_Revert() public { + function test_RevertWhen_ChainNotUsingLockRelease() public { vm.expectRevert(abi.encodeWithSelector(USDCBridgeMigrator.InvalidChainSelector.selector)); vm.startPrank(OWNER); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.provideLiquidity.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.provideLiquidity.t.sol index 88196d87795..13a58b0df71 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.provideLiquidity.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.provideLiquidity.t.sol @@ -6,7 +6,7 @@ import {HybridLockReleaseUSDCTokenPool} from "../../../../pools/USDC/HybridLockR import {USDCBridgeMigrator_BurnLockedUSDC} from "./USDCBridgeMigrator.burnLockedUSDC.t.sol"; contract USDCBridgeMigrator_provideLiquidity is USDCBridgeMigrator_BurnLockedUSDC { - function test_cannotModifyLiquidityWithoutPermissions_Revert() public { + function test_RevertWhen_cannotModifyLiquidityWithoutPermissions() public { address randomAddr = makeAddr("RANDOM"); vm.startPrank(randomAddr); @@ -17,8 +17,8 @@ contract USDCBridgeMigrator_provideLiquidity is USDCBridgeMigrator_BurnLockedUSD s_usdcTokenPool.provideLiquidity(DEST_CHAIN_SELECTOR, 1e6); } - function test_cannotProvideLiquidity_AfterMigration_Revert() public { - test_lockOrBurn_then_BurnInCCTPMigration_Success(); + function test_RevertWhen_cannotProvideLiquidity_AfterMigration() public { + test_lockOrBurn_then_BurnInCCTPMigration(); vm.startPrank(OWNER); @@ -31,7 +31,7 @@ contract USDCBridgeMigrator_provideLiquidity is USDCBridgeMigrator_BurnLockedUSD s_usdcTokenPool.provideLiquidity(DEST_CHAIN_SELECTOR, 1e6); } - function test_cannotProvideLiquidityWhenMigrationProposalPending_Revert() public { + function test_RevertWhen_cannotProvideLiquidityWhenMigrationProposalPending() public { vm.startPrank(OWNER); // Mark the destination chain as supporting CCTP, so use L/R instead. diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.releaseOrMint.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.releaseOrMint.t.sol index 40569603e96..41bd1fe3b14 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.releaseOrMint.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.releaseOrMint.t.sol @@ -11,7 +11,7 @@ import {HybridLockReleaseUSDCTokenPool_releaseOrMint} from "../HybridLockReleaseUSDCTokenPool/HybridLockReleaseUSDCTokenPool.releaseOrMint.t.sol"; contract USDCBridgeMigrator_releaseOrMint is HybridLockReleaseUSDCTokenPool_releaseOrMint { - function test_unstickManualTxAfterMigration_destChain_Success() public { + function test_unstickManualTxAfterMigration_destChain() public { address recipient = address(1234); // Test the edge case where a tx is stuck in the manual tx queue and the destination chain is the one that // should process is after a migration. I.E the message will have the Lock-Release flag set in the OffChainData, @@ -83,7 +83,7 @@ contract USDCBridgeMigrator_releaseOrMint is HybridLockReleaseUSDCTokenPool_rele ); } - function test_unstickManualTxAfterMigration_homeChain_Success() public { + function test_unstickManualTxAfterMigration_homeChain() public { address CIRCLE = makeAddr("CIRCLE"); address recipient = address(1234); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.updateChainSelectorMechanism.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.updateChainSelectorMechanism.t.sol index 9db74061a31..06c354c35f2 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.updateChainSelectorMechanism.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigrator.updateChainSelectorMechanism.t.sol @@ -6,8 +6,8 @@ import {HybridLockReleaseUSDCTokenPool} from "../../../../pools/USDC/HybridLockR import {USDCBridgeMigrator_BurnLockedUSDC} from "./USDCBridgeMigrator.burnLockedUSDC.t.sol"; contract USDCBridgeMigrator_updateChainSelectorMechanism is USDCBridgeMigrator_BurnLockedUSDC { - function test_cannotRevertChainMechanism_afterMigration_Revert() public { - test_lockOrBurn_then_BurnInCCTPMigration_Success(); + function test_RevertWhen_cannotRevertChainMechanism_afterMigration() public { + test_lockOrBurn_then_BurnInCCTPMigration(); vm.startPrank(OWNER); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigratorSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigratorSetup.t.sol index 5a250fd16a8..4d49cc020ab 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigratorSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCBridgeMigrator/USDCBridgeMigratorSetup.t.sol @@ -11,10 +11,12 @@ contract HybridLockReleaseUSDCTokenPoolSetup is USDCSetup { function setUp() public virtual override { super.setUp(); - s_usdcTokenPool = - new HybridLockReleaseUSDCTokenPool(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + s_usdcTokenPool = new HybridLockReleaseUSDCTokenPool( + s_mockUSDC, s_token, new address[](0), address(s_mockRMNRemote), address(s_router) + ); - s_usdcTokenPoolTransferLiquidity = - new HybridLockReleaseUSDCTokenPool(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + s_usdcTokenPoolTransferLiquidity = new HybridLockReleaseUSDCTokenPool( + s_mockUSDC, s_token, new address[](0), address(s_mockRMNRemote), address(s_router) + ); } } diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCSetup.t.sol index 9ec89b52582..9833d6d5c66 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCSetup.t.sol @@ -85,7 +85,7 @@ contract USDCSetup is BaseTest { } function _setUpRamps() internal { - s_router = new Router(address(s_token), address(s_mockRMN)); + s_router = new Router(address(s_token), address(s_mockRMNRemote)); Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); onRampUpdates[0] = Router.OnRamp({destChainSelector: DEST_CHAIN_SELECTOR, onRamp: s_routerAllowedOnRamp}); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.lockOrBurn.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.lockOrBurn.t.sol index 03d328b8e8c..8673a7b3ee5 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.lockOrBurn.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.lockOrBurn.t.sol @@ -12,7 +12,7 @@ import {USDCTokenPoolSetup} from "./USDCTokenPoolSetup.t.sol"; contract USDCTokenPool_lockOrBurn is USDCTokenPoolSetup { // Base test case, included for PR gas comparisons as fuzz tests are excluded from forge snapshot due to being flaky. - function test_LockOrBurn_Success() public { + function test_LockOrBurn() public { bytes32 receiver = bytes32(uint256(uint160(STRANGER))); uint256 amount = 1; s_token.transfer(address(s_usdcTokenPool), amount); @@ -132,7 +132,7 @@ contract USDCTokenPool_lockOrBurn is USDCTokenPoolSetup { } // Reverts - function test_UnknownDomain_Revert() public { + function test_RevertWhen_UnknownDomain() public { uint64 wrongDomain = DEST_CHAIN_SELECTOR + 1; // We need to setup the wrong chainSelector so it reaches the domain check Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](1); @@ -168,7 +168,7 @@ contract USDCTokenPool_lockOrBurn is USDCTokenPoolSetup { ); } - function test_CallerIsNotARampOnRouter_Revert() public { + function test_RevertWhen_CallerIsNotARampOnRouter() public { vm.expectRevert(abi.encodeWithSelector(TokenPool.CallerIsNotARampOnRouter.selector, OWNER)); s_usdcTokenPool.lockOrBurn( @@ -182,7 +182,7 @@ contract USDCTokenPool_lockOrBurn is USDCTokenPoolSetup { ); } - function test_LockOrBurnWithAllowList_Revert() public { + function test_RevertWhen_LockOrBurnWithAllowList() public { vm.startPrank(s_routerAllowedOnRamp); vm.expectRevert(abi.encodeWithSelector(TokenPool.SenderNotAllowed.selector, STRANGER)); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.releaseOrMint.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.releaseOrMint.t.sol index 4499c748a6b..8ec8da22d22 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.releaseOrMint.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.releaseOrMint.t.sol @@ -84,7 +84,7 @@ contract USDCTokenPool_releaseOrMint is USDCTokenPoolSetup { } // https://etherscan.io/tx/0xac9f501fe0b76df1f07a22e1db30929fd12524bc7068d74012dff948632f0883 - function test_ReleaseOrMintRealTx_Success() public { + function test_ReleaseOrMintRealTx() public { bytes memory encodedUsdcMessage = hex"000000000000000300000000000000000000127a00000000000000000000000019330d10d9cc8751218eaf51e8885d058642e08a000000000000000000000000bd3fa81b58ba92a82136038b25adec7066af3155000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000004af08f56978be7dce2d1be3c65c005b41e79401c000000000000000000000000000000000000000000000000000000002057ff7a0000000000000000000000003a23f943181408eac424116af7b7790c94cb97a50000000000000000000000000000000000000000000000000000000000000000000000000000008274119237535fd659626b090f87e365ff89ebc7096bb32e8b0e85f155626b73ae7c4bb2485c184b7cc3cf7909045487890b104efb62ae74a73e32901bdcec91df1bb9ee08ccb014fcbcfe77b74d1263fd4e0b0e8de05d6c9a5913554364abfd5ea768b222f50c715908183905d74044bb2b97527c7e70ae7983c443a603557cac3b1c000000000000000000000000000000000000000000000000000000000000"; bytes memory attestation = bytes("attestation bytes"); @@ -127,7 +127,7 @@ contract USDCTokenPool_releaseOrMint is USDCTokenPoolSetup { } // Reverts - function test_UnlockingUSDCFailed_Revert() public { + function test_RevertWhen_UnlockingUSDCFailed() public { vm.startPrank(s_routerAllowedOffRamp); s_mockUSDCTransmitter.setShouldSucceed(false); @@ -179,7 +179,7 @@ contract USDCTokenPool_releaseOrMint is USDCTokenPoolSetup { ); } - function test_TokenMaxCapacityExceeded_Revert() public { + function test_RevertWhen_TokenMaxCapacityExceeded() public { uint256 capacity = _getInboundRateLimiterConfig().capacity; uint256 amount = 10 * capacity; address recipient = address(1); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.setDomains.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.setDomains.t.sol index 7fcb75fdf3f..76bf12ddad6 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.setDomains.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.setDomains.t.sol @@ -47,7 +47,7 @@ contract USDCTokenPool_setDomains is USDCTokenPoolSetup { // Reverts - function test_OnlyOwner_Revert() public { + function test_RevertWhen_OnlyOwner() public { USDCTokenPool.DomainUpdate[] memory domainUpdates = new USDCTokenPool.DomainUpdate[](0); vm.startPrank(STRANGER); @@ -56,7 +56,7 @@ contract USDCTokenPool_setDomains is USDCTokenPoolSetup { s_usdcTokenPool.setDomains(domainUpdates); } - function test_InvalidDomain_Revert() public { + function test_RevertWhen_InvalidDomain() public { bytes32 validCaller = bytes32(uint256(25)); // Ensure valid domain works USDCTokenPool.DomainUpdate[] memory domainUpdates = new USDCTokenPool.DomainUpdate[](1); diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.supportsInterface.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.supportsInterface.t.sol index 05ac5f08136..2f4282c04f8 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.supportsInterface.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.supportsInterface.t.sol @@ -7,7 +7,7 @@ import {USDCTokenPoolSetup} from "./USDCTokenPoolSetup.t.sol"; import {IERC165} from "../../../../../vendor/openzeppelin-solidity/v5.0.2/contracts/utils/introspection/IERC165.sol"; contract USDCTokenPool_supportsInterface is USDCTokenPoolSetup { - function test_SupportsInterface_Success() public view { + function test_SupportsInterface() public view { assertTrue(s_usdcTokenPool.supportsInterface(type(IPoolV1).interfaceId)); assertTrue(s_usdcTokenPool.supportsInterface(type(IERC165).interfaceId)); } diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.validateMessage.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.validateMessage.t.sol index 975368c38b9..2ff03890af6 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.validateMessage.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPool.validateMessage.t.sol @@ -28,7 +28,7 @@ contract USDCTokenPool__validateMessage is USDCTokenPoolSetup { // Reverts - function test_ValidateInvalidMessage_Revert() public { + function test_RevertWhen_ValidateInvalidMessage() public { USDCMessage memory usdcMessage = USDCMessage({ version: 0, sourceDomain: 1553252, diff --git a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPoolSetup.t.sol b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPoolSetup.t.sol index bc6108926b3..34433695263 100644 --- a/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPoolSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/pools/USDC/USDCTokenPool/USDCTokenPoolSetup.t.sol @@ -14,11 +14,11 @@ contract USDCTokenPoolSetup is USDCSetup { super.setUp(); s_usdcTokenPool = - new USDCTokenPoolHelper(s_mockUSDC, s_token, new address[](0), address(s_mockRMN), address(s_router)); + new USDCTokenPoolHelper(s_mockUSDC, s_token, new address[](0), address(s_mockRMNRemote), address(s_router)); - s_allowedList.push(USER_1); + s_allowedList.push(vm.randomAddress()); s_usdcTokenPoolWithAllowList = - new USDCTokenPoolHelper(s_mockUSDC, s_token, s_allowedList, address(s_mockRMN), address(s_router)); + new USDCTokenPoolHelper(s_mockUSDC, s_token, s_allowedList, address(s_mockRMNRemote), address(s_router)); _poolApplyChainUpdates(address(s_usdcTokenPool)); _poolApplyChainUpdates(address(s_usdcTokenPoolWithAllowList)); diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiterSetup.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiterSetup.t.sol index d3e87f5faa4..e2e0f81e850 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiterSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiterSetup.t.sol @@ -5,12 +5,10 @@ import {MultiAggregateRateLimiter} from "../../../MultiAggregateRateLimiter.sol" import {Client} from "../../../libraries/Client.sol"; import {Internal} from "../../../libraries/Internal.sol"; import {RateLimiter} from "../../../libraries/RateLimiter.sol"; -import {BaseTest} from "../../BaseTest.t.sol"; - import {FeeQuoterSetup} from "../../feeQuoter/FeeQuoterSetup.t.sol"; import {MultiAggregateRateLimiterHelper} from "../../helpers/MultiAggregateRateLimiterHelper.sol"; -contract MultiAggregateRateLimiterSetup is BaseTest, FeeQuoterSetup { +contract MultiAggregateRateLimiterSetup is FeeQuoterSetup { MultiAggregateRateLimiterHelper internal s_rateLimiter; address internal constant TOKEN = 0x21118E64E1fB0c487F25Dd6d3601FF6af8D32E4e; @@ -27,8 +25,7 @@ contract MultiAggregateRateLimiterSetup is BaseTest, FeeQuoterSetup { address[] internal s_authorizedCallers; - function setUp() public virtual override(BaseTest, FeeQuoterSetup) { - BaseTest.setUp(); + function setUp() public virtual override { FeeQuoterSetup.setUp(); Internal.PriceUpdates memory priceUpdates = _getSingleTokenPriceUpdateStruct(TOKEN, TOKEN_PRICE); diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_applyRateLimiterConfigUpdates.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_applyRateLimiterConfigUpdates.t.sol index 306be6b5956..bcec553486d 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_applyRateLimiterConfigUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_applyRateLimiterConfigUpdates.t.sol @@ -9,7 +9,7 @@ import {MultiAggregateRateLimiterSetup} from "./MultiAggregateRateLimiterSetup.t import {Vm} from "forge-std/Vm.sol"; contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggregateRateLimiterSetup { - function test_ZeroConfigs_Success() public { + function test_ZeroConfigs() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](0); @@ -20,7 +20,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega assertEq(logEntries.length, 0); } - function test_SingleConfig_Success() public { + function test_SingleConfig() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -46,7 +46,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega assertEq(BLOCK_TIME, bucket1.lastUpdated); } - function test_SingleConfigOutbound_Success() public { + function test_SingleConfigOutbound() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -72,7 +72,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega assertEq(BLOCK_TIME, bucket1.lastUpdated); } - function test_MultipleConfigs_Success() public { + function test_MultipleConfigs() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](5); @@ -103,7 +103,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega } } - function test_MultipleConfigsBothLanes_Success() public { + function test_MultipleConfigsBothLanes() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](2); @@ -134,7 +134,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega } } - function test_UpdateExistingConfig_Success() public { + function test_UpdateExistingConfig() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -170,7 +170,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega ); } - function test_UpdateExistingConfigWithNoDifference_Success() public { + function test_UpdateExistingConfigWithNoDifference() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -198,7 +198,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega } // Reverts - function test_ZeroChainSelector_Revert() public { + function test_RevertWhen_ZeroChainSelector() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -211,7 +211,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); } - function test_OnlyCallableByOwner_Revert() public { + function test_RevertWhen_OnlyCallableByOwner() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -225,7 +225,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); } - function test_ConfigRateMoreThanCapacity_Revert() public { + function test_RevertWhen_ConfigRateMoreThanCapacity() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -240,7 +240,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); } - function test_ConfigRateZero_Revert() public { + function test_RevertWhen_ConfigRateZero() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -255,7 +255,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); } - function test_DisableConfigRateNonZero_Revert() public { + function test_RevertWhen_DisableConfigRateNonZero() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -270,7 +270,7 @@ contract MultiAggregateRateLimiter_applyRateLimiterConfigUpdates is MultiAggrega s_rateLimiter.applyRateLimiterConfigUpdates(configUpdates); } - function test_DiableConfigCapacityNonZero_Revert() public { + function test_RevertWhen_DiableConfigCapacityNonZero() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_constructor.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_constructor.t.sol index 0f858a79a56..80caa57aa9b 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_constructor.t.sol @@ -7,7 +7,7 @@ import {MultiAggregateRateLimiterSetup} from "./MultiAggregateRateLimiterSetup.t import {Vm} from "forge-std/Vm.sol"; contract MultiAggregateRateLimiter_constructor is MultiAggregateRateLimiterSetup { - function test_ConstructorNoAuthorizedCallers_Success() public { + function test_ConstructorNoAuthorizedCallers() public { address[] memory authorizedCallers = new address[](0); vm.recordLogs(); @@ -21,7 +21,7 @@ contract MultiAggregateRateLimiter_constructor is MultiAggregateRateLimiterSetup assertEq(address(s_feeQuoter), s_rateLimiter.getFeeQuoter()); } - function test_Constructor_Success() public { + function test_Constructor() public { address[] memory authorizedCallers = new address[](2); authorizedCallers[0] = MOCK_OFFRAMP; authorizedCallers[1] = MOCK_ONRAMP; diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenBucket.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenBucket.t.sol index bfb5da07da3..a0a66909ced 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenBucket.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenBucket.t.sol @@ -8,7 +8,7 @@ import {MultiAggregateRateLimiterSetup} from "./MultiAggregateRateLimiterSetup.t import {stdError} from "forge-std/Test.sol"; contract MultiAggregateRateLimiter_getTokenBucket is MultiAggregateRateLimiterSetup { - function test_GetTokenBucket_Success() public view { + function test_GetTokenBucket() public view { RateLimiter.TokenBucket memory bucketInbound = s_rateLimiter.currentRateLimiterState(CHAIN_SELECTOR_1, false); _assertConfigWithTokenBucketEquality(s_rateLimiterConfig1, bucketInbound); assertEq(BLOCK_TIME, bucketInbound.lastUpdated); @@ -18,7 +18,7 @@ contract MultiAggregateRateLimiter_getTokenBucket is MultiAggregateRateLimiterSe assertEq(BLOCK_TIME, bucketOutbound.lastUpdated); } - function test_Refill_Success() public { + function test_Refill() public { s_rateLimiterConfig1.capacity = s_rateLimiterConfig1.capacity * 2; MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = @@ -57,7 +57,7 @@ contract MultiAggregateRateLimiter_getTokenBucket is MultiAggregateRateLimiterSe // Reverts - function test_TimeUnderflow_Revert() public { + function test_RevertWhen_TimeUnderflow() public { vm.warp(BLOCK_TIME - 1); vm.expectRevert(stdError.arithmeticError); diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenValue.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenValue.t.sol index 9b4448339e8..73180981ef3 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenValue.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_getTokenValue.t.sol @@ -6,7 +6,7 @@ import {Client} from "../../../libraries/Client.sol"; import {MultiAggregateRateLimiterSetup} from "./MultiAggregateRateLimiterSetup.t.sol"; contract MultiAggregateRateLimiter_getTokenValue is MultiAggregateRateLimiterSetup { - function test_GetTokenValue_Success() public view { + function test_GetTokenValue() public view { uint256 numberOfTokens = 10; Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: TOKEN, amount: 10}); uint256 value = s_rateLimiter.getTokenValue(tokenAmount); @@ -14,7 +14,7 @@ contract MultiAggregateRateLimiter_getTokenValue is MultiAggregateRateLimiterSet } // Reverts - function test_NoTokenPrice_Reverts() public { + function test_RevertWhen_NoTokenPrices() public { address tokenWithNoPrice = makeAddr("Token with no price"); Client.EVMTokenAmount memory tokenAmount = Client.EVMTokenAmount({token: tokenWithNoPrice, amount: 10}); diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onInboundMessage.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onInboundMessage.t.sol index 8697dae871e..fbd83598d38 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onInboundMessage.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onInboundMessage.t.sol @@ -34,7 +34,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); } - function test_ValidateMessageWithNoTokens_Success() public { + function test_ValidateMessageWithNoTokens() public { vm.startPrank(MOCK_OFFRAMP); vm.recordLogs(); @@ -45,7 +45,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter assertEq(logEntries.length, 0); } - function test_ValidateMessageWithTokens_Success() public { + function test_ValidateMessageWithTokens() public { vm.startPrank(MOCK_OFFRAMP); Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); @@ -59,7 +59,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); } - function test_ValidateMessageWithDisabledRateLimitToken_Success() public { + function test_ValidateMessageWithDisabledRateLimitToken() public { MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = new MultiAggregateRateLimiter.LocalRateLimitToken[](1); removes[0] = MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -80,7 +80,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); } - function test_ValidateMessageWithRateLimitDisabled_Success() public { + function test_ValidateMessageWithRateLimitDisabled() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -104,7 +104,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter assertEq(logEntries.length, 0); } - function test_ValidateMessageWithTokensOnDifferentChains_Success() public { + function test_ValidateMessageWithTokensOnDifferentChains() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = new MultiAggregateRateLimiter.RateLimitTokenArgs[](s_sourceTokens.length); for (uint224 i = 0; i < s_sourceTokens.length; ++i) { @@ -152,7 +152,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter assertEq(bucketChain2.capacity - totalValue, bucketChain2.tokens); } - function test_ValidateMessageWithDifferentTokensOnDifferentChains_Success() public { + function test_ValidateMessageWithDifferentTokensOnDifferentChains() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); @@ -203,7 +203,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter assertEq(bucketChain2.capacity - totalValue2, bucketChain2.tokens); } - function test_ValidateMessageWithRateLimitReset_Success() public { + function test_ValidateMessageWithRateLimitReset() public { vm.startPrank(MOCK_OFFRAMP); Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); @@ -228,7 +228,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter // Reverts - function test_ValidateMessageWithRateLimitExceeded_Revert() public { + function test_RevertWhen_ValidateMessageWithRateLimitExceeded() public { vm.startPrank(MOCK_OFFRAMP); Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); @@ -240,7 +240,7 @@ contract MultiAggregateRateLimiter_onInboundMessage is MultiAggregateRateLimiter s_rateLimiter.onInboundMessage(_generateAny2EVMMessage(CHAIN_SELECTOR_1, tokenAmounts)); } - function test_ValidateMessageFromUnauthorizedCaller_Revert() public { + function test_RevertWhen_ValidateMessageFromUnauthorizedCaller() public { vm.startPrank(STRANGER); vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onOutboundMessage.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onOutboundMessage.t.sol index 9d20e203619..44e3cf0b8f4 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onOutboundMessage.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_onOutboundMessage.t.sol @@ -31,7 +31,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), tokensToAdd); } - function test_ValidateMessageWithNoTokens_Success() public { + function test_ValidateMessageWithNoTokens() public { vm.startPrank(MOCK_ONRAMP); vm.recordLogs(); @@ -41,7 +41,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite assertEq(vm.getRecordedLogs().length, 0); } - function test_onOutboundMessage_ValidateMessageWithTokens_Success() public { + function test_onOutboundMessage_ValidateMessageWithTokens() public { vm.startPrank(MOCK_ONRAMP); Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); @@ -55,7 +55,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); } - function test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken_Success() public { + function test_onOutboundMessage_ValidateMessageWithDisabledRateLimitToken() public { MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = new MultiAggregateRateLimiter.LocalRateLimitToken[](1); removes[0] = MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -76,7 +76,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); } - function test_onOutboundMessage_ValidateMessageWithRateLimitDisabled_Success() public { + function test_onOutboundMessage_ValidateMessageWithRateLimitDisabled() public { MultiAggregateRateLimiter.RateLimiterConfigArgs[] memory configUpdates = new MultiAggregateRateLimiter.RateLimiterConfigArgs[](1); configUpdates[0] = MultiAggregateRateLimiter.RateLimiterConfigArgs({ @@ -99,7 +99,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite assertEq(vm.getRecordedLogs().length, 0); } - function test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains_Success() public { + function test_onOutboundMessage_ValidateMessageWithTokensOnDifferentChains() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = new MultiAggregateRateLimiter.RateLimitTokenArgs[](s_sourceTokens.length); for (uint224 i = 0; i < s_sourceTokens.length; ++i) { @@ -147,7 +147,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite assertEq(bucketChain2.capacity - totalValue, bucketChain2.tokens); } - function test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains_Success() public { + function test_onOutboundMessage_ValidateMessageWithDifferentTokensOnDifferentChains() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory tokensToAdd = new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); @@ -198,7 +198,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite assertEq(bucketChain2.capacity - totalValue2, bucketChain2.tokens); } - function test_onOutboundMessage_ValidateMessageWithRateLimitReset_Success() public { + function test_onOutboundMessage_ValidateMessageWithRateLimitReset() public { vm.startPrank(MOCK_ONRAMP); Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); @@ -221,7 +221,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); } - function test_RateLimitValueDifferentLanes_Success() public { + function test_RateLimitValueDifferentLanes() public { vm.pauseGasMetering(); // start from blocktime that does not equal rate limiter init timestamp vm.warp(BLOCK_TIME + 1); @@ -266,7 +266,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite // Reverts - function test_onOutboundMessage_ValidateMessageWithRateLimitExceeded_Revert() public { + function test_RevertWhen_onOutboundMessage_ValidateMessageWithRateLimitExceeded() public { vm.startPrank(MOCK_OFFRAMP); Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](2); @@ -278,7 +278,7 @@ contract MultiAggregateRateLimiter_onOutboundMessage is MultiAggregateRateLimite s_rateLimiter.onOutboundMessage(CHAIN_SELECTOR_1, _generateEVM2AnyMessage(tokenAmounts)); } - function test_onOutboundMessage_ValidateMessageFromUnauthorizedCaller_Revert() public { + function test_RevertWhen_onOutboundMessage_ValidateMessageFromUnauthorizedCaller() public { vm.startPrank(STRANGER); vm.expectRevert(abi.encodeWithSelector(AuthorizedCallers.UnauthorizedCaller.selector, STRANGER)); diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_setFeeQuoter.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_setFeeQuoter.t.sol index 39412a65045..4ac831fa326 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_setFeeQuoter.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_setFeeQuoter.t.sol @@ -7,7 +7,7 @@ import {MultiAggregateRateLimiter} from "../../../MultiAggregateRateLimiter.sol" import {MultiAggregateRateLimiterSetup} from "./MultiAggregateRateLimiterSetup.t.sol"; contract MultiAggregateRateLimiter_setFeeQuoter is MultiAggregateRateLimiterSetup { - function test_Owner_Success() public { + function test_Owner() public { address newAddress = address(42); vm.expectEmit(); @@ -19,14 +19,14 @@ contract MultiAggregateRateLimiter_setFeeQuoter is MultiAggregateRateLimiterSetu // Reverts - function test_OnlyOwner_Revert() public { + function test_RevertWhen_OnlyOwner() public { vm.startPrank(STRANGER); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); s_rateLimiter.setFeeQuoter(STRANGER); } - function test_ZeroAddress_Revert() public { + function test_RevertWhen_ZeroAddress() public { vm.expectRevert(AuthorizedCallers.ZeroAddressNotAllowed.selector); s_rateLimiter.setFeeQuoter(address(0)); } diff --git a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_updateRateLimitTokens.t.sol b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_updateRateLimitTokens.t.sol index 2125983ed70..ee17aa3d3b8 100644 --- a/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_updateRateLimitTokens.t.sol +++ b/contracts/src/v0.8/ccip/test/rateLimiter/MutiAggregateRateLimiter/MultiAggregateRateLimiter_updateRateLimitTokens.t.sol @@ -24,7 +24,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi s_rateLimiter.updateRateLimitTokens(removes, new MultiAggregateRateLimiter.RateLimitTokenArgs[](0)); } - function test_UpdateRateLimitTokensSingleChain_Success() public { + function test_UpdateRateLimitTokensSingleChain() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](2); adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -61,7 +61,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi } } - function test_UpdateRateLimitTokensMultipleChains_Success() public { + function test_UpdateRateLimitTokensMultipleChains() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](2); adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -104,7 +104,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi assertEq(remoteTokensChain2[0], adds[1].remoteToken); } - function test_UpdateRateLimitTokens_AddsAndRemoves_Success() public { + function test_UpdateRateLimitTokens_AddsAndRemoves() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](2); adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -150,7 +150,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi assertEq(adds[1].localTokenArgs.localToken, localTokens[0]); } - function test_UpdateRateLimitTokens_RemoveNonExistentToken_Success() public { + function test_UpdateRateLimitTokens_RemoveNonExistentToken() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](0); MultiAggregateRateLimiter.LocalRateLimitToken[] memory removes = @@ -175,7 +175,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi // Reverts - function test_ZeroSourceToken_Revert() public { + function test_RevertWhen_ZeroSourceToken() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -189,7 +189,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); } - function test_ZeroDestToken_Revert() public { + function test_RevertWhen_ZeroDestToken() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -203,7 +203,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); } - function test_ZeroDestToken_AbiEncoded_Revert() public { + function test_RevertWhen_ZeroDestToken_AbiEncoded() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](1); adds[0] = MultiAggregateRateLimiter.RateLimitTokenArgs({ localTokenArgs: MultiAggregateRateLimiter.LocalRateLimitToken({ @@ -217,7 +217,7 @@ contract MultiAggregateRateLimiter_updateRateLimitTokens is MultiAggregateRateLi s_rateLimiter.updateRateLimitTokens(new MultiAggregateRateLimiter.LocalRateLimitToken[](0), adds); } - function test_NonOwner_Revert() public { + function test_RevertWhen_NonOwner() public { MultiAggregateRateLimiter.RateLimitTokenArgs[] memory adds = new MultiAggregateRateLimiter.RateLimitTokenArgs[](4); vm.startPrank(STRANGER); diff --git a/contracts/src/v0.8/ccip/test/rmn/ArmProxy/ArmProxy.isCursed.t.sol b/contracts/src/v0.8/ccip/test/rmn/ArmProxy/ArmProxy.isCursed.t.sol index fdc6fce0cf4..78b198c6c9d 100644 --- a/contracts/src/v0.8/ccip/test/rmn/ArmProxy/ArmProxy.isCursed.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/ArmProxy/ArmProxy.isCursed.t.sol @@ -4,39 +4,42 @@ pragma solidity 0.8.24; import {IRMN} from "../../../interfaces/IRMN.sol"; import {ARMProxy} from "../../../rmn/ARMProxy.sol"; -import {MockRMN} from "../../mocks/MockRMN.sol"; - +import {GLOBAL_CURSE_SUBJECT, RMNRemote} from "../../../rmn/RMNRemote.sol"; import {ARMProxyTestSetup} from "./ARMProxyTestSetup.t.sol"; contract ARMProxy_isCursed is ARMProxyTestSetup { - MockRMN internal s_mockRMN; + RMNRemote internal s_mockRMNRemote; function setUp() public virtual override { super.setUp(); - s_mockRMN = new MockRMN(); - s_armProxy = new ARMProxy(address(s_mockRMN)); + s_mockRMNRemote = new RMNRemote(1, IRMN(address(0))); + s_armProxy = new ARMProxy(address(s_mockRMNRemote)); } - function test_IsCursed_Success() public { - s_armProxy.setARM(address(s_mockRMN)); + function test_IsCursed_GlobalCurseSubject() public { assertFalse(IRMN(address(s_armProxy)).isCursed()); - s_mockRMN.setGlobalCursed(true); - assertTrue(IRMN(address(s_armProxy)).isCursed()); + + s_mockRMNRemote.curse(GLOBAL_CURSE_SUBJECT); + vm.assertTrue(IRMN(address(s_armProxy)).isCursed()); } - function test_isCursed_RevertReasonForwarded_Revert() public { + error CustomError(bytes err); + + function test_isCursed_RevertWhen_isCursedReasonForwarded() public { bytes memory err = bytes("revert"); - s_mockRMN.setIsCursedRevert(err); - s_armProxy.setARM(address(s_mockRMN)); - vm.expectRevert(abi.encodeWithSelector(MockRMN.CustomError.selector, err)); + vm.mockCallRevert( + address(s_mockRMNRemote), abi.encodeWithSignature("isCursed()"), abi.encodeWithSelector(CustomError.selector, err) + ); + + s_armProxy.setARM(address(s_mockRMNRemote)); + vm.expectRevert(abi.encodeWithSelector(CustomError.selector, err)); IRMN(address(s_armProxy)).isCursed(); } - function test_call_ARMCallEmptyContract_Revert() public { + function test_RevertWhen_call_ARMCallEmptyContract() public { s_armProxy.setARM(EMPTY_ADDRESS); // No code at address 1, should revert. vm.expectRevert(); - bytes memory b = new bytes(0); - (bool success,) = address(s_armProxy).call(b); + (bool success,) = address(s_armProxy).call(new bytes(0)); success; } } diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.getConfigDigests.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.getConfigDigests.t.sol index b339bb183e7..9ca1ee1ddbd 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.getConfigDigests.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.getConfigDigests.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {RMNHomeTestSetup} from "./RMNHomeTestSetup.t.sol"; contract RMNHome_getConfigDigests is RMNHomeTestSetup { - function test_getConfigDigests_success() public { + function test_getConfigDigests() public { (bytes32 activeDigest, bytes32 candidateDigest) = s_rmnHome.getConfigDigests(); assertEq(activeDigest, ZERO_DIGEST); assertEq(candidateDigest, ZERO_DIGEST); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.promoteCandidateAndRevokeActive.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.promoteCandidateAndRevokeActive.t.sol index 6d99ed1cfaa..0a15f9d5a0f 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.promoteCandidateAndRevokeActive.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.promoteCandidateAndRevokeActive.t.sol @@ -7,7 +7,7 @@ import {RMNHome} from "../../../rmn/RMNHome.sol"; import {RMNHomeTestSetup} from "./RMNHomeTestSetup.t.sol"; contract RMNHome_promoteCandidateAndRevokeActive is RMNHomeTestSetup { - function test_promoteCandidateAndRevokeActive_success() public { + function test_promoteCandidateAndRevokeActive() public { Config memory config = _getBaseConfig(); bytes32 firstConfigToPromote = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); @@ -43,12 +43,12 @@ contract RMNHome_promoteCandidateAndRevokeActive is RMNHomeTestSetup { assertEq(candidateConfig.configDigest, ZERO_DIGEST); } - function test_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed_reverts() public { + function test_RevertWhen_promoteCandidateAndRevokeActive_NoOpStateTransitionNotAllowed() public { vm.expectRevert(RMNHome.NoOpStateTransitionNotAllowed.selector); s_rmnHome.promoteCandidateAndRevokeActive(ZERO_DIGEST, ZERO_DIGEST); } - function test_promoteCandidateAndRevokeActive_ConfigDigestMismatch_reverts() public { + function test_RevertWhen_promoteCandidateAndRevokeActive_ConfigDigestMismatch() public { (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = s_rmnHome.getConfigDigests(); bytes32 wrongActiveDigest = keccak256("wrongActiveDigest"); bytes32 wrongCandidateDigest = keccak256("wrongCandidateDigest"); @@ -63,7 +63,7 @@ contract RMNHome_promoteCandidateAndRevokeActive is RMNHomeTestSetup { s_rmnHome.promoteCandidateAndRevokeActive(priorCandidateDigest, wrongActiveDigest); } - function test_promoteCandidateAndRevokeActive_OnlyOwner_reverts() public { + function test_RevertWhen_promoteCandidateAndRevokeActive_OnlyOwner() public { vm.startPrank(address(0)); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.revokeCandidate.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.revokeCandidate.t.sol index a486bd193ff..9c6c819b7eb 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.revokeCandidate.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.revokeCandidate.t.sol @@ -17,7 +17,7 @@ contract RMNHome_revokeCandidate is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); } - function test_revokeCandidate_success() public { + function test_revokeCandidate() public { (bytes32 priorActiveDigest, bytes32 priorCandidateDigest) = s_rmnHome.getConfigDigests(); vm.expectEmit(); @@ -39,7 +39,7 @@ contract RMNHome_revokeCandidate is RMNHomeTestSetup { assertTrue(candidateDigest != priorCandidateDigest); } - function test_revokeCandidate_ConfigDigestMismatch_reverts() public { + function test_RevertWhen_revokeCandidate_ConfigDigestMismatch() public { (, bytes32 priorCandidateDigest) = s_rmnHome.getConfigDigests(); bytes32 wrongDigest = keccak256("wrong_digest"); @@ -47,12 +47,12 @@ contract RMNHome_revokeCandidate is RMNHomeTestSetup { s_rmnHome.revokeCandidate(wrongDigest); } - function test_revokeCandidate_RevokingZeroDigestNotAllowed_reverts() public { + function test_RevertWhen_revokeCandidate_RevokingZeroDigestNotAllowed() public { vm.expectRevert(RMNHome.RevokingZeroDigestNotAllowed.selector); s_rmnHome.revokeCandidate(ZERO_DIGEST); } - function test_revokeCandidate_OnlyOwner_reverts() public { + function test_RevertWhen_revokeCandidate_OnlyOwner() public { vm.startPrank(address(0)); vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setCandidate.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setCandidate.t.sol index 6fae7a90552..65200d85b61 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setCandidate.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setCandidate.t.sol @@ -7,7 +7,7 @@ import {RMNHome} from "../../../rmn/RMNHome.sol"; import {RMNHomeTestSetup} from "./RMNHomeTestSetup.t.sol"; contract RMNHome_setCandidate is RMNHomeTestSetup { - function test_setCandidate_success() public { + function test_setCandidate() public { Config memory config = _getBaseConfig(); RMNHome.VersionedConfig memory versionedConfig = RMNHome.VersionedConfig({ version: 1, @@ -49,7 +49,7 @@ contract RMNHome_setCandidate is RMNHomeTestSetup { assertEq(storedStaticConfig.offchainConfig, versionedConfig.staticConfig.offchainConfig); } - function test_setCandidate_ConfigDigestMismatch_reverts() public { + function test_RevertWhen_setCandidate_ConfigDigestMismatch() public { Config memory config = _getBaseConfig(); bytes32 digest = s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); @@ -63,7 +63,7 @@ contract RMNHome_setCandidate is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, digest); } - function test_setCandidate_OnlyOwner_reverts() public { + function test_RevertWhen_setCandidate_OnlyOwner() public { Config memory config = _getBaseConfig(); vm.startPrank(address(0)); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setDynamicConfig.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setDynamicConfig.t.sol index 048a6ef226e..55bafa3128b 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setDynamicConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.setDynamicConfig.t.sol @@ -12,7 +12,7 @@ contract RMNHome_setDynamicConfig is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); } - function test_setDynamicConfig_success() public { + function test_setDynamicConfig() public { (bytes32 priorActiveDigest,) = s_rmnHome.getConfigDigests(); Config memory config = _getBaseConfig(); @@ -36,7 +36,7 @@ contract RMNHome_setDynamicConfig is RMNHomeTestSetup { } // Asserts the validation function is being called - function test_setDynamicConfig_MinObserversTooHigh_reverts() public { + function test_RevertWhen_setDynamicConfig_MinObserversTooHigh() public { Config memory config = _getBaseConfig(); config.dynamicConfig.sourceChains[0].f++; @@ -44,7 +44,7 @@ contract RMNHome_setDynamicConfig is RMNHomeTestSetup { s_rmnHome.setDynamicConfig(config.dynamicConfig, ZERO_DIGEST); } - function test_setDynamicConfig_DigestNotFound_reverts() public { + function test_RevertWhen_setDynamicConfig_DigestNotFound() public { // Zero always reverts vm.expectRevert(abi.encodeWithSelector(RMNHome.DigestNotFound.selector, ZERO_DIGEST)); s_rmnHome.setDynamicConfig(_getBaseConfig().dynamicConfig, ZERO_DIGEST); @@ -55,7 +55,7 @@ contract RMNHome_setDynamicConfig is RMNHomeTestSetup { s_rmnHome.setDynamicConfig(_getBaseConfig().dynamicConfig, nonExistentDigest); } - function test_setDynamicConfig_OnlyOwner_reverts() public { + function test_RevertWhen_setDynamicConfig_OnlyOwner() public { Config memory config = _getBaseConfig(); vm.startPrank(address(0)); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.validateStaticAndDynamicConfig.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.validateStaticAndDynamicConfig.t.sol index 2aa7b1a5100..f228cf65b9d 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.validateStaticAndDynamicConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNHome/RMNHome.validateStaticAndDynamicConfig.t.sol @@ -6,7 +6,7 @@ import {RMNHome} from "../../../rmn/RMNHome.sol"; import {RMNHomeTestSetup} from "./RMNHomeTestSetup.t.sol"; contract RMNHome_validateStaticAndDynamicConfig is RMNHomeTestSetup { - function test_validateStaticAndDynamicConfig_OutOfBoundsNodesLength_reverts() public { + function test_RevertWhen_validateStaticAndDynamicConfig_OutOfBoundsNodesLength() public { Config memory config = _getBaseConfig(); config.staticConfig.nodes = new RMNHome.Node[](257); @@ -14,7 +14,7 @@ contract RMNHome_validateStaticAndDynamicConfig is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); } - function test_validateStaticAndDynamicConfig_DuplicatePeerId_reverts() public { + function test_RevertWhen_validateStaticAndDynamicConfig_DuplicatePeerId() public { Config memory config = _getBaseConfig(); config.staticConfig.nodes[1].peerId = config.staticConfig.nodes[0].peerId; @@ -22,7 +22,7 @@ contract RMNHome_validateStaticAndDynamicConfig is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); } - function test_validateStaticAndDynamicConfig_DuplicateOffchainPublicKey_reverts() public { + function test_RevertWhen_validateStaticAndDynamicConfig_DuplicateOffchainPublicKey() public { Config memory config = _getBaseConfig(); config.staticConfig.nodes[1].offchainPublicKey = config.staticConfig.nodes[0].offchainPublicKey; @@ -30,7 +30,7 @@ contract RMNHome_validateStaticAndDynamicConfig is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); } - function test_validateStaticAndDynamicConfig_DuplicateSourceChain_reverts() public { + function test_RevertWhen_validateStaticAndDynamicConfig_DuplicateSourceChain() public { Config memory config = _getBaseConfig(); config.dynamicConfig.sourceChains[1].chainSelector = config.dynamicConfig.sourceChains[0].chainSelector; @@ -38,7 +38,7 @@ contract RMNHome_validateStaticAndDynamicConfig is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); } - function test_validateStaticAndDynamicConfig_OutOfBoundsObserverNodeIndex_reverts() public { + function test_RevertWhen_validateStaticAndDynamicConfig_OutOfBoundsObserverNodeIndex() public { Config memory config = _getBaseConfig(); config.dynamicConfig.sourceChains[0].observerNodesBitmap = 1 << config.staticConfig.nodes.length; @@ -46,7 +46,7 @@ contract RMNHome_validateStaticAndDynamicConfig is RMNHomeTestSetup { s_rmnHome.setCandidate(config.staticConfig, config.dynamicConfig, ZERO_DIGEST); } - function test_validateStaticAndDynamicConfig_NotEnoughObservers_reverts() public { + function test_RevertWhen_validateStaticAndDynamicConfig_NotEnoughObservers() public { Config memory config = _getBaseConfig(); config.dynamicConfig.sourceChains[0].f++; diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.curse.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.curse.t.sol index e1af2ab4e6b..ebff3b0d75e 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.curse.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.curse.t.sol @@ -6,7 +6,7 @@ import {RMNRemote} from "../../../rmn/RMNRemote.sol"; import {RMNRemoteSetup} from "./RMNRemoteSetup.t.sol"; contract RMNRemote_curse is RMNRemoteSetup { - function test_curse_success() public { + function test_curse() public { vm.expectEmit(); emit RMNRemote.Cursed(s_curseSubjects); @@ -19,14 +19,14 @@ contract RMNRemote_curse is RMNRemoteSetup { assertFalse(s_rmnRemote.isCursed(bytes16(keccak256("subject 3")))); } - function test_curse_AlreadyCursed_duplicateSubject_reverts() public { + function test_RevertWhen_curse_AlreadyCursed_duplicateSubject() public { s_curseSubjects.push(CURSE_SUBJ_1); vm.expectRevert(abi.encodeWithSelector(RMNRemote.AlreadyCursed.selector, CURSE_SUBJ_1)); s_rmnRemote.curse(s_curseSubjects); } - function test_curse_calledByNonOwner_reverts() public { + function test_RevertWhen_curse_calledByNonOwner() public { vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); vm.stopPrank(); vm.prank(STRANGER); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.isBlessed.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.isBlessed.t.sol index aabfe74bf4d..4fd8f1dc7ce 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.isBlessed.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.isBlessed.t.sol @@ -23,7 +23,7 @@ contract RMNRemote_isBlessed is RMNRemoteSetup { assertFalse(s_rmnRemote.isBlessed(taggedRoot)); } - function test_isBlessed_RevertWhen_IsBlessedNotAvailable() public { + function test_RevertWhen_isBlessedWhen_IsBlessedNotAvailable() public { IRMN.TaggedRoot memory taggedRoot = IRMN.TaggedRoot({root: keccak256("root"), commitStore: makeAddr("commitStore")}); s_rmnRemote = new RMNRemote(100, IRMN(address(0))); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.setConfig.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.setConfig.t.sol index 0805871955d..058ebfa0266 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.setConfig.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.setConfig.t.sol @@ -5,7 +5,7 @@ import {RMNRemote} from "../../../rmn/RMNRemote.sol"; import {RMNRemoteSetup} from "./RMNRemoteSetup.t.sol"; contract RMNRemote_setConfig is RMNRemoteSetup { - function test_setConfig_ZeroValueNotAllowed_revert() public { + function test_RevertWhen_setConfig_ZeroValueNotAllowed() public { RMNRemote.Config memory config = RMNRemote.Config({rmnHomeContractConfigDigest: bytes32(0), signers: s_signers, f: 1}); @@ -14,7 +14,7 @@ contract RMNRemote_setConfig is RMNRemoteSetup { s_rmnRemote.setConfig(config); } - function test_setConfig_addSigner_removeSigner_success() public { + function test_setConfig_addSigner_removeSigner() public { uint32 currentConfigVersion = 0; uint256 numSigners = s_signers.length; RMNRemote.Config memory config = @@ -56,7 +56,7 @@ contract RMNRemote_setConfig is RMNRemoteSetup { assertEq(version, currentConfigVersion); } - function test_setConfig_invalidSignerOrder_reverts() public { + function test_RevertWhen_setConfig_invalidSignerOrder() public { s_signers.push(RMNRemote.Signer({onchainPublicKey: address(4), nodeIndex: 0})); RMNRemote.Config memory config = RMNRemote.Config({rmnHomeContractConfigDigest: _randomBytes32(), signers: s_signers, f: 1}); @@ -65,7 +65,7 @@ contract RMNRemote_setConfig is RMNRemoteSetup { s_rmnRemote.setConfig(config); } - function test_setConfig_notEnoughSigners_reverts() public { + function test_RevertWhen_setConfig_notEnoughSigners() public { RMNRemote.Config memory config = RMNRemote.Config({ rmnHomeContractConfigDigest: _randomBytes32(), signers: s_signers, @@ -76,7 +76,7 @@ contract RMNRemote_setConfig is RMNRemoteSetup { s_rmnRemote.setConfig(config); } - function test_setConfig_duplicateOnChainPublicKey_reverts() public { + function test_RevertWhen_setConfig_duplicateOnChainPublicKey() public { s_signers.push(RMNRemote.Signer({onchainPublicKey: s_signerWallets[0].addr, nodeIndex: uint64(s_signers.length)})); RMNRemote.Config memory config = RMNRemote.Config({rmnHomeContractConfigDigest: _randomBytes32(), signers: s_signers, f: 1}); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.uncurse.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.uncurse.t.sol index ad784a8cb30..abb808ddb75 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.uncurse.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.uncurse.t.sol @@ -11,7 +11,7 @@ contract RMNRemote_uncurse is RMNRemoteSetup { s_rmnRemote.curse(s_curseSubjects); } - function test_uncurse_success() public { + function test_uncurse() public { vm.expectEmit(); emit RMNRemote.Uncursed(s_curseSubjects); @@ -22,14 +22,14 @@ contract RMNRemote_uncurse is RMNRemoteSetup { assertFalse(s_rmnRemote.isCursed(CURSE_SUBJ_2)); } - function test_uncurse_NotCursed_duplicatedUncurseSubject_reverts() public { + function test_RevertWhen_uncurse_NotCursed_duplicatedUncurseSubject() public { s_curseSubjects.push(CURSE_SUBJ_1); vm.expectRevert(abi.encodeWithSelector(RMNRemote.NotCursed.selector, CURSE_SUBJ_1)); s_rmnRemote.uncurse(s_curseSubjects); } - function test_uncurse_calledByNonOwner_reverts() public { + function test_RevertWhen_uncurse_calledByNonOwner() public { vm.expectRevert(Ownable2Step.OnlyCallableByOwner.selector); vm.stopPrank(); vm.prank(STRANGER); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigNotSet.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigNotSet.t.sol index bba4e8e6a0d..1480f99ff2b 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigNotSet.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigNotSet.t.sol @@ -8,7 +8,7 @@ import {RMNRemote} from "../../../rmn/RMNRemote.sol"; import {RMNRemoteSetup} from "./RMNRemoteSetup.t.sol"; contract RMNRemote_verify_withConfigNotSet is RMNRemoteSetup { - function test_verify_reverts() public { + function test_RevertWhen_verifys() public { Internal.MerkleRoot[] memory merkleRoots = new Internal.MerkleRoot[](0); IRMNRemote.Signature[] memory signatures = new IRMNRemote.Signature[](0); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigSet.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigSet.t.sol index 1ba9de9d039..ce7d3bb78bd 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigSet.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemote.verifywithConfigSet.t.sol @@ -8,48 +8,44 @@ import {RMNRemoteSetup} from "./RMNRemoteSetup.t.sol"; contract RMNRemote_verify_withConfigSet is RMNRemoteSetup { function setUp() public override { super.setUp(); + RMNRemote.Config memory config = RMNRemote.Config({rmnHomeContractConfigDigest: _randomBytes32(), signers: s_signers, f: 3}); s_rmnRemote.setConfig(config); _generatePayloadAndSigs(2, 4); } - function test_verify_success() public view { + function test_verify() public view { s_rmnRemote.verify(OFF_RAMP_ADDRESS, s_merkleRoots, s_signatures); } - function test_verify_InvalidSignature_reverts() public { - IRMNRemote.Signature memory sig = s_signatures[s_signatures.length - 1]; - sig.r = _randomBytes32(); - s_signatures.pop(); - s_signatures.push(sig); + function test_verify_RevertWhen_InvalidSignature() public { + s_signatures[s_signatures.length - 1].r = 0x0; vm.expectRevert(RMNRemote.InvalidSignature.selector); + s_rmnRemote.verify(OFF_RAMP_ADDRESS, s_merkleRoots, s_signatures); } - function test_verify_OutOfOrderSignatures_not_sorted_reverts() public { + function test_verify_RevertWhen_OutOfOrderSignatures_not_sorted() public { IRMNRemote.Signature memory sig1 = s_signatures[s_signatures.length - 1]; - s_signatures.pop(); - IRMNRemote.Signature memory sig2 = s_signatures[s_signatures.length - 1]; - s_signatures.pop(); - s_signatures.push(sig1); - s_signatures.push(sig2); + IRMNRemote.Signature memory sig2 = s_signatures[s_signatures.length - 2]; + + s_signatures[s_signatures.length - 1] = sig2; + s_signatures[s_signatures.length - 2] = sig1; vm.expectRevert(RMNRemote.OutOfOrderSignatures.selector); s_rmnRemote.verify(OFF_RAMP_ADDRESS, s_merkleRoots, s_signatures); } - function test_verify_OutOfOrderSignatures_duplicateSignature_reverts() public { - IRMNRemote.Signature memory sig = s_signatures[s_signatures.length - 2]; - s_signatures.pop(); - s_signatures.push(sig); + function test_verify_RevertWhen_OutOfOrderSignatures_duplicateSignature() public { + s_signatures[s_signatures.length - 1] = s_signatures[s_signatures.length - 2]; vm.expectRevert(RMNRemote.OutOfOrderSignatures.selector); s_rmnRemote.verify(OFF_RAMP_ADDRESS, s_merkleRoots, s_signatures); } - function test_verify_UnexpectedSigner_reverts() public { + function test_verify_RevertWhen_UnexpectedSigner() public { _setupSigners(4); // create new signers that aren't configured on RMNRemote _generatePayloadAndSigs(2, 4); @@ -57,7 +53,7 @@ contract RMNRemote_verify_withConfigSet is RMNRemoteSetup { s_rmnRemote.verify(OFF_RAMP_ADDRESS, s_merkleRoots, s_signatures); } - function test_verify_ThresholdNotMet_reverts() public { + function test_verify_RevertWhen_ThresholdNotMet() public { RMNRemote.Config memory config = RMNRemote.Config({rmnHomeContractConfigDigest: _randomBytes32(), signers: s_signers, f: 2}); // 3 = f+1 sigs required s_rmnRemote.setConfig(config); diff --git a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemoteSetup.t.sol b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemoteSetup.t.sol index afb65eeab11..56958808220 100644 --- a/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemoteSetup.t.sol +++ b/contracts/src/v0.8/ccip/test/rmn/RMNRemote/RMNRemoteSetup.t.sol @@ -49,7 +49,7 @@ contract RMNRemoteSetup is BaseTest { } for (uint256 i = 0; i < numSigners; ++i) { - s_signerWallets.push(vm.createWallet(_randomNum())); + s_signerWallets.push(vm.createWallet(vm.randomUint())); } _sort(s_signerWallets); @@ -84,11 +84,11 @@ contract RMNRemoteSetup is BaseTest { /// @notice generates a random dest lane update function _generateRandomDestLaneUpdate() private returns (Internal.MerkleRoot memory) { - uint64 minSeqNum = uint32(_randomNum()); + uint64 minSeqNum = uint32(vm.randomUint()); uint64 maxSeqNum = minSeqNum + 100; return Internal.MerkleRoot({ - sourceChainSelector: uint64(_randomNum()), - onRampAddress: abi.encode(_randomAddress()), + sourceChainSelector: uint64(vm.randomUint()), + onRampAddress: abi.encode(vm.randomAddress()), minSeqNr: minSeqNum, maxSeqNr: maxSeqNum, merkleRoot: _randomBytes32() @@ -147,4 +147,9 @@ contract RMNRemoteSetup is BaseTest { } } } + + /// @dev returns a pseudo-random bytes32 + function _randomBytes32() internal returns (bytes32) { + return bytes32(vm.randomUint()); + } } diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.applyRampUpdates.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.applyRampUpdates.t.sol index be0999542ea..e4cf46a7934 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.applyRampUpdates.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.applyRampUpdates.t.sol @@ -1,18 +1,18 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.24; -import {Router} from "../../../Router.sol"; import {IAny2EVMMessageReceiver} from "../../../interfaces/IAny2EVMMessageReceiver.sol"; import {IRouter} from "../../../interfaces/IRouter.sol"; -import {Client} from "../../../libraries/Client.sol"; +import {Router} from "../../../Router.sol"; +import {Client} from "../../../libraries/Client.sol"; +import {BaseTest} from "../../BaseTest.t.sol"; import {MaybeRevertMessageReceiver} from "../../helpers/receivers/MaybeRevertMessageReceiver.sol"; -import {RouterSetup} from "./RouterSetup.t.sol"; -contract Router_applyRampUpdates is RouterSetup { +contract Router_applyRampUpdates is BaseTest { MaybeRevertMessageReceiver internal s_receiver; - function setUp() public virtual override(RouterSetup) { + function setUp() public virtual override { super.setUp(); s_receiver = new MaybeRevertMessageReceiver(false); } @@ -22,7 +22,14 @@ contract Router_applyRampUpdates is RouterSetup { ) internal { vm.startPrank(offRamp.offRamp); - Client.Any2EVMMessage memory message = _generateReceiverMessage(offRamp.sourceChainSelector); + Client.Any2EVMMessage memory message = Client.Any2EVMMessage({ + messageId: bytes32("a"), + sourceChainSelector: offRamp.sourceChainSelector, + sender: bytes("a"), + data: bytes("a"), + destTokenAmounts: new Client.EVMTokenAmount[](0) + }); + vm.expectCall(address(s_receiver), abi.encodeWithSelector(IAny2EVMMessageReceiver.ccipReceive.selector, message)); s_sourceRouter.routeMessage(message, GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver)); } @@ -34,7 +41,16 @@ contract Router_applyRampUpdates is RouterSetup { vm.expectRevert(IRouter.OnlyOffRamp.selector); s_sourceRouter.routeMessage( - _generateReceiverMessage(offRamp.sourceChainSelector), GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver) + Client.Any2EVMMessage({ + messageId: bytes32("a"), + sourceChainSelector: offRamp.sourceChainSelector, + sender: bytes("a"), + data: bytes("a"), + destTokenAmounts: new Client.EVMTokenAmount[](0) + }), + GAS_FOR_CALL_EXACT_CHECK, + 100_000, + address(s_receiver) ); } @@ -267,7 +283,7 @@ contract Router_applyRampUpdates is RouterSetup { assertTrue(s_sourceRouter.isChainSupported(DEST_CHAIN_SELECTOR)); } - function test_applyRampUpdates_RevertWhen_OnlyOwner() public { + function test_RevertWhen_applyRampUpdatesWhen_OnlyOwner() public { vm.stopPrank(); vm.expectRevert("Only callable by owner"); Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); @@ -275,7 +291,7 @@ contract Router_applyRampUpdates is RouterSetup { s_sourceRouter.applyRampUpdates(onRampUpdates, offRampUpdates, offRampUpdates); } - function test_applyRampUpdates_RevertWhen_OffRampMismatch() public { + function test_RevertWhen_applyRampUpdatesWhen_OffRampMismatch() public { address offRamp = address(uint160(2)); Router.OnRamp[] memory onRampUpdates = new Router.OnRamp[](0); diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.ccipSend.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.ccipSend.t.sol index c44a94d8d3d..0abfba1d61e 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.ccipSend.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.ccipSend.t.sol @@ -138,7 +138,7 @@ contract Router_ccipSend is OnRampSetup { vm.resumeGasMetering(); } - function test_NonLinkFeeToken_Success() public { + function test_NonLinkFeeToken() public { address[] memory feeTokens = new address[](1); feeTokens[0] = s_sourceTokens[1]; s_feeQuoter.applyFeeTokensUpdates(new address[](0), feeTokens); @@ -149,7 +149,7 @@ contract Router_ccipSend is OnRampSetup { s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); } - function test_NativeFeeToken_Success() public { + function test_NativeFeeToken() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.feeToken = address(0); // Raw native uint256 nativeQuote = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); @@ -158,7 +158,7 @@ contract Router_ccipSend is OnRampSetup { s_sourceRouter.ccipSend{value: nativeQuote}(DEST_CHAIN_SELECTOR, message); } - function test_NativeFeeTokenOverpay_Success() public { + function test_NativeFeeTokenOverpay() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.feeToken = address(0); // Raw native uint256 nativeQuote = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); @@ -170,7 +170,7 @@ contract Router_ccipSend is OnRampSetup { assertEq(address(s_sourceRouter).balance, 0); } - function test_WrappedNativeFeeToken_Success() public { + function test_WrappedNativeFeeToken() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); message.feeToken = s_sourceRouter.getWrappedNative(); uint256 nativeQuote = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); @@ -184,14 +184,15 @@ contract Router_ccipSend is OnRampSetup { // Reverts - function test_WhenNotHealthy_Revert() public { - Client.EVM2AnyMessage memory message = _generateEmptyMessage(); - s_mockRMN.setGlobalCursed(true); + function test_RevertWhen_WhenNotHealthy() public { + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed()"), abi.encode(true)); + vm.expectRevert(Router.BadARMSignal.selector); - s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, message); + + s_sourceRouter.ccipSend(DEST_CHAIN_SELECTOR, _generateEmptyMessage()); } - function test_UnsupportedDestinationChain_Revert() public { + function test_RevertWhen_UnsupportedDestinationChain() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); uint64 wrongChain = DEST_CHAIN_SELECTOR + 1; @@ -200,7 +201,7 @@ contract Router_ccipSend is OnRampSetup { s_sourceRouter.ccipSend(wrongChain, message); } - function test_FeeTokenAmountTooLow_Revert() public { + function test_RevertWhen_FeeTokenAmountTooLow() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); IERC20(s_sourceTokens[0]).approve(address(s_sourceRouter), 0); diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.constructor.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.constructor.t.sol index a7dd90fc5e5..06250b91a5d 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.constructor.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {OnRampSetup} from "../../onRamp/OnRamp/OnRampSetup.t.sol"; contract Router_constructor is OnRampSetup { - function test_Constructor_Success() public view { + function test_Constructor() public view { assertEq("Router 1.2.0", s_sourceRouter.typeAndVersion()); assertEq(OWNER, s_sourceRouter.owner()); } diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.getArmProxy.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.getArmProxy.t.sol index a88e4c6b543..ae61910feb7 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.getArmProxy.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.getArmProxy.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.24; -import {RouterSetup} from "./RouterSetup.t.sol"; +import {BaseTest} from "../../BaseTest.t.sol"; -contract Router_getArmProxy is RouterSetup { +contract Router_getArmProxy is BaseTest { function test_getArmProxy() public view { - assertEq(s_sourceRouter.getArmProxy(), address(s_mockRMN)); + assertEq(s_sourceRouter.getArmProxy(), address(s_mockRMNRemote)); } } diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.getFee.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.getFee.t.sol index 9cb2249bf6b..38090fc7f16 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.getFee.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.getFee.t.sol @@ -6,14 +6,14 @@ import {Client} from "../../../libraries/Client.sol"; import {OnRampSetup} from "../../onRamp/OnRamp/OnRampSetup.t.sol"; contract Router_getFee is OnRampSetup { - function test_GetFeeSupportedChain_Success() public view { + function test_GetFeeSupportedChain() public view { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); uint256 expectedFee = s_sourceRouter.getFee(DEST_CHAIN_SELECTOR, message); assertGt(expectedFee, 10e9); } // Reverts - function test_UnsupportedDestinationChain_Revert() public { + function test_RevertWhen_UnsupportedDestinationChain() public { Client.EVM2AnyMessage memory message = _generateEmptyMessage(); vm.expectRevert(abi.encodeWithSelector(IRouterClient.UnsupportedDestinationChain.selector, 999)); diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.getSupportedTokens.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.getSupportedTokens.t.sol index 734f1f35ca5..e9328f80b77 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.getSupportedTokens.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.getSupportedTokens.t.sol @@ -5,7 +5,7 @@ import {OnRamp} from "../../../onRamp/OnRamp.sol"; import {OnRampSetup} from "../../onRamp/OnRamp/OnRampSetup.t.sol"; contract Router_getSupportedTokens is OnRampSetup { - function test_GetSupportedTokens_Revert() public { + function test_RevertWhen_GetSupportedTokens() public { vm.expectRevert(OnRamp.GetSupportedTokensFunctionalityRemovedCheckAdminRegistry.selector); s_onRamp.getSupportedTokens(DEST_CHAIN_SELECTOR); } diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.recoverTokens.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.recoverTokens.t.sol index 3eb76b52d1b..9bd0bc32f4e 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.recoverTokens.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.recoverTokens.t.sol @@ -9,7 +9,7 @@ import {MaybeRevertMessageReceiver} from "../../helpers/receivers/MaybeRevertMes import {OnRampSetup} from "../../onRamp/OnRamp/OnRampSetup.t.sol"; contract Router_recoverTokens is OnRampSetup { - function test_RecoverTokens_Success() public { + function test_RecoverTokens() public { // Assert we can recover sourceToken IERC20 token = IERC20(s_sourceTokens[0]); uint256 balanceBefore = token.balanceOf(OWNER); @@ -28,25 +28,25 @@ contract Router_recoverTokens is OnRampSetup { assertEq(address(s_sourceRouter).balance, 0); } - function test_RecoverTokensNonOwner_Revert() public { + function test_RevertWhen_RecoverTokensNonOwner() public { // Reverts if not owner vm.startPrank(STRANGER); vm.expectRevert("Only callable by owner"); s_sourceRouter.recoverTokens(address(0), STRANGER, 1); } - function test_RecoverTokensInvalidRecipient_Revert() public { + function test_RevertWhen_RecoverTokensInvalidRecipient() public { vm.expectRevert(abi.encodeWithSelector(Router.InvalidRecipientAddress.selector, address(0))); s_sourceRouter.recoverTokens(address(0), address(0), 1); } - function test_RecoverTokensNoFunds_Revert() public { + function test_RevertWhen_RecoverTokensNoFunds() public { // Reverts if no funds present vm.expectRevert(); s_sourceRouter.recoverTokens(address(0), OWNER, 10); } - function test_RecoverTokensValueReceiver_Revert() public { + function test_RevertWhen_RecoverTokensValueReceiver() public { MaybeRevertMessageReceiver revertingValueReceiver = new MaybeRevertMessageReceiver(true); deal(address(s_sourceRouter), 10); diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.routeMessage.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.routeMessage.t.sol index 8fca851fa4a..50e82777621 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.routeMessage.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.routeMessage.t.sol @@ -1,11 +1,11 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.24; -import {Router} from "../../../Router.sol"; import {IAny2EVMMessageReceiver} from "../../../interfaces/IAny2EVMMessageReceiver.sol"; import {IRouter} from "../../../interfaces/IRouter.sol"; -import {Client} from "../../../libraries/Client.sol"; +import {Router} from "../../../Router.sol"; +import {Client} from "../../../libraries/Client.sol"; import {MaybeRevertMessageReceiver} from "../../helpers/receivers/MaybeRevertMessageReceiver.sol"; import {OffRampSetup} from "../../offRamp/OffRamp/OffRampSetup.t.sol"; @@ -21,7 +21,20 @@ contract Router_routeMessage is OffRampSetup { return ((gasleft() - 2 * (16 * callDataLength + GAS_FOR_CALL_EXACT_CHECK)) * 62) / 64; } - function test_routeMessage_ManualExec_Success() public { + function _generateReceiverMessage( + uint64 chainSelector + ) internal pure returns (Client.Any2EVMMessage memory) { + Client.EVMTokenAmount[] memory ta = new Client.EVMTokenAmount[](0); + return Client.Any2EVMMessage({ + messageId: bytes32("a"), + sourceChainSelector: chainSelector, + sender: bytes("a"), + data: bytes("a"), + destTokenAmounts: ta + }); + } + + function test_routeMessage_ManualExec() public { Client.Any2EVMMessage memory message = _generateReceiverMessage(SOURCE_CHAIN_SELECTOR); // Manuel execution cannot run out of gas @@ -36,7 +49,7 @@ contract Router_routeMessage is OffRampSetup { assertGt(gasUsed, 3_000); } - function test_routeMessage_ExecutionEvent_Success() public { + function test_routeMessage_ExecutionEvent() public { Client.Any2EVMMessage memory message = _generateReceiverMessage(SOURCE_CHAIN_SELECTOR); // Should revert with reason bytes memory realError1 = new bytes(2); @@ -165,7 +178,7 @@ contract Router_routeMessage is OffRampSetup { assertEq(expectedRetData, retData); } - function test_routeMessage_AutoExec_Success() public { + function test_routeMessage_AutoExec() public { (bool success,,) = s_destRouter.routeMessage( _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver) ); @@ -181,7 +194,7 @@ contract Router_routeMessage is OffRampSetup { } // Reverts - function test_routeMessage_OnlyOffRamp_Revert() public { + function test_RevertWhen_routeMessage_OnlyOffRamp() public { vm.stopPrank(); vm.startPrank(STRANGER); @@ -191,8 +204,8 @@ contract Router_routeMessage is OffRampSetup { ); } - function test_routeMessage_WhenNotHealthy_Revert() public { - s_mockRMN.setGlobalCursed(true); + function test_RevertWhen_routeMessage_WhenNotHealthy() public { + vm.mockCall(address(s_mockRMNRemote), abi.encodeWithSignature("isCursed()"), abi.encode(true)); vm.expectRevert(Router.BadARMSignal.selector); s_destRouter.routeMessage( _generateReceiverMessage(SOURCE_CHAIN_SELECTOR), GAS_FOR_CALL_EXACT_CHECK, 100_000, address(s_receiver) diff --git a/contracts/src/v0.8/ccip/test/router/Router/Router.setWrappedNative.t.sol b/contracts/src/v0.8/ccip/test/router/Router/Router.setWrappedNative.t.sol index a23d98e4eaa..fee5a4682e8 100644 --- a/contracts/src/v0.8/ccip/test/router/Router/Router.setWrappedNative.t.sol +++ b/contracts/src/v0.8/ccip/test/router/Router/Router.setWrappedNative.t.sol @@ -12,7 +12,7 @@ contract Router_setWrappedNative is OnRampSetup { } // Reverts - function test_OnlyOwner_Revert() public { + function test_RevertWhen_OnlyOwner() public { vm.stopPrank(); vm.expectRevert("Only callable by owner"); s_sourceRouter.setWrappedNative(address(1)); diff --git a/contracts/src/v0.8/ccip/test/router/Router/RouterSetup.t.sol b/contracts/src/v0.8/ccip/test/router/Router/RouterSetup.t.sol deleted file mode 100644 index 4a977db6c23..00000000000 --- a/contracts/src/v0.8/ccip/test/router/Router/RouterSetup.t.sol +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.24; - -import {Router} from "../../../Router.sol"; -import {Client} from "../../../libraries/Client.sol"; -import {Internal} from "../../../libraries/Internal.sol"; -import {BaseTest} from "../../BaseTest.t.sol"; -import {WETH9} from "../../WETH9.sol"; - -contract RouterSetup is BaseTest { - Router internal s_sourceRouter; - Router internal s_destRouter; - - function setUp() public virtual override { - BaseTest.setUp(); - - if (address(s_sourceRouter) == address(0)) { - WETH9 weth = new WETH9(); - s_sourceRouter = new Router(address(weth), address(s_mockRMN)); - vm.label(address(s_sourceRouter), "sourceRouter"); - } - if (address(s_destRouter) == address(0)) { - WETH9 weth = new WETH9(); - s_destRouter = new Router(address(weth), address(s_mockRMN)); - vm.label(address(s_destRouter), "destRouter"); - } - } - - function _generateReceiverMessage( - uint64 chainSelector - ) internal pure returns (Client.Any2EVMMessage memory) { - Client.EVMTokenAmount[] memory ta = new Client.EVMTokenAmount[](0); - return Client.Any2EVMMessage({ - messageId: bytes32("a"), - sourceChainSelector: chainSelector, - sender: bytes("a"), - data: bytes("a"), - destTokenAmounts: ta - }); - } - - function _generateSourceTokenData() internal pure returns (Internal.SourceTokenData memory) { - return Internal.SourceTokenData({ - sourcePoolAddress: abi.encode(address(12312412312)), - destTokenAddress: abi.encode(address(9809808909)), - extraData: "", - destGasAmount: DEFAULT_TOKEN_DEST_GAS_OVERHEAD - }); - } -} diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.approve.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.approve.t.sol index 9ba6da0186d..062fa682432 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.approve.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.approve.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_approve is BurnMintERC20Setup { - function test_Approve_Success() public { + function test_Approve() public { uint256 balancePre = s_burnMintERC20.balanceOf(STRANGER); uint256 sendingAmount = s_amount / 2; @@ -19,7 +19,7 @@ contract FactoryBurnMintERC20_approve is BurnMintERC20Setup { // Reverts - function test_InvalidAddress_Reverts() public { + function test_RevertWhen_InvalidAddresss() public { vm.expectRevert(); s_burnMintERC20.approve(address(s_burnMintERC20), s_amount); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burn.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burn.t.sol index 5f6e7ee4d04..e3fd43b18b3 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burn.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burn.t.sol @@ -6,7 +6,7 @@ import {FactoryBurnMintERC20} from "../../../tokenAdminRegistry/TokenPoolFactory import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_burn is BurnMintERC20Setup { - function test_BasicBurn_Success() public { + function test_BasicBurn() public { s_burnMintERC20.grantBurnRole(OWNER); deal(address(s_burnMintERC20), OWNER, s_amount); @@ -20,13 +20,13 @@ contract FactoryBurnMintERC20_burn is BurnMintERC20Setup { // Revert - function test_SenderNotBurner_Reverts() public { + function test_RevertWhen_SenderNotBurners() public { vm.expectRevert(abi.encodeWithSelector(FactoryBurnMintERC20.SenderNotBurner.selector, OWNER)); s_burnMintERC20.burnFrom(STRANGER, s_amount); } - function test_ExceedsBalance_Reverts() public { + function test_RevertWhen_ExceedsBalances() public { changePrank(s_mockPool); vm.expectRevert("ERC20: burn amount exceeds balance"); @@ -34,7 +34,7 @@ contract FactoryBurnMintERC20_burn is BurnMintERC20Setup { s_burnMintERC20.burn(s_amount * 2); } - function test_BurnFromZeroAddress_Reverts() public { + function test_RevertWhen_BurnFromZeroAddresss() public { s_burnMintERC20.grantBurnRole(address(0)); changePrank(address(0)); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFrom.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFrom.t.sol index e2dcaf28563..234d6cca464 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFrom.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFrom.t.sol @@ -9,7 +9,7 @@ contract FactoryBurnMintERC20_burnFrom is BurnMintERC20Setup { BurnMintERC20Setup.setUp(); } - function test_BurnFrom_Success() public { + function test_BurnFrom() public { s_burnMintERC20.approve(s_mockPool, s_amount); changePrank(s_mockPool); @@ -21,13 +21,13 @@ contract FactoryBurnMintERC20_burnFrom is BurnMintERC20Setup { // Reverts - function test_SenderNotBurner_Reverts() public { + function test_RevertWhen_SenderNotBurners() public { vm.expectRevert(abi.encodeWithSelector(FactoryBurnMintERC20.SenderNotBurner.selector, OWNER)); s_burnMintERC20.burnFrom(OWNER, s_amount); } - function test_InsufficientAllowance_Reverts() public { + function test_RevertWhen_InsufficientAllowances() public { changePrank(s_mockPool); vm.expectRevert("ERC20: insufficient allowance"); @@ -35,7 +35,7 @@ contract FactoryBurnMintERC20_burnFrom is BurnMintERC20Setup { s_burnMintERC20.burnFrom(OWNER, s_amount); } - function test_ExceedsBalance_Reverts() public { + function test_RevertWhen_ExceedsBalances() public { s_burnMintERC20.approve(s_mockPool, s_amount * 2); changePrank(s_mockPool); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFromAlias.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFromAlias.t.sol index 0d46f1d54a5..eeb9b432a92 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFromAlias.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.burnFromAlias.t.sol @@ -9,7 +9,7 @@ contract FactoryBurnMintERC20_burnFromAlias is BurnMintERC20Setup { BurnMintERC20Setup.setUp(); } - function test_BurnFrom_Success() public { + function test_BurnFrom() public { s_burnMintERC20.approve(s_mockPool, s_amount); changePrank(s_mockPool); @@ -21,13 +21,13 @@ contract FactoryBurnMintERC20_burnFromAlias is BurnMintERC20Setup { // Reverts - function test_SenderNotBurner_Reverts() public { + function test_RevertWhen_SenderNotBurners() public { vm.expectRevert(abi.encodeWithSelector(FactoryBurnMintERC20.SenderNotBurner.selector, OWNER)); s_burnMintERC20.burn(OWNER, s_amount); } - function test_InsufficientAllowance_Reverts() public { + function test_RevertWhen_InsufficientAllowances() public { changePrank(s_mockPool); vm.expectRevert("ERC20: insufficient allowance"); @@ -35,7 +35,7 @@ contract FactoryBurnMintERC20_burnFromAlias is BurnMintERC20Setup { s_burnMintERC20.burn(OWNER, s_amount); } - function test_ExceedsBalance_Reverts() public { + function test_RevertWhen_ExceedsBalances() public { s_burnMintERC20.approve(s_mockPool, s_amount * 2); changePrank(s_mockPool); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.constructor.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.constructor.t.sol index f1ee0866abe..8ed91da38fb 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.constructor.t.sol @@ -5,7 +5,7 @@ import {FactoryBurnMintERC20} from "../../../tokenAdminRegistry/TokenPoolFactory import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_constructor is BurnMintERC20Setup { - function test_Constructor_Success() public { + function test_Constructor() public { string memory name = "Chainlink token v2"; string memory symbol = "LINK2"; uint8 decimals = 19; diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.decreaseApproval.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.decreaseApproval.t.sol index aa621a998ed..edaf0173070 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.decreaseApproval.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.decreaseApproval.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_decreaseApproval is BurnMintERC20Setup { - function test_DecreaseApproval_Success() public { + function test_DecreaseApproval() public { s_burnMintERC20.approve(s_mockPool, s_amount); uint256 allowance = s_burnMintERC20.allowance(OWNER, s_mockPool); assertEq(allowance, s_amount); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.getCCIPAdmin.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.getCCIPAdmin.t.sol index fc6a81a712b..82518071e3a 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.getCCIPAdmin.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.getCCIPAdmin.t.sol @@ -5,11 +5,11 @@ import {FactoryBurnMintERC20} from "../../../tokenAdminRegistry/TokenPoolFactory import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_getCCIPAdmin is BurnMintERC20Setup { - function test_getCCIPAdmin_Success() public view { + function test_getCCIPAdmin() public view { assertEq(s_alice, s_burnMintERC20.getCCIPAdmin()); } - function test_setCCIPAdmin_Success() public { + function test_setCCIPAdmin() public { address newAdmin = makeAddr("newAdmin"); vm.expectEmit(); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantMintAndBurnRoles.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantMintAndBurnRoles.t.sol index aaa967edc15..bfd6d245e49 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantMintAndBurnRoles.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantMintAndBurnRoles.t.sol @@ -5,7 +5,7 @@ import {FactoryBurnMintERC20} from "../../../tokenAdminRegistry/TokenPoolFactory import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_grantMintAndBurnRoles is BurnMintERC20Setup { - function test_GrantMintAndBurnRoles_Success() public { + function test_GrantMintAndBurnRoles() public { assertFalse(s_burnMintERC20.isMinter(STRANGER)); assertFalse(s_burnMintERC20.isBurner(STRANGER)); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantRole.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantRole.t.sol index a06b52ac338..b43cf6d83d7 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantRole.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.grantRole.t.sol @@ -5,7 +5,7 @@ import {FactoryBurnMintERC20} from "../../../tokenAdminRegistry/TokenPoolFactory import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_grantRole is BurnMintERC20Setup { - function test_GrantMintAccess_Success() public { + function test_GrantMintAccess() public { assertFalse(s_burnMintERC20.isMinter(STRANGER)); vm.expectEmit(); @@ -23,7 +23,7 @@ contract FactoryBurnMintERC20_grantRole is BurnMintERC20Setup { assertFalse(s_burnMintERC20.isMinter(STRANGER)); } - function test_GrantBurnAccess_Success() public { + function test_GrantBurnAccess() public { assertFalse(s_burnMintERC20.isBurner(STRANGER)); vm.expectEmit(); @@ -41,7 +41,7 @@ contract FactoryBurnMintERC20_grantRole is BurnMintERC20Setup { assertFalse(s_burnMintERC20.isBurner(STRANGER)); } - function test_GrantMany_Success() public { + function test_GrantMany() public { // Since alice was already granted mint and burn roles in the setup, we will revoke them // and then grant them again for the purposes of the test s_burnMintERC20.revokeMintRole(s_alice); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.increaseApproval.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.increaseApproval.t.sol index e93cc2a71e6..1c134329106 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.increaseApproval.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.increaseApproval.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_increaseApproval is BurnMintERC20Setup { - function test_IncreaseApproval_Success() public { + function test_IncreaseApproval() public { s_burnMintERC20.approve(s_mockPool, s_amount); uint256 allowance = s_burnMintERC20.allowance(OWNER, s_mockPool); assertEq(allowance, s_amount); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.mint.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.mint.t.sol index b22783a3c75..3581d27590a 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.mint.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.mint.t.sol @@ -7,7 +7,7 @@ import {IERC20} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/ import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_mint is BurnMintERC20Setup { - function test_BasicMint_Success() public { + function test_BasicMint() public { uint256 balancePre = s_burnMintERC20.balanceOf(OWNER); s_burnMintERC20.grantMintAndBurnRoles(OWNER); @@ -22,12 +22,12 @@ contract FactoryBurnMintERC20_mint is BurnMintERC20Setup { // Revert - function test_SenderNotMinter_Reverts() public { + function test_RevertWhen_SenderNotMinters() public { vm.expectRevert(abi.encodeWithSelector(FactoryBurnMintERC20.SenderNotMinter.selector, OWNER)); s_burnMintERC20.mint(STRANGER, 1e18); } - function test_MaxSupplyExceeded_Reverts() public { + function test_RevertWhen_MaxSupplyExceededs() public { changePrank(s_mockPool); // Mint max supply diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.supportsInterface.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.supportsInterface.t.sol index bdf3c3e7ae3..1703ab7a27e 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.supportsInterface.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.supportsInterface.t.sol @@ -7,7 +7,7 @@ import {IERC165} from "../../../../vendor/openzeppelin-solidity/v4.8.3/contracts import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_supportsInterface is BurnMintERC20Setup { - function test_SupportsInterface_Success() public view { + function test_SupportsInterface() public view { assertTrue(s_burnMintERC20.supportsInterface(type(IERC20).interfaceId)); assertTrue(s_burnMintERC20.supportsInterface(type(IBurnMintERC20).interfaceId)); assertTrue(s_burnMintERC20.supportsInterface(type(IERC165).interfaceId)); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.transfer.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.transfer.t.sol index 333d50d333e..b3158ef9f19 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.transfer.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/FactoryBurnMintERC20/FactoryBurnMintERC20.transfer.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {BurnMintERC20Setup} from "./BurnMintERC20Setup.t.sol"; contract FactoryBurnMintERC20_transfer is BurnMintERC20Setup { - function test_Transfer_Success() public { + function test_Transfer() public { uint256 balancePre = s_burnMintERC20.balanceOf(STRANGER); uint256 sendingAmount = s_amount / 2; @@ -15,7 +15,7 @@ contract FactoryBurnMintERC20_transfer is BurnMintERC20Setup { // Reverts - function test_InvalidAddress_Reverts() public { + function test_RevertWhen_InvalidAddresss() public { vm.expectRevert(); s_burnMintERC20.transfer(address(s_burnMintERC20), s_amount); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.constructor.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.constructor.t.sol index 22bf54e633b..64b58b2d4dd 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.constructor.t.sol @@ -5,7 +5,7 @@ import {RegistryModuleOwnerCustom} from "../../../tokenAdminRegistry/RegistryMod import {RegistryModuleOwnerCustomSetup} from "./RegistryModuleOwnerCustomSetup.t.sol"; contract RegistryModuleOwnerCustom_constructor is RegistryModuleOwnerCustomSetup { - function test_constructor_Revert() public { + function test_RevertWhen_constructor() public { vm.expectRevert(abi.encodeWithSelector(RegistryModuleOwnerCustom.AddressZero.selector)); new RegistryModuleOwnerCustom(address(0)); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAccessControlDefaultAdmin.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAccessControlDefaultAdmin.t.sol index 5bf1c0aee34..6660962b0cf 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAccessControlDefaultAdmin.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAccessControlDefaultAdmin.t.sol @@ -23,7 +23,7 @@ contract RegistryModuleOwnerCustom_registerAccessControlDefaultAdmin is Registry s_token = address(new AccessController(OWNER)); } - function test_registerAccessControlDefaultAdmin_Success() public { + function test_registerAccessControlDefaultAdmin() public { assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).administrator, address(0)); bytes32 defaultAdminRole = AccessController(s_token).DEFAULT_ADMIN_ROLE(); @@ -43,7 +43,7 @@ contract RegistryModuleOwnerCustom_registerAccessControlDefaultAdmin is Registry assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).pendingAdministrator, OWNER); } - function test_registerAccessControlDefaultAdmin_Revert() public { + function test_RevertWhen_registerAccessControlDefaultAdmin() public { bytes32 defaultAdminRole = AccessController(s_token).DEFAULT_ADMIN_ROLE(); address wrongSender = makeAddr("Not_expected_owner"); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaGetCCIPAdmin.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaGetCCIPAdmin.t.sol index 5e3c6545417..8646d918afe 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaGetCCIPAdmin.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaGetCCIPAdmin.t.sol @@ -9,7 +9,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {RegistryModuleOwnerCustomSetup} from "./RegistryModuleOwnerCustomSetup.t.sol"; contract RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin is RegistryModuleOwnerCustomSetup { - function test_registerAdminViaGetCCIPAdmin_Success() public { + function test_registerAdminViaGetCCIPAdmin() public { assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).administrator, address(0)); address expectedOwner = IGetCCIPAdmin(s_token).getCCIPAdmin(); @@ -29,7 +29,7 @@ contract RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin is RegistryModul assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).pendingAdministrator, OWNER); } - function test_registerAdminViaGetCCIPAdmin_Revert() public { + function test_RevertWhen_registerAdminViaGetCCIPAdmin() public { address expectedOwner = IGetCCIPAdmin(s_token).getCCIPAdmin(); vm.startPrank(makeAddr("Not_expected_owner")); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaOwner.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaOwner.t.sol index b4e1a5e4577..6fcee1b039e 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaOwner.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/RegistryModuleOwnerCustom/RegistryModuleOwnerCustom.registerAdminViaOwner.t.sol @@ -9,7 +9,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {RegistryModuleOwnerCustomSetup} from "./RegistryModuleOwnerCustomSetup.t.sol"; contract RegistryModuleOwnerCustom_registerAdminViaOwner is RegistryModuleOwnerCustomSetup { - function test_registerAdminViaOwner_Success() public { + function test_registerAdminViaOwner() public { assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).administrator, address(0)); address expectedOwner = IOwner(s_token).owner(); @@ -29,7 +29,7 @@ contract RegistryModuleOwnerCustom_registerAdminViaOwner is RegistryModuleOwnerC assertEq(s_tokenAdminRegistry.getTokenConfig(s_token).pendingAdministrator, OWNER); } - function test_registerAdminViaOwner_Revert() public { + function test_RevertWhen_registerAdminViaOwner() public { address expectedOwner = IOwner(s_token).owner(); vm.startPrank(makeAddr("Not_expected_owner")); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.acceptAdminRole.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.acceptAdminRole.t.sol index 069159b8938..05c3ac77893 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.acceptAdminRole.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.acceptAdminRole.t.sol @@ -5,7 +5,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_acceptAdminRole is TokenAdminRegistrySetup { - function test_acceptAdminRole_Success() public { + function test_acceptAdminRole() public { address token = s_sourceTokens[0]; address currentAdmin = s_tokenAdminRegistry.getTokenConfig(token).administrator; @@ -36,7 +36,7 @@ contract TokenAdminRegistry_acceptAdminRole is TokenAdminRegistrySetup { assertEq(config.administrator, newAdmin); } - function test_acceptAdminRole_OnlyPendingAdministrator_Revert() public { + function test_RevertWhen_acceptAdminRole_OnlyPendingAdministrator() public { address token = s_sourceTokens[0]; address currentAdmin = s_tokenAdminRegistry.getTokenConfig(token).administrator; address newAdmin = makeAddr("newAdmin"); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.addRegistryModule.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.addRegistryModule.t.sol index 9874ceb72bc..9e21cd3e193 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.addRegistryModule.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.addRegistryModule.t.sol @@ -5,7 +5,7 @@ import {Ownable2Step} from "../../../../shared/access/Ownable2Step.sol"; import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_addRegistryModule is TokenAdminRegistrySetup { - function test_addRegistryModule_Success() public { + function test_addRegistryModule() public { address newModule = makeAddr("newModule"); s_tokenAdminRegistry.addRegistryModule(newModule); @@ -19,7 +19,7 @@ contract TokenAdminRegistry_addRegistryModule is TokenAdminRegistrySetup { vm.assertEq(vm.getRecordedLogs().length, 0); } - function test_addRegistryModule_OnlyOwner_Revert() public { + function test_RevertWhen_addRegistryModule_OnlyOwner() public { address newModule = makeAddr("newModule"); vm.stopPrank(); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getAllConfiguredTokens.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getAllConfiguredTokens.t.sol index 6e16f27eca7..9d42bcc8b2f 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getAllConfiguredTokens.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getAllConfiguredTokens.t.sol @@ -28,7 +28,7 @@ contract TokenAdminRegistry_getAllConfiguredTokens is TokenAdminRegistrySetup { } } - function test_getAllConfiguredTokens_outOfBounds_Success() public view { + function test_getAllConfiguredTokens_outOfBounds() public view { address[] memory tokens = s_tokenAdminRegistry.getAllConfiguredTokens(type(uint64).max, 10); assertEq(tokens.length, 0); } diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPool.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPool.t.sol index 297e3c3143a..12288ae365c 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPool.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPool.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_getPool is TokenAdminRegistrySetup { - function test_getPool_Success() public view { + function test_getPool() public view { address got = s_tokenAdminRegistry.getPool(s_sourceTokens[0]); assertEq(got, s_sourcePoolByToken[s_sourceTokens[0]]); } diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPools.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPools.t.sol index 7c673ee5be6..194adc447b9 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPools.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.getPools.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_getPools is TokenAdminRegistrySetup { - function test_getPools_Success() public { + function test_getPools() public { address[] memory tokens = new address[](1); tokens[0] = s_sourceTokens[0]; diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.isAdministrator.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.isAdministrator.t.sol index 00555ba3ff2..e94a0654a7e 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.isAdministrator.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.isAdministrator.t.sol @@ -4,7 +4,7 @@ pragma solidity ^0.8.0; import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_isAdministrator is TokenAdminRegistrySetup { - function test_isAdministrator_Success() public { + function test_isAdministrator() public { address newAdmin = makeAddr("newAdmin"); address newToken = makeAddr("newToken"); assertFalse(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.proposeAdministrator.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.proposeAdministrator.t.sol index 6f3ac4449c6..3d2fc0dafee 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.proposeAdministrator.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.proposeAdministrator.t.sol @@ -5,7 +5,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_proposeAdministrator is TokenAdminRegistrySetup { - function test_proposeAdministrator_module_Success() public { + function test_proposeAdministrator_module() public { vm.startPrank(s_registryModule); address newAdmin = makeAddr("newAdmin"); address newToken = makeAddr("newToken"); @@ -25,7 +25,7 @@ contract TokenAdminRegistry_proposeAdministrator is TokenAdminRegistrySetup { assertTrue(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); } - function test_proposeAdministrator_owner_Success() public { + function test_proposeAdministrator_owner() public { address newAdmin = makeAddr("newAdmin"); address newToken = makeAddr("newToken"); @@ -42,7 +42,7 @@ contract TokenAdminRegistry_proposeAdministrator is TokenAdminRegistrySetup { assertTrue(s_tokenAdminRegistry.isAdministrator(newToken, newAdmin)); } - function test_proposeAdministrator_reRegisterWhileUnclaimed_Success() public { + function test_proposeAdministrator_reRegisterWhileUnclaimed() public { address newAdmin = makeAddr("wrongAddress"); address newToken = makeAddr("newToken"); @@ -87,7 +87,7 @@ contract TokenAdminRegistry_proposeAdministrator is TokenAdminRegistrySetup { } } - function test_proposeAdministrator_OnlyRegistryModule_Revert() public { + function test_RevertWhen_proposeAdministrator_OnlyRegistryModule() public { address newToken = makeAddr("newToken"); vm.stopPrank(); @@ -95,14 +95,14 @@ contract TokenAdminRegistry_proposeAdministrator is TokenAdminRegistrySetup { s_tokenAdminRegistry.proposeAdministrator(newToken, OWNER); } - function test_proposeAdministrator_ZeroAddress_Revert() public { + function test_RevertWhen_proposeAdministrator_ZeroAddress() public { address newToken = makeAddr("newToken"); vm.expectRevert(abi.encodeWithSelector(TokenAdminRegistry.ZeroAddress.selector)); s_tokenAdminRegistry.proposeAdministrator(newToken, address(0)); } - function test_proposeAdministrator_AlreadyRegistered_Revert() public { + function test_RevertWhen_proposeAdministrator_AlreadyRegistered() public { address newAdmin = makeAddr("newAdmin"); address newToken = makeAddr("newToken"); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.removeRegistryModule.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.removeRegistryModule.t.sol index d5fde7ad5d5..5f5141eb3f3 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.removeRegistryModule.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.removeRegistryModule.t.sol @@ -6,7 +6,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_removeRegistryModule is TokenAdminRegistrySetup { - function test_removeRegistryModule_Success() public { + function test_removeRegistryModule() public { address newModule = makeAddr("newModule"); s_tokenAdminRegistry.addRegistryModule(newModule); @@ -27,7 +27,7 @@ contract TokenAdminRegistry_removeRegistryModule is TokenAdminRegistrySetup { vm.assertEq(vm.getRecordedLogs().length, 0); } - function test_removeRegistryModule_OnlyOwner_Revert() public { + function test_RevertWhen_removeRegistryModule_OnlyOwner() public { address newModule = makeAddr("newModule"); vm.stopPrank(); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.setPool.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.setPool.t.sol index 51119ce30bb..589b882dc21 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.setPool.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.setPool.t.sol @@ -6,7 +6,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_setPool is TokenAdminRegistrySetup { - function test_setPool_Success() public { + function test_setPool() public { address pool = makeAddr("pool"); vm.mockCall(pool, abi.encodeWithSelector(IPoolV1.isSupportedToken.selector), abi.encode(true)); @@ -24,7 +24,7 @@ contract TokenAdminRegistry_setPool is TokenAdminRegistrySetup { vm.assertEq(vm.getRecordedLogs().length, 0); } - function test_setPool_ZeroAddressRemovesPool_Success() public { + function test_setPool_ZeroAddressRemovesPool() public { address pool = makeAddr("pool"); vm.mockCall(pool, abi.encodeWithSelector(IPoolV1.isSupportedToken.selector), abi.encode(true)); s_tokenAdminRegistry.setPool(s_sourceTokens[0], pool); @@ -39,7 +39,7 @@ contract TokenAdminRegistry_setPool is TokenAdminRegistrySetup { assertEq(s_tokenAdminRegistry.getPool(s_sourceTokens[0]), address(0)); } - function test_setPool_InvalidTokenPoolToken_Revert() public { + function test_RevertWhen_setPool_InvalidTokenPoolToken() public { address pool = makeAddr("pool"); vm.mockCall(pool, abi.encodeWithSelector(IPoolV1.isSupportedToken.selector), abi.encode(false)); @@ -47,7 +47,7 @@ contract TokenAdminRegistry_setPool is TokenAdminRegistrySetup { s_tokenAdminRegistry.setPool(s_sourceTokens[0], pool); } - function test_setPool_OnlyAdministrator_Revert() public { + function test_RevertWhen_setPool_OnlyAdministrator() public { vm.stopPrank(); vm.expectRevert( diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.transferAdminRole.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.transferAdminRole.t.sol index 07a10b083af..7d0916c8093 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.transferAdminRole.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenAdminRegistry/TokenAdminRegistry.transferAdminRole.t.sol @@ -5,7 +5,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_transferAdminRole is TokenAdminRegistrySetup { - function test_transferAdminRole_Success() public { + function test_transferAdminRole() public { address token = s_sourceTokens[0]; address currentAdmin = s_tokenAdminRegistry.getTokenConfig(token).administrator; @@ -23,7 +23,7 @@ contract TokenAdminRegistry_transferAdminRole is TokenAdminRegistrySetup { assertEq(config.administrator, currentAdmin); } - function test_transferAdminRole_OnlyAdministrator_Revert() public { + function test_RevertWhen_transferAdminRole_OnlyAdministrator() public { vm.stopPrank(); vm.expectRevert( diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.constructor.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.constructor.t.sol index fbba0ccbb06..1061fd7d9bc 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.constructor.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.constructor.t.sol @@ -12,7 +12,7 @@ import {TokenPoolFactorySetup} from "./TokenPoolFactorySetup.t.sol"; contract TokenPoolFactory_constructor is TokenPoolFactorySetup { using Create2 for bytes32; - function test_constructor_Revert() public { + function test_RevertWhen_constructor() public { // Revert cause the tokenAdminRegistry is address(0) vm.expectRevert(TokenPoolFactory.InvalidZeroAddress.selector); new TokenPoolFactory(ITokenAdminRegistry(address(0)), RegistryModuleOwnerCustom(address(0)), address(0), address(0)); diff --git a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.createTokenPool.t.sol b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.createTokenPool.t.sol index 301e26173bf..16102b3fb33 100644 --- a/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.createTokenPool.t.sol +++ b/contracts/src/v0.8/ccip/test/tokenAdminRegistry/TokenPoolFactory/TokenPoolFactory.createTokenPool.t.sol @@ -38,7 +38,7 @@ contract TokenPoolFactory_createTokenPool is TokenPoolFactorySetup { s_sourceRouter.applyRampUpdates(new Router.OnRamp[](0), new Router.OffRamp[](0), offRampUpdates); } - function test_createTokenPool_WithNoExistingTokenOnRemoteChain_Success() public { + function test_createTokenPool_WithNoExistingTokenOnRemoteChain() public { vm.startPrank(OWNER); bytes32 dynamicSalt = keccak256(abi.encodePacked(FAKE_SALT, OWNER)); @@ -75,7 +75,7 @@ contract TokenPoolFactory_createTokenPool is TokenPoolFactorySetup { assertEq(IOwner(poolAddress).owner(), OWNER, "Token should be owned by the owner"); } - function test_createTokenPool_WithNoExistingRemoteContracts_predict_Success() public { + function test_createTokenPool_WithNoExistingRemoteContracts_predict() public { vm.startPrank(OWNER); bytes32 dynamicSalt = keccak256(abi.encodePacked(FAKE_SALT, OWNER)); @@ -204,7 +204,7 @@ contract TokenPoolFactory_createTokenPool is TokenPoolFactorySetup { assertEq(IOwner(poolAddress).owner(), OWNER, "Pool should be controlled by the OWNER"); } - function test_createTokenPool_ExistingRemoteToken_AndPredictPool_Success() public { + function test_createTokenPool_ExistingRemoteToken_AndPredictPool() public { vm.startPrank(OWNER); bytes32 dynamicSalt = keccak256(abi.encodePacked(FAKE_SALT, OWNER)); @@ -301,7 +301,7 @@ contract TokenPoolFactory_createTokenPool is TokenPoolFactorySetup { ); } - function test_createTokenPool_WithRemoteTokenAndRemotePool_Success() public { + function test_createTokenPool_WithRemoteTokenAndRemotePool() public { vm.startPrank(OWNER); bytes memory RANDOM_TOKEN_ADDRESS = abi.encode(makeAddr("RANDOM_TOKEN")); @@ -351,7 +351,7 @@ contract TokenPoolFactory_createTokenPool is TokenPoolFactorySetup { assertEq(IOwner(poolAddress).owner(), OWNER, "Token should be owned by the owner"); } - function test_createTokenPoolLockRelease_ExistingToken_predict_Success() public { + function test_createTokenPoolLockRelease_ExistingToken_predict() public { vm.startPrank(OWNER); // We have to create a new factory, registry module, and token admin registry to simulate the other chain @@ -446,7 +446,7 @@ contract TokenPoolFactory_createTokenPool is TokenPoolFactorySetup { ); } - function test_createTokenPool_BurnFromMintTokenPool_Success() public { + function test_createTokenPool_BurnFromMintTokenPool() public { vm.startPrank(OWNER); bytes memory RANDOM_TOKEN_ADDRESS = abi.encode(makeAddr("RANDOM_TOKEN")); @@ -496,7 +496,7 @@ contract TokenPoolFactory_createTokenPool is TokenPoolFactorySetup { assertEq(IOwner(poolAddress).owner(), OWNER, "Token should be owned by the owner"); } - function test_createTokenPool_RemoteTokenHasDifferentDecimals_Success() public { + function test_createTokenPool_RemoteTokenHasDifferentDecimals() public { vm.startPrank(OWNER); bytes32 dynamicSalt = keccak256(abi.encodePacked(FAKE_SALT, OWNER)); diff --git a/core/gethwrappers/ccip/generated/rmn_remote/rmn_remote.go b/core/gethwrappers/ccip/generated/rmn_remote/rmn_remote.go index 31b657c6ce0..dc824e307eb 100644 --- a/core/gethwrappers/ccip/generated/rmn_remote/rmn_remote.go +++ b/core/gethwrappers/ccip/generated/rmn_remote/rmn_remote.go @@ -60,7 +60,7 @@ type RMNRemoteSigner struct { } var RMNRemoteMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"localChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMN\",\"name\":\"legacyRMN\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"AlreadyCursed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotTransferToSelf\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateOnchainPublicKey\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignerOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsBlessedNotAvailable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeProposedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"NotCursed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEnoughSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OutOfOrderSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnerCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ThresholdNotMet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"f\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structRMNRemote.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"Cursed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"Uncursed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"curse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"curse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCursedSubjects\",\"outputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLocalChainSelector\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"localChainSelector\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getReportDigestHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"digestHeader\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVersionedConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"f\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"f\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Config\",\"name\":\"newConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"uncurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"uncurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offrampAddress\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNRemote.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"verify\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"localChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"contractIRMN\",\"name\":\"legacyRMN\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"AlreadyCursed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotTransferToSelf\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ConfigNotSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"DuplicateOnchainPublicKey\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignerOrder\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"IsBlessedNotAvailable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MustBeProposedOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"NotCursed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEnoughSigners\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OnlyCallableByOwner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OutOfOrderSignatures\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OwnerCannotBeZero\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ThresholdNotMet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UnexpectedSigner\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ZeroValueNotAllowed\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"f\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structRMNRemote.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"name\":\"ConfigSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"Cursed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"Uncursed\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"curse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"curse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCursedSubjects\",\"outputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLocalChainSelector\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"localChainSelector\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getReportDigestHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"digestHeader\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVersionedConfig\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"version\",\"type\":\"uint32\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"f\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"commitStore\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"root\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMN.TaggedRoot\",\"name\":\"taggedRoot\",\"type\":\"tuple\"}],\"name\":\"isBlessed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isCursed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"rmnHomeContractConfigDigest\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"onchainPublicKey\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"nodeIndex\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Signer[]\",\"name\":\"signers\",\"type\":\"tuple[]\"},{\"internalType\":\"uint64\",\"name\":\"f\",\"type\":\"uint64\"}],\"internalType\":\"structRMNRemote.Config\",\"name\":\"newConfig\",\"type\":\"tuple\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"typeAndVersion\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16\",\"name\":\"subject\",\"type\":\"bytes16\"}],\"name\":\"uncurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes16[]\",\"name\":\"subjects\",\"type\":\"bytes16[]\"}],\"name\":\"uncurse\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"offRampAddress\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint64\",\"name\":\"sourceChainSelector\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"onRampAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"minSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"maxSeqNr\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"merkleRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structInternal.MerkleRoot[]\",\"name\":\"merkleRoots\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structIRMNRemote.Signature[]\",\"name\":\"signatures\",\"type\":\"tuple[]\"}],\"name\":\"verify\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"}]", Bin: "0x60c06040523480156200001157600080fd5b50604051620022d3380380620022d3833981016040819052620000349162000150565b336000816200005657604051639b15e16f60e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b038481169190911790915581161562000089576200008981620000d6565b5050816001600160401b0316600003620000b65760405163273e150360e21b815260040160405180910390fd5b6001600160401b039091166080526001600160a01b031660a052620001a5565b336001600160a01b038216036200010057604051636d6c4ee560e11b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b03838116918217835560015460405192939116917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600080604083850312156200016457600080fd5b82516001600160401b03811681146200017c57600080fd5b60208401519092506001600160a01b03811681146200019a57600080fd5b809150509250929050565b60805160a0516120fa620001d960003960008181610894015261093c0152600081816102a80152610b4b01526120fa6000f3fe608060405234801561001057600080fd5b506004361061011b5760003560e01c80636d2d3993116100b25780639a19b32911610081578063eaa83ddd11610066578063eaa83ddd1461029a578063f2fde38b146102d2578063f8bb876e146102e557600080fd5b80639a19b32914610272578063d881e0921461028557600080fd5b80636d2d39931461021c57806370a9089e1461022f57806379ba5097146102425780638da5cb5b1461024a57600080fd5b8063397796f7116100ee578063397796f7146101c05780634d616771146101c857806362eed415146101db5780636509a954146101ee57600080fd5b8063181f5a7714610120578063198f0f77146101725780631add205f146101875780632cbc26bb1461019d575b600080fd5b61015c6040518060400160405280601381526020017f524d4e52656d6f746520312e362e302d6465760000000000000000000000000081525081565b60405161016991906114a8565b60405180910390f35b6101856101803660046114bb565b6102f8565b005b61018f6106f2565b6040516101699291906114f6565b6101b06101ab3660046115d4565b6107ea565b6040519015158152602001610169565b6101b0610847565b6101b06101d63660046115ef565b610890565b6101856101e93660046115d4565b6109b2565b6040517f9651943783dbf81935a60e98f218a9d9b5b28823fb2228bbd91320d632facf538152602001610169565b61018561022a3660046115d4565b610a26565b61018561023d366004611675565b610a96565b610185610df1565b60015460405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610169565b6101856102803660046117f4565b610ebf565b61028d610fc5565b6040516101699190611891565b60405167ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000168152602001610169565b6101856102e03660046118f7565b610fd1565b6101856102f33660046117f4565b610fe5565b6103006110d7565b8035610338576040517f9cf8540c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60015b6103486020830183611914565b90508110156104185761035e6020830183611914565b8281811061036e5761036e61197c565b905060400201602001602081019061038691906119cc565b67ffffffffffffffff1661039d6020840184611914565b6103a8600185611a18565b8181106103b7576103b761197c565b90506040020160200160208101906103cf91906119cc565b67ffffffffffffffff1610610410576040517f4485151700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60010161033b565b5061042960608201604083016119cc565b610434906002611a2b565b61043f906001611a57565b67ffffffffffffffff166104566020830183611914565b90501015610490576040517f014c502000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003545b8015610522576008600060036104ab600185611a18565b815481106104bb576104bb61197c565b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff168352820192909252604001902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905561051b81611a78565b9050610494565b5060005b6105336020830183611914565b9050811015610668576008600061054d6020850185611914565b8481811061055d5761055d61197c565b61057392602060409092020190810191506118f7565b73ffffffffffffffffffffffffffffffffffffffff16815260208101919091526040016000205460ff16156105d4576040517f28cae27d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600860006105e76020860186611914565b858181106105f7576105f761197c565b61060d92602060409092020190810191506118f7565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610526565b508060026106768282611b66565b5050600580546000919082906106919063ffffffff16611ca1565b91906101000a81548163ffffffff021916908363ffffffff160217905590508063ffffffff167f7f22bf988149dbe8de8fb879c6b97a4e56e68b2bd57421ce1a4e79d4ef6b496c836040516106e69190611cc4565b60405180910390a25050565b6040805160608082018352600080835260208301919091529181018290526005546040805160608101825260028054825260038054845160208281028201810190965281815263ffffffff9096169592948593818601939092909160009084015b828210156107c1576000848152602090819020604080518082019091529084015473ffffffffffffffffffffffffffffffffffffffff8116825274010000000000000000000000000000000000000000900467ffffffffffffffff1681830152825260019092019101610753565b505050908252506002919091015467ffffffffffffffff16602090910152919491935090915050565b60006107f6600661112a565b60000361080557506000919050565b610810600683611134565b80610841575061084160067f0100000000000000000000000000000100000000000000000000000000000000611134565b92915050565b6000610853600661112a565b6000036108605750600090565b61088b60067f0100000000000000000000000000000100000000000000000000000000000000611134565b905090565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166108ff576040517f0a7c4edd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f4d61677100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690634d61677190610971908590600401611dce565b602060405180830381865afa15801561098e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108419190611e07565b6040805160018082528183019092526000916020808301908036833701905050905081816000815181106109e8576109e861197c565b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000090921660209283029190910190910152610a2281610fe5565b5050565b604080516001808252818301909252600091602080830190803683370190505090508181600081518110610a5c57610a5c61197c565b7fffffffffffffffffffffffffffffffff0000000000000000000000000000000090921660209283029190910190910152610a2281610ebf565b60055463ffffffff16600003610ad8576040517face124bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600454610af09067ffffffffffffffff166001611a57565b67ffffffffffffffff16811015610b33576040517f59fa4a9300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160c08101825246815267ffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166020820152309181019190915273ffffffffffffffffffffffffffffffffffffffff8616606082015260025460808201526000907f9651943783dbf81935a60e98f218a9d9b5b28823fb2228bbd91320d632facf539060a08101610bcf8789611e29565b9052604051610be2929190602001611f89565b60405160208183030381529060405280519060200120905060008060005b84811015610de657600184601b888885818110610c1f57610c1f61197c565b90506040020160000135898986818110610c3b57610c3b61197c565b9050604002016020013560405160008152602001604052604051610c7b949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015610c9d573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015192505073ffffffffffffffffffffffffffffffffffffffff8216610d15576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1610610d7a576040517fbbe15e7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff821660009081526008602052604090205460ff16610dd9576040517faaaa914100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9091508190600101610c00565b505050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610e42576040517f02b543c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000008082163390811790935560008054909116815560405173ffffffffffffffffffffffffffffffffffffffff909216929183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a350565b610ec76110d7565b60005b8151811015610f8a57610f00828281518110610ee857610ee861197c565b6020026020010151600661117290919063ffffffff16565b610f8257818181518110610f1657610f1661197c565b60200260200101516040517f73281fa1000000000000000000000000000000000000000000000000000000008152600401610f7991907fffffffffffffffffffffffffffffffff0000000000000000000000000000000091909116815260200190565b60405180910390fd5b600101610eca565b507f0676e709c9cc74fa0519fd78f7c33be0f1b2b0bae0507c724aef7229379c6ba181604051610fba9190611891565b60405180910390a150565b606061088b60066111a0565b610fd96110d7565b610fe2816111ad565b50565b610fed6110d7565b60005b81518110156110a75761102682828151811061100e5761100e61197c565b6020026020010151600661127190919063ffffffff16565b61109f5781818151811061103c5761103c61197c565b60200260200101516040517f19d5c79b000000000000000000000000000000000000000000000000000000008152600401610f7991907fffffffffffffffffffffffffffffffff0000000000000000000000000000000091909116815260200190565b600101610ff0565b507f1716e663a90a76d3b6c7e5f680673d1b051454c19c627e184c8daf28f3104f7481604051610fba9190611891565b60015473ffffffffffffffffffffffffffffffffffffffff163314611128576040517f2b5c74de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b6000610841825490565b7fffffffffffffffffffffffffffffffff000000000000000000000000000000008116600090815260018301602052604081205415155b9392505050565b600061116b837fffffffffffffffffffffffffffffffff00000000000000000000000000000000841661129f565b6060600061116b83611399565b3373ffffffffffffffffffffffffffffffffffffffff8216036111fc576040517fdad89dca00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560015460405192939116917fed8889f560326eb138920d842192f0eb3dd22b4f139c87a2c57538e05bae12789190a350565b600061116b837fffffffffffffffffffffffffffffffff0000000000000000000000000000000084166113f5565b600081815260018301602052604081205480156113885760006112c3600183611a18565b85549091506000906112d790600190611a18565b905080821461133c5760008660000182815481106112f7576112f761197c565b906000526020600020015490508087600001848154811061131a5761131a61197c565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061134d5761134d6120be565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610841565b6000915050610841565b5092915050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156113e957602002820191906000526020600020905b8154815260200190600101908083116113d5575b50505050509050919050565b600081815260018301602052604081205461143c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610841565b506000610841565b6000815180845260005b8181101561146a5760208185018101518683018201520161144e565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b60208152600061116b6020830184611444565b6000602082840312156114cd57600080fd5b813567ffffffffffffffff8111156114e457600080fd5b82016060818503121561116b57600080fd5b63ffffffff831681526040602080830182905283518383015283810151606080850152805160a085018190526000939291820190849060c08701905b8083101561157b578351805173ffffffffffffffffffffffffffffffffffffffff16835285015167ffffffffffffffff1685830152928401926001929092019190850190611532565b50604088015167ffffffffffffffff81166080890152945098975050505050505050565b80357fffffffffffffffffffffffffffffffff00000000000000000000000000000000811681146115cf57600080fd5b919050565b6000602082840312156115e657600080fd5b61116b8261159f565b60006040828403121561160157600080fd5b50919050565b73ffffffffffffffffffffffffffffffffffffffff81168114610fe257600080fd5b60008083601f84011261163b57600080fd5b50813567ffffffffffffffff81111561165357600080fd5b6020830191508360208260061b850101111561166e57600080fd5b9250929050565b60008060008060006060868803121561168d57600080fd5b853561169881611607565b9450602086013567ffffffffffffffff808211156116b557600080fd5b818801915088601f8301126116c957600080fd5b8135818111156116d857600080fd5b8960208260051b85010111156116ed57600080fd5b60208301965080955050604088013591508082111561170b57600080fd5b5061171888828901611629565b969995985093965092949392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160a0810167ffffffffffffffff8111828210171561177b5761177b611729565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156117c8576117c8611729565b604052919050565b600067ffffffffffffffff8211156117ea576117ea611729565b5060051b60200190565b6000602080838503121561180757600080fd5b823567ffffffffffffffff81111561181e57600080fd5b8301601f8101851361182f57600080fd5b803561184261183d826117d0565b611781565b81815260059190911b8201830190838101908783111561186157600080fd5b928401925b82841015611886576118778461159f565b82529284019290840190611866565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b818110156118eb5783517fffffffffffffffffffffffffffffffff0000000000000000000000000000000016835292840192918401916001016118ad565b50909695505050505050565b60006020828403121561190957600080fd5b813561116b81611607565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261194957600080fd5b83018035915067ffffffffffffffff82111561196457600080fd5b6020019150600681901b360382131561166e57600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b67ffffffffffffffff81168114610fe257600080fd5b80356115cf816119ab565b6000602082840312156119de57600080fd5b813561116b816119ab565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b81810381811115610841576108416119e9565b67ffffffffffffffff818116838216028082169190828114611a4f57611a4f6119e9565b505092915050565b67ffffffffffffffff818116838216019080821115611392576113926119e9565b600081611a8757611a876119e9565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60008135610841816119ab565b8135611ac581611607565b73ffffffffffffffffffffffffffffffffffffffff811690508154817fffffffffffffffffffffffff000000000000000000000000000000000000000082161783556020840135611b15816119ab565b7bffffffffffffffff00000000000000000000000000000000000000008160a01b16837fffffffff000000000000000000000000000000000000000000000000000000008416171784555050505050565b81358155600180820160208401357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1853603018112611ba457600080fd5b8401803567ffffffffffffffff811115611bbd57600080fd5b6020820191508060061b3603821315611bd557600080fd5b68010000000000000000811115611bee57611bee611729565b825481845580821015611c23576000848152602081208381019083015b80821015611c1f5782825590870190611c0b565b5050505b50600092835260208320925b81811015611c5357611c418385611aba565b92840192604092909201918401611c2f565b5050505050610a22611c6760408401611aad565b6002830167ffffffffffffffff82167fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000008254161781555050565b600063ffffffff808316818103611cba57611cba6119e9565b6001019392505050565b6000602080835260808301843582850152818501357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1863603018112611d0957600080fd5b8501828101903567ffffffffffffffff80821115611d2657600080fd5b8160061b3603831315611d3857600080fd5b6040606060408901528483865260a089019050849550600094505b83851015611da3578535611d6681611607565b73ffffffffffffffffffffffffffffffffffffffff16815285870135611d8b816119ab565b83168188015294810194600194909401938101611d53565b611daf60408b016119c1565b67ffffffffffffffff811660608b015296509998505050505050505050565b604081018235611ddd81611607565b73ffffffffffffffffffffffffffffffffffffffff81168352506020830135602083015292915050565b600060208284031215611e1957600080fd5b8151801515811461116b57600080fd5b6000611e3761183d846117d0565b80848252602080830192508560051b850136811115611e5557600080fd5b855b81811015611f7d57803567ffffffffffffffff80821115611e785760008081fd5b818901915060a08236031215611e8e5760008081fd5b611e96611758565b8235611ea1816119ab565b81528286013582811115611eb55760008081fd5b8301601f3681830112611ec85760008081fd5b813584811115611eda57611eda611729565b611f09897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08484011601611781565b94508085523689828501011115611f2257600091508182fd5b808984018a8701376000898287010152505050818682015260409150611f498284016119c1565b8282015260609150611f5c8284016119c1565b91810191909152608091820135918101919091528552938201938201611e57565b50919695505050505050565b60006040848352602060408185015261010084018551604086015281860151606067ffffffffffffffff808316606089015260408901519250608073ffffffffffffffffffffffffffffffffffffffff80851660808b015260608b0151945060a081861660a08c015260808c015160c08c015260a08c0151955060c060e08c015286915085518088526101209750878c019250878160051b8d01019750888701965060005b818110156120ab577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffee08d8a030184528751868151168a528a810151848c8c015261207a858c0182611444565b828e015189168c8f01528983015189168a8d0152918701519a87019a909a529850968901969289019260010161202e565b50969d9c50505050505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fdfea164736f6c6343000818000a", } @@ -406,9 +406,9 @@ func (_RMNRemote *RMNRemoteCallerSession) TypeAndVersion() (string, error) { return _RMNRemote.Contract.TypeAndVersion(&_RMNRemote.CallOpts) } -func (_RMNRemote *RMNRemoteCaller) Verify(opts *bind.CallOpts, offrampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error { +func (_RMNRemote *RMNRemoteCaller) Verify(opts *bind.CallOpts, offRampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error { var out []interface{} - err := _RMNRemote.contract.Call(opts, &out, "verify", offrampAddress, merkleRoots, signatures) + err := _RMNRemote.contract.Call(opts, &out, "verify", offRampAddress, merkleRoots, signatures) if err != nil { return err @@ -418,12 +418,12 @@ func (_RMNRemote *RMNRemoteCaller) Verify(opts *bind.CallOpts, offrampAddress co } -func (_RMNRemote *RMNRemoteSession) Verify(offrampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error { - return _RMNRemote.Contract.Verify(&_RMNRemote.CallOpts, offrampAddress, merkleRoots, signatures) +func (_RMNRemote *RMNRemoteSession) Verify(offRampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error { + return _RMNRemote.Contract.Verify(&_RMNRemote.CallOpts, offRampAddress, merkleRoots, signatures) } -func (_RMNRemote *RMNRemoteCallerSession) Verify(offrampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error { - return _RMNRemote.Contract.Verify(&_RMNRemote.CallOpts, offrampAddress, merkleRoots, signatures) +func (_RMNRemote *RMNRemoteCallerSession) Verify(offRampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error { + return _RMNRemote.Contract.Verify(&_RMNRemote.CallOpts, offRampAddress, merkleRoots, signatures) } func (_RMNRemote *RMNRemoteTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { @@ -1212,7 +1212,7 @@ type RMNRemoteInterface interface { TypeAndVersion(opts *bind.CallOpts) (string, error) - Verify(opts *bind.CallOpts, offrampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error + Verify(opts *bind.CallOpts, offRampAddress common.Address, merkleRoots []InternalMerkleRoot, signatures []IRMNRemoteSignature) error AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) diff --git a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt index 34bbce81354..1a0db0f483a 100644 --- a/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt +++ b/core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt @@ -23,7 +23,7 @@ registry_module_owner_custom: ../../../contracts/solc/v0.8.24/RegistryModuleOwne report_codec: ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.abi ../../../contracts/solc/v0.8.24/ReportCodec/ReportCodec.bin 6c943b39f003aa67c3cefa19a8ff99e846236a058e1ceae77569c3a065ffd5c7 rmn_home: ../../../contracts/solc/v0.8.24/RMNHome/RMNHome.abi ../../../contracts/solc/v0.8.24/RMNHome/RMNHome.bin 84ca84b3d0c00949905a3d10a91255f877cf32b2a0d7f7f7ce3121ced34a8cb7 rmn_proxy_contract: ../../../contracts/solc/v0.8.24/ARMProxy/ARMProxy.abi ../../../contracts/solc/v0.8.24/ARMProxy/ARMProxy.bin b048d8e752e3c41113ebb305c1efa06737ad36b4907b93e627fb0a3113023454 -rmn_remote: ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.abi ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.bin 2bf58225d1ceec21f3dd9e65b8088945c643ec527ae54b9983ec46316f5bca1f +rmn_remote: ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.abi ../../../contracts/solc/v0.8.24/RMNRemote/RMNRemote.bin 1bbc2d579336d1004119f71da9b1b7e546ad3e33775549080861904148cb137c router: ../../../contracts/solc/v0.8.24/Router/Router.abi ../../../contracts/solc/v0.8.24/Router/Router.bin 2e4f0a7826c8abb49d882bb49fc5ff20a186dbd3137624b9097ffed903ae4888 token_admin_registry: ../../../contracts/solc/v0.8.24/TokenAdminRegistry/TokenAdminRegistry.abi ../../../contracts/solc/v0.8.24/TokenAdminRegistry/TokenAdminRegistry.bin 397bc7be08c2848c0f4715f90b16206d6367f78ffb7cd48e2b1dfc0ccc5aea26 token_pool: ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.abi ../../../contracts/solc/v0.8.24/TokenPool/TokenPool.bin 793d65f336929becdcf8bc3f2208a5b6de93774215fe2e863bef64df419cfdb0 diff --git a/core/scripts/keystone/README.md b/core/scripts/keystone/README.md index 9bf6adfff4e..f08f738cb78 100644 --- a/core/scripts/keystone/README.md +++ b/core/scripts/keystone/README.md @@ -51,7 +51,7 @@ If you want to redeploy all resources, then you'll want to do the following: ```bash # From /crib devspace purge --profile keystone # Remove all k8s resources -./cribbit.sh crib- # Purge currently leaves some hanging resources, make a new namespace +DEVSPACE_NAMESPACE=crib- crib init # Purge currently leaves some hanging resources, make a new namespace devspace deploy --profile keysone --clean # Wipe any keystone related persisted data, like artefacts and caches. ``` diff --git a/core/services/chainlink/config_database.go b/core/services/chainlink/config_database.go index fd8aa96419d..27e61479146 100644 --- a/core/services/chainlink/config_database.go +++ b/core/services/chainlink/config_database.go @@ -107,6 +107,9 @@ func (d *databaseConfig) DefaultQueryTimeout() time.Duration { } func (d *databaseConfig) URL() url.URL { + if d.s.URL == nil { + return url.URL{} + } return *d.s.URL.URL() } diff --git a/core/services/ocr2/delegate.go b/core/services/ocr2/delegate.go index edcc816bf04..98f56d2a724 100644 --- a/core/services/ocr2/delegate.go +++ b/core/services/ocr2/delegate.go @@ -885,7 +885,8 @@ func (d *Delegate) newServicesMercury( lc.ContractConfigTrackerPollInterval = 1 * time.Second // This is the fastest that libocr supports. See: https://github.com/smartcontractkit/offchain-reporting/pull/520 - ocrLogger := ocrcommon.NewOCRWrapper(lggr, d.cfg.OCR2().TraceLogging(), func(ctx context.Context, msg string) { + // Disable OCR debug+info logging for legacy mercury jobs unless tracelogging is enabled, because its simply too verbose (150 jobs => ~50k logs per second) + ocrLogger := ocrcommon.NewOCRWrapper(llo.NewSuppressedLogger(lggr, d.cfg.OCR2().TraceLogging()), d.cfg.OCR2().TraceLogging(), func(ctx context.Context, msg string) { lggr.ErrorIf(d.jobORM.RecordError(ctx, jb.ID, msg), "unable to record error") }) diff --git a/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go index afcd580e24b..42a62a1be99 100644 --- a/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go +++ b/core/services/ocr2/plugins/ccip/ccipexec/gashelpers_test.go @@ -168,12 +168,6 @@ func TestWaitBoostedFee(t *testing.T) { boosted := waitBoostedFee(tc.sendTimeDiff, tc.fee, tc.relativeBoostPerWaitHour) diff := big.NewInt(0).Sub(boosted, tc.fee) assert.Equal(t, diff, tc.diff) - // we check that the actual diff is approximately equals to expected diff, - // as we might get slightly different results locally vs. CI therefore normal Equal() would be unstable - // diffUpperLimit := big.NewInt(0).Add(tc.diff, big.NewInt(1e9)) - //diffLowerLimit := big.NewInt(0).Add(tc.diff, big.NewInt(-1e9)) - //require.Equalf(t, -1, diff.Cmp(diffUpperLimit), "actual diff (%s) is larger than expected (%s)", diff.String(), diffUpperLimit.String()) - //require.Equal(t, 1, diff.Cmp(diffLowerLimit), "actual diff (%s) is smaller than expected (%s)", diff.String(), diffLowerLimit.String()) }) } } diff --git a/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go b/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go index daac8cc37f9..52eb15c77d2 100644 --- a/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go +++ b/core/services/ocr2/plugins/ccip/clo_ccip_integration_test.go @@ -22,6 +22,7 @@ import ( ) func Test_CLOSpecApprovalFlow_pipeline(t *testing.T) { + t.Parallel() ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( t, testhelpers.SourceChainID, @@ -40,6 +41,7 @@ func Test_CLOSpecApprovalFlow_pipeline(t *testing.T) { } func Test_CLOSpecApprovalFlow_dynamicPriceGetter(t *testing.T) { + t.Parallel() ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( t, testhelpers.SourceChainID, diff --git a/core/services/ocr2/plugins/ccip/integration_test.go b/core/services/ocr2/plugins/ccip/integration_test.go index e644a3e6f4a..b116a470363 100644 --- a/core/services/ocr2/plugins/ccip/integration_test.go +++ b/core/services/ocr2/plugins/ccip/integration_test.go @@ -29,6 +29,7 @@ import ( ) func TestIntegration_CCIP(t *testing.T) { + t.Parallel() // Run tke batches of tests for both pipeline and dynamic price getter setups. // We will remove the pipeline batch once the feature is deleted from the code. tests := []struct { @@ -650,6 +651,7 @@ func TestIntegration_CCIP(t *testing.T) { // TestReorg ensures that CCIP works even when a below finality depth reorg happens func TestReorg(t *testing.T) { + t.Parallel() // We need higher finality depth on the destination to perform reorg deep enough to revert commit and execution reports destinationFinalityDepth := uint32(50) ccipTH := integrationtesthelpers.SetupCCIPIntegrationTH( diff --git a/core/services/ocr2/plugins/ccip/metrics_test.go b/core/services/ocr2/plugins/ccip/metrics_test.go index eec67db7dd0..0487df2b28d 100644 --- a/core/services/ocr2/plugins/ccip/metrics_test.go +++ b/core/services/ocr2/plugins/ccip/metrics_test.go @@ -13,6 +13,7 @@ const ( ) func Test_SequenceNumbers(t *testing.T) { + t.Parallel() collector := NewPluginMetricsCollector("test", sourceChainId, destChainId) collector.SequenceNumber(Report, 10) @@ -23,6 +24,7 @@ func Test_SequenceNumbers(t *testing.T) { } func Test_NumberOfMessages(t *testing.T) { + t.Parallel() collector := NewPluginMetricsCollector("test", sourceChainId, destChainId) collector2 := NewPluginMetricsCollector("test2", destChainId, sourceChainId) @@ -37,6 +39,7 @@ func Test_NumberOfMessages(t *testing.T) { } func Test_UnexpiredCommitRoots(t *testing.T) { + t.Parallel() collector := NewPluginMetricsCollector("test", sourceChainId, destChainId) collector.UnexpiredCommitRoots(10) diff --git a/core/services/ocr2/plugins/ccip/observations_test.go b/core/services/ocr2/plugins/ccip/observations_test.go index a3143f157d7..c39be8e5a2c 100644 --- a/core/services/ocr2/plugins/ccip/observations_test.go +++ b/core/services/ocr2/plugins/ccip/observations_test.go @@ -22,6 +22,7 @@ import ( ) func TestObservationFilter(t *testing.T) { + t.Parallel() lggr := logger.TestLogger(t) obs1 := CommitObservation{Interval: cciptypes.CommitStoreInterval{Min: 1, Max: 10}} b1, err := obs1.Marshal() @@ -39,6 +40,7 @@ type CommitObservationLegacy struct { } func TestObservationCompat_MultiChainGas(t *testing.T) { + t.Parallel() obsLegacy := CommitObservationLegacy{ Interval: cciptypes.CommitStoreInterval{ Min: 1, @@ -66,6 +68,7 @@ func TestObservationCompat_MultiChainGas(t *testing.T) { } func TestCommitObservationJsonDeserialization(t *testing.T) { + t.Parallel() expectedObservation := CommitObservation{ Interval: cciptypes.CommitStoreInterval{ Min: 1, @@ -93,6 +96,7 @@ func TestCommitObservationJsonDeserialization(t *testing.T) { } func TestCommitObservationMarshal(t *testing.T) { + t.Parallel() obs := CommitObservation{ Interval: cciptypes.CommitStoreInterval{ Min: 1, @@ -120,6 +124,7 @@ func TestCommitObservationMarshal(t *testing.T) { } func TestExecutionObservationJsonDeserialization(t *testing.T) { + t.Parallel() expectedObservation := ExecutionObservation{Messages: map[uint64]MsgData{ 2: {TokenData: tokenData("c")}, 1: {TokenData: tokenData("c")}, @@ -142,6 +147,7 @@ func TestExecutionObservationJsonDeserialization(t *testing.T) { } func TestObservationSize(t *testing.T) { + t.Parallel() testParams := gopter.DefaultTestParameters() testParams.MinSuccessfulTests = 100 p := gopter.NewProperties(testParams) @@ -166,6 +172,7 @@ func TestObservationSize(t *testing.T) { } func TestNewExecutionObservation(t *testing.T) { + t.Parallel() tests := []struct { name string observations []ObservedMessage @@ -222,6 +229,7 @@ func tokenData(value string) [][]byte { } func TestCommitObservationJsonSerializationDeserialization(t *testing.T) { + t.Parallel() jsonEncoded := `{ "interval": { "Min":1, @@ -276,6 +284,7 @@ func TestCommitObservationJsonSerializationDeserialization(t *testing.T) { } func TestAddressEncodingBackwardsCompatibility(t *testing.T) { + t.Parallel() // The intention of this test is to remind including proper formatting of addresses after config is updated. // // The following tests will fail when a new cciptypes.Address field is added or removed. diff --git a/core/services/workflows/syncer/fetcher.go b/core/services/workflows/syncer/fetcher.go index 6a80739bbfe..5c8856d58c1 100644 --- a/core/services/workflows/syncer/fetcher.go +++ b/core/services/workflows/syncer/fetcher.go @@ -100,5 +100,9 @@ func (s *FetcherService) Fetch(ctx context.Context, url string) ([]byte, error) return nil, err } + if payload.ExecutionError { + return nil, fmt.Errorf("execution error from gateway: %s", payload.ErrorMessage) + } + return payload.Body, nil } diff --git a/core/services/workflows/syncer/fetcher_test.go b/core/services/workflows/syncer/fetcher_test.go index ee59d22608a..017b052f8ab 100644 --- a/core/services/workflows/syncer/fetcher_test.go +++ b/core/services/workflows/syncer/fetcher_test.go @@ -58,6 +58,40 @@ func TestNewFetcherService(t *testing.T) { expectedPayload := []byte("response body") require.Equal(t, expectedPayload, payload) }) + + t.Run("NOK-response_payload_too_large", func(t *testing.T) { + headers := map[string]string{"Content-Type": "application/json"} + responsePayload, err := json.Marshal(ghcapabilities.Response{ + StatusCode: 400, + Headers: headers, + ErrorMessage: "http: request body too large", + ExecutionError: true, + }) + require.NoError(t, err) + gatewayResponse := &api.Message{ + Body: api.MessageBody{ + MessageId: msgID, + Method: ghcapabilities.MethodWebAPITarget, + Payload: responsePayload, + }, + } + + connector.EXPECT().AddHandler([]string{capabilities.MethodWorkflowSyncer}, mock.Anything).Return(nil) + + fetcher := NewFetcherService(lggr, wrapper) + require.NoError(t, fetcher.Start(ctx)) + defer fetcher.Close() + + connector.EXPECT().SignAndSendToGateway(mock.Anything, "gateway1", mock.Anything).Run(func(ctx context.Context, gatewayID string, msg *api.MessageBody) { + fetcher.och.HandleGatewayMessage(ctx, "gateway1", gatewayResponse) + }).Return(nil).Times(1) + connector.EXPECT().DonID().Return("don-id") + connector.EXPECT().AwaitConnection(matches.AnyContext, "gateway1").Return(nil) + connector.EXPECT().GatewayIDs().Return([]string{"gateway1", "gateway2"}) + + _, err = fetcher.Fetch(ctx, url) + require.Error(t, err, "execution error from gateway: http: request body too large") + }) } func gatewayResponse(t *testing.T, msgID string) *api.Message { diff --git a/core/services/workflows/syncer/handler.go b/core/services/workflows/syncer/handler.go index 534dfd57e7b..cb4f013d502 100644 --- a/core/services/workflows/syncer/handler.go +++ b/core/services/workflows/syncer/handler.go @@ -3,6 +3,7 @@ package syncer import ( "bytes" "context" + "database/sql" "encoding/base64" "encoding/hex" "encoding/json" @@ -497,19 +498,19 @@ func (h *eventHandler) getWorkflowArtifacts( if err != nil { binary, err2 := h.fetcher(ctx, payload.BinaryURL) if err2 != nil { - return nil, nil, fmt.Errorf("failed to fetch binary from %s : %w", payload.BinaryURL, err) + return nil, nil, fmt.Errorf("failed to fetch binary from %s : %w", payload.BinaryURL, err2) } decodedBinary, err2 := base64.StdEncoding.DecodeString(string(binary)) if err2 != nil { - return nil, nil, fmt.Errorf("failed to decode binary: %w", err) + return nil, nil, fmt.Errorf("failed to decode binary: %w", err2) } var config []byte if payload.ConfigURL != "" { config, err2 = h.fetcher(ctx, payload.ConfigURL) if err2 != nil { - return nil, nil, fmt.Errorf("failed to fetch config from %s : %w", payload.ConfigURL, err) + return nil, nil, fmt.Errorf("failed to fetch config from %s : %w", payload.ConfigURL, err2) } } return decodedBinary, config, nil @@ -642,9 +643,15 @@ func (h *eventHandler) workflowDeletedEvent( return err } - if err := h.orm.DeleteWorkflowSpec(ctx, hex.EncodeToString(payload.WorkflowOwner), payload.WorkflowName); err != nil { + err := h.orm.DeleteWorkflowSpec(ctx, hex.EncodeToString(payload.WorkflowOwner), payload.WorkflowName) + if err != nil { + if errors.Is(err, sql.ErrNoRows) { + h.lggr.Warnw("workflow spec not found", "workflowID", hex.EncodeToString(payload.WorkflowID[:])) + return nil + } return fmt.Errorf("failed to delete workflow spec: %w", err) } + return nil } diff --git a/core/services/workflows/syncer/handler_test.go b/core/services/workflows/syncer/handler_test.go index f205cbde1cd..994b820b5ce 100644 --- a/core/services/workflows/syncer/handler_test.go +++ b/core/services/workflows/syncer/handler_test.go @@ -555,6 +555,61 @@ func Test_workflowDeletedHandler(t *testing.T) { _, err = h.engineRegistry.Get(wfIDs) require.Error(t, err) }) + t.Run("success deleting non-existing workflow spec", func(t *testing.T) { + var ( + ctx = testutils.Context(t) + lggr = logger.TestLogger(t) + db = pgtest.NewSqlxDB(t) + orm = NewWorkflowRegistryDS(db, lggr) + emitter = custmsg.NewLabeler() + + binary = wasmtest.CreateTestBinary(binaryCmd, binaryLocation, true, t) + encodedBinary = []byte(base64.StdEncoding.EncodeToString(binary)) + config = []byte("") + secretsURL = "http://example.com" + binaryURL = "http://example.com/binary" + configURL = "http://example.com/config" + wfOwner = []byte("0xOwner") + + fetcher = newMockFetcher(map[string]mockFetchResp{ + binaryURL: {Body: encodedBinary, Err: nil}, + configURL: {Body: config, Err: nil}, + secretsURL: {Body: []byte("secrets"), Err: nil}, + }) + ) + + giveWFID, err := pkgworkflows.GenerateWorkflowID(wfOwner, "workflow-name", binary, config, secretsURL) + require.NoError(t, err) + + er := NewEngineRegistry() + store := wfstore.NewDBStore(db, lggr, clockwork.NewFakeClock()) + registry := capabilities.NewRegistry(lggr) + registry.SetLocalRegistry(&capabilities.TestMetadataRegistry{}) + h := NewEventHandler( + lggr, + orm, + fetcher, + store, + registry, + emitter, + clockwork.NewFakeClock(), + workflowkey.Key{}, + WithEngineRegistry(er), + ) + + deleteEvent := WorkflowRegistryWorkflowDeletedV1{ + WorkflowID: giveWFID, + WorkflowOwner: wfOwner, + WorkflowName: "workflow-name", + DonID: 1, + } + err = h.workflowDeletedEvent(ctx, deleteEvent) + require.NoError(t, err) + + // Verify the record is deleted in the database + _, err = orm.GetWorkflowSpec(ctx, hex.EncodeToString(wfOwner), "workflow-name") + require.Error(t, err) + }) } func Test_workflowPausedActivatedUpdatedHandler(t *testing.T) { diff --git a/core/store/migrate/migrations/0262_add_solana_schema.sql b/core/store/migrate/migrations/0262_add_solana_schema.sql new file mode 100644 index 00000000000..035d3ff3d61 --- /dev/null +++ b/core/store/migrate/migrations/0262_add_solana_schema.sql @@ -0,0 +1,72 @@ +-- +goose Up +-- +goose StatementBegin +-- This removes evm from the search path, to avoid risk of an unqualified query intended to act on a Solana table accidentally +-- acting on the corresponding evm table. This makes schema qualification mandatory for all chain-specific queries. +SET search_path TO public; +CREATE SCHEMA solana; + +CREATE TABLE solana.log_poller_filters ( + id BIGSERIAL PRIMARY KEY, + chain_id TEXT NOT NULL, -- use human-readable name instead of genesis block hash to reduce index size by 50% + name TEXT NOT NULL, + address BYTEA NOT NULL, + event_name TEXT NOT NULL, + event_sig BYTEA NOT NULL, + starting_block BIGINT NOT NULL, + event_idl TEXT, + subkey_paths json, -- A list of subkeys to be indexed, represented by their json paths in the event struct. Forced to use json's 2d array as text[][] requires all paths to have equal length. + retention BIGINT NOT NULL DEFAULT 0, -- we don’t have to implement this initially, but good to include it in the schema + max_logs_kept BIGINT NOT NULL DEFAULT 0, -- same as retention, no need to implement yet + is_deleted BOOLEAN NOT NULL DEFAULT FALSE +); + +CREATE UNIQUE INDEX IF NOT EXISTS solana_log_poller_filter_name ON solana.log_poller_filters (chain_id, name) WHERE NOT is_deleted; + +CREATE TABLE solana.logs ( + id BIGSERIAL PRIMARY KEY, + filter_id BIGINT NOT NULL REFERENCES solana.log_poller_filters (id) ON DELETE CASCADE, + chain_id TEXT not null, -- use human-readable name instead of genesis block hash to reduce index size by 50% + log_index bigint not null, + block_hash bytea not null, + block_number bigint not null CHECK (block_number > 0), + block_timestamp timestamp with time zone not null, + address bytea not null, + event_sig bytea not null, + subkey_values bytea[] not null, + tx_hash bytea not null, + data bytea not null, + created_at timestamp with time zone not null, + expires_at timestamp with time zone null, -- null to indicate no timebase expiry + sequence_num bigint not null +); + +CREATE INDEX IF NOT EXISTS solana_logs_idx_by_timestamp ON solana.logs (chain_id, address, event_sig, block_timestamp, block_number); + +CREATE INDEX IF NOT EXISTS solana_logs_idx ON solana.logs (chain_id, block_number, address, event_sig); + +CREATE INDEX IF NOT EXISTS solana_logs_idx_subkey_one ON solana.logs ((subkey_values[1])); +CREATE INDEX IF NOT EXISTS solana_logs_idx_subkey_two ON solana.logs ((subkey_values[2])); +CREATE INDEX IF NOT EXISTS solana_logs_idx_subkey_three ON solana.logs ((subkey_values[3])); +CREATE INDEX IF NOT EXISTS solana_logs_idx_subkey_four ON solana.logs ((subkey_values[4])); + +CREATE INDEX IF NOT EXISTS solana_logs_idx_tx_hash ON solana.logs (tx_hash); + +-- Useful for the current form of those queries: WHERE chain_id = $1 AND address = $2 AND event_sig = $3 ... ORDER BY block_number, log_index +-- log_index is not included in this index because it increases the index size by ~ 10% for a likely negligible performance benefit +CREATE INDEX IF NOT EXISTS solana_logs_idx_chain_address_event_block ON solana.logs (chain_id, address, event_sig, block_number); + +CREATE UNIQUE INDEX IF NOT EXISTS solana_logs_idx_chain_filter_block_logindex ON solana.logs USING btree (chain_id, filter_id, block_number, log_index); + +-- +goose StatementEnd + + +-- +goose Down +-- +goose StatementBegin + +DROP TABLE IF EXISTS solana.logs; +DROP TABLE IF EXISTS solana.log_poller_filters; + +DROP SCHEMA solana; + +SET search_path TO public,evm; +-- +goose StatementEnd diff --git a/deployment/.golangci.yml b/deployment/.golangci.yml index 4a2e2b4a47c..ff1303e26ce 100644 --- a/deployment/.golangci.yml +++ b/deployment/.golangci.yml @@ -1,18 +1,33 @@ run: timeout: 15m + allow-parallel-runners: true linters: enable: + - containedctx + - depguard + - errname + - errorlint - exhaustive - exportloopref - - revive + - fatcontext + - ginkgolinter + - gocritic - goimports - gosec + - loggercheck + - mirror - misspell - - rowserrcheck - - errorlint - - containedctx - - fatcontext - noctx + - nolintlint + - perfsprint + - prealloc + - revive + - rowserrcheck + - spancheck + - sqlclosecheck + - testifylint + - unconvert + - whitespace linters-settings: exhaustive: default-signifies-exhaustive: true @@ -26,6 +41,28 @@ linters-settings: govet: enable: - shadow + settings: + printf: + # Additionally check chainlink custom loggers + funcs: + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Tracef + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Debugf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Infof + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Warnf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Errorf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Criticalf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Panicf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Fatalf + - (github.com/smartcontractkit/chainlink/v2/core/logger.SugaredLogger).AssumptionViolationf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infof + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracef + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalf revive: confidence: 0.8 rules: @@ -36,9 +73,10 @@ linters-settings: - name: error-return - name: error-strings - name: error-naming + - name: exported - name: if-return - name: increment-decrement - # - name: var-naming // doesn't work with some generated names + - name: var-naming - name: var-declaration - name: package-comments - name: range @@ -49,7 +87,7 @@ linters-settings: - name: errorf - name: empty-block - name: superfluous-else - #- name: unused-parameter + # - name: unused-parameter - name: unreachable-code - name: redefines-builtin-id - name: waitgroup-by-value @@ -64,13 +102,69 @@ linters-settings: - name: identical-branches - name: get-return # - name: flag-parameter // probably one we should work on doing better at in the future - # - name: early-return // probably one we should work on doing better at in the future + - name: early-return - name: defer - name: constant-logical-expr - name: confusing-naming - name: confusing-results - name: bool-literal-in-expr - name: atomic + depguard: + rules: + main: + list-mode: lax + deny: + - pkg: cosmossdk.io/errors + desc: Use the standard library instead + - pkg: github.com/gofrs/uuid + desc: Use github.com/google/uuid instead + - pkg: github.com/jackc/pgx3 + desc: Use github.com/jackc/pgx4 instead + - pkg: github.com/jackc/pgx5 + desc: Use github.com/jackc/pgx4 instead + - pkg: github.com/satori/go.uuid + desc: Use github.com/google/uuid instead + - pkg: github.com/test-go/testify/assert + desc: Use github.com/stretchr/testify/assert instead + - pkg: github.com/test-go/testify/mock + desc: Use github.com/stretchr/testify/mock instead + - pkg: github.com/test-go/testify/require + desc: Use github.com/stretchr/testify/require instead + - pkg: go.uber.org/multierr + desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join + - pkg: gopkg.in/guregu/null.v1 + desc: Use gopkg.in/guregu/null.v4 instead + - pkg: gopkg.in/guregu/null.v2 + desc: Use gopkg.in/guregu/null.v4 instead + - pkg: gopkg.in/guregu/null.v3 + desc: Use gopkg.in/guregu/null.v4 instead + - pkg: github.com/go-gorm/gorm + desc: Use github.com/jmoiron/sqlx directly instead + loggercheck: + # Check that *w logging functions have even number of args (i.e., well formed key-value pairs). + rules: + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Tracew + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Debugw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Infow + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Warnw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Errorw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Criticalw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Panicw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Fatalw + - (github.com/smartcontractkit/chainlink/v2/core/logger.SugaredLogger).AssumptionViolationw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infow + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracew + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).With + nolintlint: + require-specific: true + require-explanation: true issues: exclude-rules: - path: memory/(.+)\.go diff --git a/deployment/ccip/changeset/cs_ccip_home.go b/deployment/ccip/changeset/cs_ccip_home.go index 1d8c6782b76..6dc47f7259e 100644 --- a/deployment/ccip/changeset/cs_ccip_home.go +++ b/deployment/ccip/changeset/cs_ccip_home.go @@ -20,6 +20,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/config" "github.com/smartcontractkit/chainlink-common/pkg/logger" "github.com/smartcontractkit/chainlink-common/pkg/merklemulti" + "github.com/smartcontractkit/chainlink/deployment" "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" commoncs "github.com/smartcontractkit/chainlink/deployment/common/changeset" @@ -113,6 +114,7 @@ type PromoteAllCandidatesChangesetConfig struct { // Note that each (chain, ccip capability version) pair has a unique DON ID. RemoteChainSelectors []uint64 + PluginType types.PluginType // MCMS is optional MCMS configuration, if provided the changeset will generate an MCMS proposal. // If nil, the changeset will execute the commands directly using the deployer key // of the provided environment. @@ -135,6 +137,11 @@ func (p PromoteAllCandidatesChangesetConfig) Validate(e deployment.Environment) return nil, err } + if p.PluginType != types.PluginTypeCCIPCommit && + p.PluginType != types.PluginTypeCCIPExec { + return nil, fmt.Errorf("PluginType must be set to either CCIPCommit or CCIPExec") + } + var donIDs []uint32 for _, chainSelector := range p.RemoteChainSelectors { if err := deployment.IsValidChainSelector(chainSelector); err != nil { @@ -158,31 +165,19 @@ func (p PromoteAllCandidatesChangesetConfig) Validate(e deployment.Environment) return nil, fmt.Errorf("fetch don id for chain: %w", err) } if donID == 0 { - return nil, fmt.Errorf("don doesn't exist in CR for chain %d", p.RemoteChainSelectors) + return nil, fmt.Errorf("don doesn't exist in CR for chain %d", chainSelector) } // Check that candidate digest and active digest are not both zero - this is enforced onchain. - commitConfigs, err := state.Chains[p.HomeChainSelector].CCIPHome.GetAllConfigs(&bind.CallOpts{ + pluginConfigs, err := state.Chains[p.HomeChainSelector].CCIPHome.GetAllConfigs(&bind.CallOpts{ Context: e.GetContext(), - }, donID, uint8(cctypes.PluginTypeCCIPCommit)) + }, donID, uint8(p.PluginType)) if err != nil { - return nil, fmt.Errorf("fetching commit configs from cciphome: %w", err) + return nil, fmt.Errorf("fetching %s configs from cciphome: %w", p.PluginType.String(), err) } - execConfigs, err := state.Chains[p.HomeChainSelector].CCIPHome.GetAllConfigs(&bind.CallOpts{ - Context: e.GetContext(), - }, donID, uint8(cctypes.PluginTypeCCIPExec)) - if err != nil { - return nil, fmt.Errorf("fetching exec configs from cciphome: %w", err) - } - - if commitConfigs.ActiveConfig.ConfigDigest == [32]byte{} && - commitConfigs.CandidateConfig.ConfigDigest == [32]byte{} { - return nil, fmt.Errorf("commit active and candidate config digests are both zero") - } - - if execConfigs.ActiveConfig.ConfigDigest == [32]byte{} && - execConfigs.CandidateConfig.ConfigDigest == [32]byte{} { - return nil, fmt.Errorf("exec active and candidate config digests are both zero") + if pluginConfigs.ActiveConfig.ConfigDigest == [32]byte{} && + pluginConfigs.CandidateConfig.ConfigDigest == [32]byte{} { + return nil, fmt.Errorf("%s active and candidate config digests are both zero", p.PluginType.String()) } donIDs = append(donIDs, donID) } @@ -238,12 +233,13 @@ func PromoteAllCandidatesChangeset( state.Chains[cfg.HomeChainSelector].CCIPHome, nodes.NonBootstraps(), donID, + cfg.PluginType, cfg.MCMS != nil, ) if err != nil { return deployment.ChangesetOutput{}, fmt.Errorf("generating promote candidate ops: %w", err) } - ops = append(ops, promoteCandidateOps...) + ops = append(ops, promoteCandidateOps) } // Disabled MCMS means that we already executed the txes, so just return early w/out the proposals. @@ -791,44 +787,27 @@ func promoteAllCandidatesForChainOps( ccipHome *ccip_home.CCIPHome, nodes deployment.Nodes, donID uint32, + pluginType cctypes.PluginType, mcmsEnabled bool, -) ([]mcms.Operation, error) { +) (mcms.Operation, error) { if donID == 0 { - return nil, fmt.Errorf("donID is zero") + return mcms.Operation{}, fmt.Errorf("donID is zero") } - var mcmsOps []mcms.Operation - updateCommitOp, err := promoteCandidateOp( + updatePluginOp, err := promoteCandidateOp( txOpts, homeChain, capReg, ccipHome, nodes, donID, - uint8(cctypes.PluginTypeCCIPCommit), + uint8(pluginType), mcmsEnabled, ) if err != nil { - return nil, fmt.Errorf("promote candidate op: %w", err) + return mcms.Operation{}, fmt.Errorf("promote candidate op for plugin %s: %w", pluginType.String(), err) } - mcmsOps = append(mcmsOps, updateCommitOp) - - updateExecOp, err := promoteCandidateOp( - txOpts, - homeChain, - capReg, - ccipHome, - nodes, - donID, - uint8(cctypes.PluginTypeCCIPExec), - mcmsEnabled, - ) - if err != nil { - return nil, fmt.Errorf("promote candidate op: %w", err) - } - mcmsOps = append(mcmsOps, updateExecOp) - - return mcmsOps, nil + return updatePluginOp, nil } type RevokeCandidateChangesetConfig struct { diff --git a/deployment/ccip/changeset/cs_ccip_home_test.go b/deployment/ccip/changeset/cs_ccip_home_test.go index b487f1acc26..6b4683ae12c 100644 --- a/deployment/ccip/changeset/cs_ccip_home_test.go +++ b/deployment/ccip/changeset/cs_ccip_home_test.go @@ -61,16 +61,17 @@ func Test_PromoteCandidate(t *testing.T) { donID, err := internal.DonIDForChain(capReg, ccipHome, dest) require.NoError(t, err) require.NotEqual(t, uint32(0), donID) + t.Logf("donID: %d", donID) candidateDigestCommitBefore, err := ccipHome.GetCandidateDigest(&bind.CallOpts{ Context: ctx, }, donID, uint8(types.PluginTypeCCIPCommit)) require.NoError(t, err) require.Equal(t, [32]byte{}, candidateDigestCommitBefore) - candidateDigestExecBefore, err := ccipHome.GetCandidateDigest(&bind.CallOpts{ + ActiveDigestExecBefore, err := ccipHome.GetActiveDigest(&bind.CallOpts{ Context: ctx, }, donID, uint8(types.PluginTypeCCIPExec)) require.NoError(t, err) - require.Equal(t, [32]byte{}, candidateDigestExecBefore) + require.NotEqual(t, [32]byte{}, ActiveDigestExecBefore) var mcmsConfig *MCMSConfig if tc.mcmsEnabled { @@ -78,6 +79,7 @@ func Test_PromoteCandidate(t *testing.T) { MinDelay: 0, } } + // promotes zero digest on commit and ensure exec is not affected _, err = commonchangeset.ApplyChangesets(t, tenv.Env, map[uint64]*proposalutils.TimelockExecutionContracts{ tenv.HomeChainSel: { Timelock: state.Chains[tenv.HomeChainSel].Timelock, @@ -90,6 +92,7 @@ func Test_PromoteCandidate(t *testing.T) { HomeChainSelector: tenv.HomeChainSel, RemoteChainSelectors: []uint64{dest}, MCMS: mcmsConfig, + PluginType: types.PluginTypeCCIPCommit, }, }, }) @@ -106,7 +109,7 @@ func Test_PromoteCandidate(t *testing.T) { Context: ctx, }, donID, uint8(types.PluginTypeCCIPExec)) require.NoError(t, err) - require.Equal(t, [32]byte{}, activeDigestExec) + require.Equal(t, ActiveDigestExecBefore, activeDigestExec) }) } } diff --git a/deployment/ccip/changeset/internal/deploy_home_chain.go b/deployment/ccip/changeset/internal/deploy_home_chain.go index 2c401fd8006..ad87acf1239 100644 --- a/deployment/ccip/changeset/internal/deploy_home_chain.go +++ b/deployment/ccip/changeset/internal/deploy_home_chain.go @@ -126,6 +126,12 @@ func DonIDForChain(registry *capabilities_registry.CapabilitiesRegistry, ccipHom if err != nil { return 0, fmt.Errorf("get all commit configs from cciphome: %w", err) } + if configs.ActiveConfig.ConfigDigest == [32]byte{} && configs.CandidateConfig.ConfigDigest == [32]byte{} { + configs, err = ccipHome.GetAllConfigs(nil, don.Id, uint8(types.PluginTypeCCIPExec)) + if err != nil { + return 0, fmt.Errorf("get all exec configs from cciphome: %w", err) + } + } if configs.ActiveConfig.Config.ChainSelector == chainSelector || configs.CandidateConfig.Config.ChainSelector == chainSelector { donIDs = append(donIDs, don.Id) } diff --git a/deployment/ccip/changeset/test_environment.go b/deployment/ccip/changeset/test_environment.go index 8c2ea88b276..8e590da1703 100644 --- a/deployment/ccip/changeset/test_environment.go +++ b/deployment/ccip/changeset/test_environment.go @@ -19,6 +19,7 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/logger" jobv1 "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/job" "github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext" + "github.com/smartcontractkit/chainlink/deployment/ccip/changeset/internal" "github.com/smartcontractkit/chainlink/v2/core/capabilities/ccip/types" @@ -468,6 +469,16 @@ func NewEnvironmentWithJobsAndContracts(t *testing.T, tc *TestConfigs, tEnv Test Config: PromoteAllCandidatesChangesetConfig{ HomeChainSelector: e.HomeChainSel, RemoteChainSelectors: allChains, + PluginType: types.PluginTypeCCIPCommit, + }, + }, + { + // Promote everything + Changeset: commonchangeset.WrapChangeSet(PromoteAllCandidatesChangeset), + Config: PromoteAllCandidatesChangesetConfig{ + HomeChainSelector: e.HomeChainSel, + RemoteChainSelectors: allChains, + PluginType: types.PluginTypeCCIPExec, }, }, { diff --git a/deployment/keystone/changeset/append_node_capabilities_test.go b/deployment/keystone/changeset/append_node_capabilities_test.go index bfc01b309f5..cf5bfd6752f 100644 --- a/deployment/keystone/changeset/append_node_capabilities_test.go +++ b/deployment/keystone/changeset/append_node_capabilities_test.go @@ -10,6 +10,7 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) @@ -29,10 +30,10 @@ func TestAppendNodeCapabilities(t *testing.T) { caps = []kcr.CapabilitiesRegistryCapability{capA, capB} ) t.Run("no mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, }) @@ -58,10 +59,10 @@ func TestAppendNodeCapabilities(t *testing.T) { }) }) t.Run("with mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, UseMCMS: true, }) @@ -108,7 +109,7 @@ func TestAppendNodeCapabilities(t *testing.T) { } // validateUpdate checks reads nodes from the registry and checks they have the expected updates -func validateCapabilityAppends(t *testing.T, te TestEnv, appended map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) { +func validateCapabilityAppends(t *testing.T, te test.TestEnv, appended map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) { registry := te.ContractSets()[te.RegistrySelector].CapabilitiesRegistry wfP2PIDs := p2pIDs(t, maps.Keys(te.WFNodes)) nodes, err := registry.GetNodesByP2PIds(nil, wfP2PIDs) diff --git a/deployment/keystone/changeset/deploy_forwarder_test.go b/deployment/keystone/changeset/deploy_forwarder_test.go index e04bac6d264..f40b0f560c4 100644 --- a/deployment/keystone/changeset/deploy_forwarder_test.go +++ b/deployment/keystone/changeset/deploy_forwarder_test.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/environment/memory" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) func TestDeployForwarder(t *testing.T) { @@ -56,10 +57,10 @@ func TestConfigureForwarders(t *testing.T) { for _, nChains := range []int{1, 3} { name := fmt.Sprintf("nChains=%d", nChains) t.Run(name, func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: nChains, }) @@ -93,10 +94,10 @@ func TestConfigureForwarders(t *testing.T) { for _, nChains := range []int{1, 3} { name := fmt.Sprintf("nChains=%d", nChains) t.Run(name, func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: nChains, UseMCMS: true, }) diff --git a/deployment/keystone/changeset/deploy_ocr3_test.go b/deployment/keystone/changeset/deploy_ocr3_test.go index 7a276886242..1aa8f0a0caa 100644 --- a/deployment/keystone/changeset/deploy_ocr3_test.go +++ b/deployment/keystone/changeset/deploy_ocr3_test.go @@ -17,6 +17,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/environment/memory" kslib "github.com/smartcontractkit/chainlink/deployment/keystone" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" ) func TestDeployOCR3(t *testing.T) { @@ -54,10 +55,10 @@ func TestConfigureOCR3(t *testing.T) { t.Run("no mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, }) @@ -85,10 +86,10 @@ func TestConfigureOCR3(t *testing.T) { }) t.Run("mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, UseMCMS: true, }) diff --git a/deployment/keystone/changeset/internal/test/utils.go b/deployment/keystone/changeset/internal/test/utils.go index 0a23f7e60a7..21c1736ac8e 100644 --- a/deployment/keystone/changeset/internal/test/utils.go +++ b/deployment/keystone/changeset/internal/test/utils.go @@ -21,14 +21,47 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" + workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) +type SetupTestWorkflowRegistryResponse struct { + Registry *workflow_registry.WorkflowRegistry + Chain deployment.Chain + RegistrySelector uint64 + AddressBook deployment.AddressBook +} + +func SetupTestWorkflowRegistry(t *testing.T, lggr logger.Logger, chainSel uint64) *SetupTestWorkflowRegistryResponse { + chain := testChain(t) + + deployer, err := kslib.NewWorkflowRegistryDeployer() + require.NoError(t, err) + resp, err := deployer.Deploy(kslib.DeployRequest{Chain: chain}) + require.NoError(t, err) + + addressBook := deployment.NewMemoryAddressBookFromMap( + map[uint64]map[string]deployment.TypeAndVersion{ + chainSel: map[string]deployment.TypeAndVersion{ + resp.Address.Hex(): resp.Tv, + }, + }, + ) + + return &SetupTestWorkflowRegistryResponse{ + Registry: deployer.Contract(), + Chain: chain, + RegistrySelector: chain.Selector, + AddressBook: addressBook, + } +} + type Don struct { Name string P2PIDs []p2pkey.PeerID CapabilityConfigs []internal.CapabilityConfig } + type SetupTestRegistryRequest struct { P2pToCapabilities map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability NopToNodes map[kcr.CapabilitiesRegistryNodeOperator][]*internal.P2PSignerEnc diff --git a/deployment/keystone/changeset/helpers_test.go b/deployment/keystone/changeset/test/helpers.go similarity index 93% rename from deployment/keystone/changeset/helpers_test.go rename to deployment/keystone/changeset/test/helpers.go index f51a4ed610c..1f16a8ea5c0 100644 --- a/deployment/keystone/changeset/helpers_test.go +++ b/deployment/keystone/changeset/test/helpers.go @@ -1,4 +1,4 @@ -package changeset_test +package test import ( "bytes" @@ -6,18 +6,17 @@ import ( "crypto/sha256" "encoding/hex" "errors" - "fmt" "math" "sort" "testing" - "github.com/smartcontractkit/chainlink-common/pkg/logger" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" "golang.org/x/exp/maps" + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink/deployment" commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" @@ -26,33 +25,11 @@ import ( "github.com/smartcontractkit/chainlink/deployment/keystone" kslib "github.com/smartcontractkit/chainlink/deployment/keystone" kschangeset "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) -func TestSetupTestEnv(t *testing.T) { - t.Parallel() - ctx := tests.Context(t) - for _, useMCMS := range []bool{true, false} { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, - NumChains: 3, - UseMCMS: useMCMS, - }) - t.Run(fmt.Sprintf("set up test env using MCMS: %t", useMCMS), func(t *testing.T) { - require.NotNil(t, te.Env.ExistingAddresses) - require.Len(t, te.Env.Chains, 3) - require.NotEmpty(t, te.RegistrySelector) - require.NotNil(t, te.Env.Offchain) - r, err := te.Env.Offchain.ListNodes(ctx, &node.ListNodesRequest{}) - require.NoError(t, err) - require.Len(t, r.Nodes, 12) - }) - } -} - type DonConfig struct { N int } @@ -143,6 +120,10 @@ func SetupTestEnv(t *testing.T, c TestConfig) TestEnv { Changeset: commonchangeset.WrapChangeSet(kschangeset.DeployForwarder), Config: registryChainSel, }, + { + Changeset: commonchangeset.WrapChangeSet(workflowregistry.Deploy), + Config: registryChainSel, + }, }) require.NoError(t, err) require.NotNil(t, e) @@ -318,7 +299,7 @@ func validateInitialChainState(t *testing.T, env deployment.Environment, registr // all contracts on registry chain registryChainAddrs, err := ad.AddressesForChain(registryChainSel) require.NoError(t, err) - require.Len(t, registryChainAddrs, 3) // registry, ocr3, forwarder + require.Len(t, registryChainAddrs, 4) // registry, ocr3, forwarder, workflowRegistry // only forwarder on non-home chain for sel := range env.Chains { chainAddrs, err := ad.AddressesForChain(sel) @@ -326,7 +307,7 @@ func validateInitialChainState(t *testing.T, env deployment.Environment, registr if sel != registryChainSel { require.Len(t, chainAddrs, 1) } else { - require.Len(t, chainAddrs, 3) + require.Len(t, chainAddrs, 4) } containsForwarder := false for _, tv := range chainAddrs { diff --git a/deployment/keystone/changeset/test/helpers_test.go b/deployment/keystone/changeset/test/helpers_test.go new file mode 100644 index 00000000000..2d06e087db0 --- /dev/null +++ b/deployment/keystone/changeset/test/helpers_test.go @@ -0,0 +1,34 @@ +package test + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/smartcontractkit/chainlink-protos/job-distributor/v1/node" +) + +func TestSetupTestEnv(t *testing.T) { + t.Parallel() + ctx := tests.Context(t) + for _, useMCMS := range []bool{true, false} { + te := SetupTestEnv(t, TestConfig{ + WFDonConfig: DonConfig{N: 4}, + AssetDonConfig: DonConfig{N: 4}, + WriterDonConfig: DonConfig{N: 4}, + NumChains: 3, + UseMCMS: useMCMS, + }) + t.Run(fmt.Sprintf("set up test env using MCMS: %t", useMCMS), func(t *testing.T) { + require.NotNil(t, te.Env.ExistingAddresses) + require.Len(t, te.Env.Chains, 3) + require.NotEmpty(t, te.RegistrySelector) + require.NotNil(t, te.Env.Offchain) + r, err := te.Env.Offchain.ListNodes(ctx, &node.ListNodesRequest{}) + require.NoError(t, err) + require.Len(t, r.Nodes, 12) + }) + } +} diff --git a/deployment/keystone/changeset/update_don_test.go b/deployment/keystone/changeset/update_don_test.go index 012111c4e62..7572cf93b26 100644 --- a/deployment/keystone/changeset/update_don_test.go +++ b/deployment/keystone/changeset/update_don_test.go @@ -10,6 +10,7 @@ import ( "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) @@ -29,10 +30,10 @@ func TestUpdateDon(t *testing.T) { caps = []kcr.CapabilitiesRegistryCapability{capA, capB} ) t.Run("no mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, }) @@ -70,10 +71,10 @@ func TestUpdateDon(t *testing.T) { }) }) t.Run("with mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, UseMCMS: true, }) diff --git a/deployment/keystone/changeset/update_node_capabilities_test.go b/deployment/keystone/changeset/update_node_capabilities_test.go index 87b49acf614..190bc566e7a 100644 --- a/deployment/keystone/changeset/update_node_capabilities_test.go +++ b/deployment/keystone/changeset/update_node_capabilities_test.go @@ -10,6 +10,7 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" kcr "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) @@ -29,10 +30,10 @@ func TestUpdateNodeCapabilities(t *testing.T) { caps = []kcr.CapabilitiesRegistryCapability{capA, capB} ) t.Run("no mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, }) @@ -79,10 +80,10 @@ func TestUpdateNodeCapabilities(t *testing.T) { }) }) t.Run("with mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, UseMCMS: true, }) @@ -140,7 +141,7 @@ func TestUpdateNodeCapabilities(t *testing.T) { } // validateUpdate checks reads nodes from the registry and checks they have the expected updates -func validateCapabilityUpdates(t *testing.T, te TestEnv, expected map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) { +func validateCapabilityUpdates(t *testing.T, te test.TestEnv, expected map[p2pkey.PeerID][]kcr.CapabilitiesRegistryCapability) { registry := te.ContractSets()[te.RegistrySelector].CapabilitiesRegistry wfP2PIDs := p2pIDs(t, maps.Keys(te.WFNodes)) nodes, err := registry.GetNodesByP2PIds(nil, wfP2PIDs) diff --git a/deployment/keystone/changeset/update_nodes_test.go b/deployment/keystone/changeset/update_nodes_test.go index 31f71cd9603..33662aa669d 100644 --- a/deployment/keystone/changeset/update_nodes_test.go +++ b/deployment/keystone/changeset/update_nodes_test.go @@ -11,6 +11,7 @@ import ( commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" "github.com/smartcontractkit/chainlink/v2/core/services/keystore/keys/p2pkey" ) @@ -18,10 +19,10 @@ func TestUpdateNodes(t *testing.T) { t.Parallel() t.Run("no mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, }) @@ -54,10 +55,10 @@ func TestUpdateNodes(t *testing.T) { }) t.Run("with mcms", func(t *testing.T) { - te := SetupTestEnv(t, TestConfig{ - WFDonConfig: DonConfig{N: 4}, - AssetDonConfig: DonConfig{N: 4}, - WriterDonConfig: DonConfig{N: 4}, + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, NumChains: 1, UseMCMS: true, }) @@ -114,7 +115,7 @@ func TestUpdateNodes(t *testing.T) { } // validateUpdate checks reads nodes from the registry and checks they have the expected updates -func validateUpdate(t *testing.T, te TestEnv, expected map[p2pkey.PeerID]changeset.NodeUpdate) { +func validateUpdate(t *testing.T, te test.TestEnv, expected map[p2pkey.PeerID]changeset.NodeUpdate) { registry := te.ContractSets()[te.RegistrySelector].CapabilitiesRegistry wfP2PIDs := p2pIDs(t, maps.Keys(te.WFNodes)) nodes, err := registry.GetNodesByP2PIds(nil, wfP2PIDs) @@ -126,3 +127,13 @@ func validateUpdate(t *testing.T, te TestEnv, expected map[p2pkey.PeerID]changes assert.Equal(t, expected[node.P2pId].Signer, node.Signer) } } + +func p2pIDs(t *testing.T, vals []string) [][32]byte { + var out [][32]byte + for _, v := range vals { + id, err := p2pkey.MakePeerID(v) + require.NoError(t, err) + out = append(out, id) + } + return out +} diff --git a/deployment/keystone/changeset/workflowregistry/deploy.go b/deployment/keystone/changeset/workflowregistry/deploy.go new file mode 100644 index 00000000000..352336dd168 --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/deploy.go @@ -0,0 +1,26 @@ +package workflowregistry + +import ( + "fmt" + + "github.com/smartcontractkit/chainlink/deployment" + kslib "github.com/smartcontractkit/chainlink/deployment/keystone" +) + +var _ deployment.ChangeSet[uint64] = Deploy + +func Deploy(env deployment.Environment, registrySelector uint64) (deployment.ChangesetOutput, error) { + lggr := env.Logger + chain, ok := env.Chains[registrySelector] + if !ok { + return deployment.ChangesetOutput{}, fmt.Errorf("chain not found in environment") + } + ab := deployment.NewMemoryAddressBook() + wrResp, err := kslib.DeployWorkflowRegistry(chain, ab) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to deploy CapabilitiesRegistry: %w", err) + } + lggr.Infof("Deployed %s chain selector %d addr %s", wrResp.Tv.String(), chain.Selector, wrResp.Address.String()) + + return deployment.ChangesetOutput{AddressBook: ab}, nil +} diff --git a/deployment/keystone/changeset/workflowregistry/deploy_test.go b/deployment/keystone/changeset/workflowregistry/deploy_test.go new file mode 100644 index 00000000000..16eb6fa8512 --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/deploy_test.go @@ -0,0 +1,38 @@ +package workflowregistry + +import ( + "testing" + + "go.uber.org/zap/zapcore" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + "github.com/smartcontractkit/chainlink/deployment/environment/memory" +) + +func Test_Deploy(t *testing.T) { + t.Parallel() + lggr := logger.Test(t) + cfg := memory.MemoryEnvironmentConfig{ + Nodes: 1, // nodes unused but required in config + Chains: 2, + } + env := memory.NewMemoryEnvironment(t, lggr, zapcore.DebugLevel, cfg) + + registrySel := env.AllChainSelectors()[0] + + resp, err := Deploy(env, registrySel) + require.NoError(t, err) + require.NotNil(t, resp) + // OCR3 should be deployed on chain 0 + addrs, err := resp.AddressBook.AddressesForChain(registrySel) + require.NoError(t, err) + require.Len(t, addrs, 1) + + // nothing on chain 1 + require.NotEqual(t, registrySel, env.AllChainSelectors()[1]) + oaddrs, _ := resp.AddressBook.AddressesForChain(env.AllChainSelectors()[1]) + assert.Len(t, oaddrs, 0) +} diff --git a/deployment/keystone/changeset/workflowregistry/strategies.go b/deployment/keystone/changeset/workflowregistry/strategies.go new file mode 100644 index 00000000000..f799092d4ce --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/strategies.go @@ -0,0 +1,86 @@ +package workflowregistry + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/mcms" + "github.com/smartcontractkit/ccip-owner-contracts/pkg/proposal/timelock" + + "github.com/smartcontractkit/chainlink/deployment" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" +) + +type strategy interface { + Apply(callFn func(opts *bind.TransactOpts) (*types.Transaction, error)) (deployment.ChangesetOutput, error) +} + +type simpleTransaction struct { + chain deployment.Chain +} + +func (s *simpleTransaction) Apply(callFn func(opts *bind.TransactOpts) (*types.Transaction, error)) (deployment.ChangesetOutput, error) { + tx, err := callFn(s.chain.DeployerKey) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + _, err = s.chain.Confirm(tx) + return deployment.ChangesetOutput{}, err +} + +type mcmsTransaction struct { + Config *changeset.MCMSConfig + Description string + Address common.Address + ChainSel uint64 + ContractSet *kslib.ContractSet +} + +func (m *mcmsTransaction) Apply(callFn func(opts *bind.TransactOpts) (*types.Transaction, error)) (deployment.ChangesetOutput, error) { + opts := deployment.SimTransactOpts() + + tx, err := callFn(opts) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + op := timelock.BatchChainOperation{ + ChainIdentifier: mcms.ChainIdentifier(m.ChainSel), + Batch: []mcms.Operation{ + { + Data: tx.Data(), + To: m.Address, + Value: big.NewInt(0), + }, + }, + } + + timelocksPerChain := map[uint64]common.Address{ + m.ChainSel: m.ContractSet.Timelock.Address(), + } + proposerMCMSes := map[uint64]*gethwrappers.ManyChainMultiSig{ + m.ChainSel: m.ContractSet.ProposerMcm, + } + + proposal, err := proposalutils.BuildProposalFromBatches( + timelocksPerChain, + proposerMCMSes, + []timelock.BatchChainOperation{op}, + m.Description, + m.Config.MinDuration, + ) + if err != nil { + return deployment.ChangesetOutput{}, err + } + + return deployment.ChangesetOutput{ + Proposals: []timelock.MCMSWithTimelockProposal{*proposal}, + }, nil +} diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go new file mode 100644 index 00000000000..b07414221dd --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons.go @@ -0,0 +1,81 @@ +package workflowregistry + +import ( + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink/deployment" + + kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" +) + +var _ deployment.ChangeSet[*UpdateAllowedDonsRequest] = UpdateAllowedDons + +type UpdateAllowedDonsRequest struct { + RegistryChainSel uint64 + DonIDs []uint32 + Allowed bool + + MCMSConfig *changeset.MCMSConfig +} + +func (r *UpdateAllowedDonsRequest) Validate() error { + if len(r.DonIDs) == 0 { + return errors.New("Must provide at least one DonID") + } + return nil +} + +// UpdateAllowedDons updates the list of DONs that workflows can be sent to. +func UpdateAllowedDons(env deployment.Environment, req *UpdateAllowedDonsRequest) (deployment.ChangesetOutput, error) { + if err := req.Validate(); err != nil { + return deployment.ChangesetOutput{}, err + } + + resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + Chains: env.Chains, + AddressBook: env.ExistingAddresses, + }) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to get contract sets: %w", err) + } + + cs := resp.ContractSets[req.RegistryChainSel] + if cs.WorkflowRegistry == nil { + return deployment.ChangesetOutput{}, errors.New("could not find workflow registry") + } + registry := cs.WorkflowRegistry + + chain, ok := env.Chains[req.RegistryChainSel] + if !ok { + return deployment.ChangesetOutput{}, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel) + } + + var s strategy + if req.MCMSConfig != nil { + s = &mcmsTransaction{ + Config: req.MCMSConfig, + Description: "proposal to update allowed dons", + Address: registry.Address(), + ChainSel: req.RegistryChainSel, + ContractSet: &cs, + } + } else { + s = &simpleTransaction{ + chain: chain, + } + } + + return s.Apply(func(opts *bind.TransactOpts) (*types.Transaction, error) { + tx, err := registry.UpdateAllowedDONs(opts, req.DonIDs, req.Allowed) + if err != nil { + err = kslib.DecodeErr(workflow_registry.WorkflowRegistryABI, err) + } + return tx, err + }) +} diff --git a/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go new file mode 100644 index 00000000000..bb17a85b1aa --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/update_allowed_dons_test.go @@ -0,0 +1,111 @@ +package workflowregistry_test + +import ( + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + chain_selectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink/deployment" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" +) + +func TestUpdateAllowedDons(t *testing.T) { + lggr := logger.Test(t) + + chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector + resp := kstest.SetupTestWorkflowRegistry(t, lggr, chainSel) + registry := resp.Registry + + dons, err := registry.GetAllAllowedDONs(&bind.CallOpts{}) + require.NoError(t, err) + + assert.Len(t, dons, 0) + + env := deployment.Environment{ + Logger: lggr, + Chains: map[uint64]deployment.Chain{ + chainSel: resp.Chain, + }, + ExistingAddresses: resp.AddressBook, + } + + _, err = workflowregistry.UpdateAllowedDons( + env, + &workflowregistry.UpdateAllowedDonsRequest{ + RegistryChainSel: chainSel, + DonIDs: []uint32{1}, + Allowed: true, + }, + ) + require.NoError(t, err) + + dons, err = registry.GetAllAllowedDONs(&bind.CallOpts{}) + require.NoError(t, err) + + assert.Len(t, dons, 1) + assert.Equal(t, dons[0], uint32(1)) + + _, err = workflowregistry.UpdateAllowedDons( + env, + &workflowregistry.UpdateAllowedDonsRequest{ + RegistryChainSel: chainSel, + DonIDs: []uint32{1}, + Allowed: false, + }, + ) + require.NoError(t, err) + + dons, err = registry.GetAllAllowedDONs(&bind.CallOpts{}) + require.NoError(t, err) + + assert.Len(t, dons, 0) +} + +func Test_UpdateAllowedDons_WithMCMS(t *testing.T) { + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, + NumChains: 1, + UseMCMS: true, + }) + + req := &workflowregistry.UpdateAllowedDonsRequest{ + RegistryChainSel: te.RegistrySelector, + DonIDs: []uint32{1}, + Allowed: true, + MCMSConfig: &changeset.MCMSConfig{MinDuration: 0}, + } + + out, err := workflowregistry.UpdateAllowedDons(te.Env, req) + require.NoError(t, err) + require.Len(t, out.Proposals, 1) + require.Nil(t, out.AddressBook) + + contracts := te.ContractSets()[te.RegistrySelector] + timelockContracts := map[uint64]*proposalutils.TimelockExecutionContracts{ + te.RegistrySelector: { + Timelock: contracts.Timelock, + CallProxy: contracts.CallProxy, + }, + } + + _, err = commonchangeset.ApplyChangesets(t, te.Env, timelockContracts, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(workflowregistry.UpdateAllowedDons), + Config: req, + }, + }) + require.NoError(t, err) +} diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go new file mode 100644 index 00000000000..f05c6cd58c9 --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses.go @@ -0,0 +1,106 @@ +package workflowregistry + +import ( + "errors" + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + + "github.com/smartcontractkit/chainlink/deployment" + + kslib "github.com/smartcontractkit/chainlink/deployment/keystone" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" +) + +var _ deployment.ChangeSet[*UpdateAuthorizedAddressesRequest] = UpdateAuthorizedAddresses + +type UpdateAuthorizedAddressesRequest struct { + RegistryChainSel uint64 + + Addresses []string + Allowed bool + + MCMSConfig *changeset.MCMSConfig +} + +func (r *UpdateAuthorizedAddressesRequest) Validate() error { + if len(r.Addresses) == 0 { + return errors.New("Must provide at least 1 address") + } + + return nil +} + +func getWorkflowRegistry(env deployment.Environment, chainSel uint64) (*workflow_registry.WorkflowRegistry, error) { + resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + Chains: env.Chains, + AddressBook: env.ExistingAddresses, + }) + if err != nil { + return nil, fmt.Errorf("failed to get contract sets: %w", err) + } + + cs := resp.ContractSets[chainSel] + if cs.WorkflowRegistry == nil { + return nil, errors.New("could not find workflow registry") + } + + return cs.WorkflowRegistry, nil +} + +// UpdateAuthorizedAddresses updates the list of DONs that workflows can be sent to. +func UpdateAuthorizedAddresses(env deployment.Environment, req *UpdateAuthorizedAddressesRequest) (deployment.ChangesetOutput, error) { + if err := req.Validate(); err != nil { + return deployment.ChangesetOutput{}, err + } + + resp, err := kslib.GetContractSets(env.Logger, &kslib.GetContractSetsRequest{ + Chains: env.Chains, + AddressBook: env.ExistingAddresses, + }) + if err != nil { + return deployment.ChangesetOutput{}, fmt.Errorf("failed to get contract sets: %w", err) + } + + cs := resp.ContractSets[req.RegistryChainSel] + if cs.WorkflowRegistry == nil { + return deployment.ChangesetOutput{}, errors.New("could not find workflow registry") + } + registry := cs.WorkflowRegistry + + chain, ok := env.Chains[req.RegistryChainSel] + if !ok { + return deployment.ChangesetOutput{}, fmt.Errorf("registry chain selector %d does not exist in environment", req.RegistryChainSel) + } + + var addr []common.Address + for _, a := range req.Addresses { + addr = append(addr, common.HexToAddress(a)) + } + + var s strategy + if req.MCMSConfig != nil { + s = &mcmsTransaction{ + Config: req.MCMSConfig, + Description: "proposal to update authorized addresses", + Address: registry.Address(), + ChainSel: chain.Selector, + ContractSet: &cs, + } + } else { + s = &simpleTransaction{ + chain: chain, + } + } + + return s.Apply(func(opts *bind.TransactOpts) (*types.Transaction, error) { + tx, err := registry.UpdateAuthorizedAddresses(opts, addr, req.Allowed) + if err != nil { + err = kslib.DecodeErr(workflow_registry.WorkflowRegistryABI, err) + } + return tx, err + }) +} diff --git a/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go new file mode 100644 index 00000000000..36dfd4371b1 --- /dev/null +++ b/deployment/keystone/changeset/workflowregistry/update_authorized_addresses_test.go @@ -0,0 +1,114 @@ +package workflowregistry_test + +import ( + "testing" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + chain_selectors "github.com/smartcontractkit/chain-selectors" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/deployment" + commonchangeset "github.com/smartcontractkit/chainlink/deployment/common/changeset" + "github.com/smartcontractkit/chainlink/deployment/common/proposalutils" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset" + kstest "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/internal/test" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/test" + "github.com/smartcontractkit/chainlink/deployment/keystone/changeset/workflowregistry" +) + +func TestUpdateAuthorizedAddresses(t *testing.T) { + lggr := logger.Test(t) + + chainSel := chain_selectors.ETHEREUM_TESTNET_SEPOLIA.Selector + resp := kstest.SetupTestWorkflowRegistry(t, lggr, chainSel) + registry := resp.Registry + + dons, err := registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) + require.NoError(t, err) + + assert.Len(t, dons, 0) + + env := deployment.Environment{ + Logger: lggr, + Chains: map[uint64]deployment.Chain{ + chainSel: resp.Chain, + }, + ExistingAddresses: resp.AddressBook, + } + + addr := "0xc0ffee254729296a45a3885639AC7E10F9d54979" + _, err = workflowregistry.UpdateAuthorizedAddresses( + env, + &workflowregistry.UpdateAuthorizedAddressesRequest{ + RegistryChainSel: chainSel, + Addresses: []string{addr}, + Allowed: true, + }, + ) + require.NoError(t, err) + + dons, err = registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) + require.NoError(t, err) + + assert.Len(t, dons, 1) + assert.Equal(t, dons[0], common.HexToAddress(addr)) + + _, err = workflowregistry.UpdateAuthorizedAddresses( + env, + &workflowregistry.UpdateAuthorizedAddressesRequest{ + RegistryChainSel: chainSel, + Addresses: []string{addr}, + Allowed: false, + }, + ) + require.NoError(t, err) + + dons, err = registry.GetAllAuthorizedAddresses(&bind.CallOpts{}) + require.NoError(t, err) + + assert.Len(t, dons, 0) +} + +func Test_UpdateAuthorizedAddresses_WithMCMS(t *testing.T) { + te := test.SetupTestEnv(t, test.TestConfig{ + WFDonConfig: test.DonConfig{N: 4}, + AssetDonConfig: test.DonConfig{N: 4}, + WriterDonConfig: test.DonConfig{N: 4}, + NumChains: 1, + UseMCMS: true, + }) + + addr := "0xc0ffee254729296a45a3885639AC7E10F9d54979" + req := &workflowregistry.UpdateAuthorizedAddressesRequest{ + RegistryChainSel: te.RegistrySelector, + Addresses: []string{addr}, + Allowed: true, + MCMSConfig: &changeset.MCMSConfig{MinDuration: 0}, + } + + out, err := workflowregistry.UpdateAuthorizedAddresses(te.Env, req) + require.NoError(t, err) + require.Len(t, out.Proposals, 1) + require.Nil(t, out.AddressBook) + + contracts := te.ContractSets()[te.RegistrySelector] + timelockContracts := map[uint64]*proposalutils.TimelockExecutionContracts{ + te.RegistrySelector: { + Timelock: contracts.Timelock, + CallProxy: contracts.CallProxy, + }, + } + + _, err = commonchangeset.ApplyChangesets(t, te.Env, timelockContracts, []commonchangeset.ChangesetApplication{ + { + Changeset: commonchangeset.WrapChangeSet(workflowregistry.UpdateAuthorizedAddresses), + Config: req, + }, + }) + require.NoError(t, err) +} diff --git a/deployment/keystone/contract_set.go b/deployment/keystone/contract_set.go index ee503a54b4d..51b5c823600 100644 --- a/deployment/keystone/contract_set.go +++ b/deployment/keystone/contract_set.go @@ -58,6 +58,21 @@ func DeployCapabilitiesRegistry(chain deployment.Chain, ab deployment.AddressBoo return capabilitiesRegistryResp, nil } +// DeployWorkflowRegistry deploys the WorkflowRegistry contract to the chain +// and saves the address in the address book. This mutates the address book. +func DeployWorkflowRegistry(chain deployment.Chain, ab deployment.AddressBook) (*DeployResponse, error) { + deployer, err := NewWorkflowRegistryDeployer() + resp, err := deployer.Deploy(DeployRequest{Chain: chain}) + if err != nil { + return nil, fmt.Errorf("failed to deploy WorkflowRegistry: %w", err) + } + err = ab.Save(chain.Selector, resp.Address.String(), resp.Tv) + if err != nil { + return nil, fmt.Errorf("failed to save WorkflowRegistry: %w", err) + } + return resp, nil +} + // DeployOCR3 deploys the OCR3Capability contract to the chain // and saves the address in the address book. This mutates the address book. func DeployOCR3(chain deployment.Chain, ab deployment.AddressBook) (*DeployResponse, error) { diff --git a/deployment/keystone/state.go b/deployment/keystone/state.go index 0ac7cdc89ed..38b89b792c7 100644 --- a/deployment/keystone/state.go +++ b/deployment/keystone/state.go @@ -14,6 +14,7 @@ import ( "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/capabilities_registry" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/forwarder" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/keystone/generated/ocr3_capability" + workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" ) type GetContractSetsRequest struct { @@ -30,6 +31,7 @@ type ContractSet struct { OCR3 *ocr3_capability.OCR3Capability Forwarder *forwarder.KeystoneForwarder CapabilitiesRegistry *capabilities_registry.CapabilitiesRegistry + WorkflowRegistry *workflow_registry.WorkflowRegistry } func (cs ContractSet) TransferableContracts() []common.Address { @@ -43,6 +45,9 @@ func (cs ContractSet) TransferableContracts() []common.Address { if cs.CapabilitiesRegistry != nil { out = append(out, cs.CapabilitiesRegistry.Address()) } + if cs.WorkflowRegistry != nil { + out = append(out, cs.WorkflowRegistry.Address()) + } return out } @@ -105,6 +110,12 @@ func loadContractSet(lggr logger.Logger, chain deployment.Chain, addresses map[s return nil, fmt.Errorf("failed to create OCR3Capability contract from address %s: %w", addr, err) } out.OCR3 = c + case WorkflowRegistry: + c, err := workflow_registry.NewWorkflowRegistry(common.HexToAddress(addr), chain.Client) + if err != nil { + return nil, fmt.Errorf("failed to create OCR3Capability contract from address %s: %w", addr, err) + } + out.WorkflowRegistry = c default: lggr.Warnw("unknown contract type", "type", tv.Type) // ignore unknown contract types diff --git a/deployment/keystone/types.go b/deployment/keystone/types.go index d406487043c..cb1373d446c 100644 --- a/deployment/keystone/types.go +++ b/deployment/keystone/types.go @@ -21,6 +21,7 @@ import ( var ( CapabilitiesRegistry deployment.ContractType = "CapabilitiesRegistry" // https://github.com/smartcontractkit/chainlink/blob/50c1b3dbf31bd145b312739b08967600a5c67f30/contracts/src/v0.8/keystone/CapabilitiesRegistry.sol#L392 + WorkflowRegistry deployment.ContractType = "WorkflowRegistry" // https://github.com/smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/workflow/dev/WorkflowRegistry.sol KeystoneForwarder deployment.ContractType = "KeystoneForwarder" // https://github.com/smartcontractkit/chainlink/blob/50c1b3dbf31bd145b312739b08967600a5c67f30/contracts/src/v0.8/keystone/KeystoneForwarder.sol#L90 OCR3Capability deployment.ContractType = "OCR3Capability" // https://github.com/smartcontractkit/chainlink/blob/50c1b3dbf31bd145b312739b08967600a5c67f30/contracts/src/v0.8/keystone/OCR3Capability.sol#L12 FeedConsumer deployment.ContractType = "FeedConsumer" // no type and a version in contract https://github.com/smartcontractkit/chainlink/blob/89183a8a5d22b1aeca0ade3b76d16aa84067aa57/contracts/src/v0.8/keystone/KeystoneFeedsConsumer.sol#L1 diff --git a/deployment/keystone/workflow_registry_deployer.go b/deployment/keystone/workflow_registry_deployer.go new file mode 100644 index 00000000000..794e6ad0202 --- /dev/null +++ b/deployment/keystone/workflow_registry_deployer.go @@ -0,0 +1,65 @@ +package keystone + +import ( + "fmt" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + + "github.com/smartcontractkit/chainlink-common/pkg/logger" + + "github.com/smartcontractkit/chainlink/deployment" + workflow_registry "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/workflow/generated/workflow_registry_wrapper" +) + +type WorkflowRegistryDeployer struct { + lggr logger.Logger + contract *workflow_registry.WorkflowRegistry +} + +func NewWorkflowRegistryDeployer() (*WorkflowRegistryDeployer, error) { + lggr, err := logger.New() + if err != nil { + return nil, err + } + return &WorkflowRegistryDeployer{lggr: lggr}, nil +} + +func (c *WorkflowRegistryDeployer) Contract() *workflow_registry.WorkflowRegistry { + return c.contract +} + +func (c *WorkflowRegistryDeployer) Deploy(req DeployRequest) (*DeployResponse, error) { + est, err := estimateDeploymentGas(req.Chain.Client, workflow_registry.WorkflowRegistryABI) + if err != nil { + return nil, fmt.Errorf("failed to estimate gas: %w", err) + } + c.lggr.Debugf("WorkflowRegistry estimated gas: %d", est) + + addr, tx, wr, err := workflow_registry.DeployWorkflowRegistry( + req.Chain.DeployerKey, + req.Chain.Client) + if err != nil { + return nil, DecodeErr(workflow_registry.WorkflowRegistryABI, err) + } + + _, err = req.Chain.Confirm(tx) + if err != nil { + return nil, fmt.Errorf("failed to confirm and save WorkflowRegistry: %w", err) + } + tvStr, err := wr.TypeAndVersion(&bind.CallOpts{}) + if err != nil { + return nil, fmt.Errorf("failed to get type and version: %w", err) + } + + tv, err := deployment.TypeAndVersionFromString(tvStr) + if err != nil { + return nil, fmt.Errorf("failed to parse type and version from %s: %w", tvStr, err) + } + resp := &DeployResponse{ + Address: addr, + Tx: tx.Hash(), + Tv: tv, + } + c.contract = wr + return resp, nil +} diff --git a/integration-tests/.golangci.yml b/integration-tests/.golangci.yml index 8969110d988..337555e17cb 100644 --- a/integration-tests/.golangci.yml +++ b/integration-tests/.golangci.yml @@ -1,15 +1,33 @@ run: timeout: 15m + allow-parallel-runners: true linters: enable: + - containedctx + - depguard + - errname + - errorlint - exhaustive - exportloopref - - revive + - fatcontext + - ginkgolinter + - gocritic - goimports - gosec + - loggercheck + - mirror - misspell + - noctx + - nolintlint + - perfsprint + - prealloc + - revive - rowserrcheck - - errorlint + - spancheck + - sqlclosecheck + - testifylint + - unconvert + - whitespace linters-settings: exhaustive: default-signifies-exhaustive: true @@ -23,6 +41,28 @@ linters-settings: govet: enable: - shadow + settings: + printf: + # Additionally check chainlink custom loggers + funcs: + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Tracef + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Debugf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Infof + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Warnf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Errorf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Criticalf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Panicf + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Fatalf + - (github.com/smartcontractkit/chainlink/v2/core/logger.SugaredLogger).AssumptionViolationf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infof + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationf + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracef + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalf revive: confidence: 0.8 rules: @@ -33,9 +73,10 @@ linters-settings: - name: error-return - name: error-strings - name: error-naming + - name: exported - name: if-return - name: increment-decrement - # - name: var-naming // doesn't work with some generated names + - name: var-naming - name: var-declaration - name: package-comments - name: range @@ -46,7 +87,7 @@ linters-settings: - name: errorf - name: empty-block - name: superfluous-else - #- name: unused-parameter + # - name: unused-parameter - name: unreachable-code - name: redefines-builtin-id - name: waitgroup-by-value @@ -61,13 +102,69 @@ linters-settings: - name: identical-branches - name: get-return # - name: flag-parameter // probably one we should work on doing better at in the future - # - name: early-return // probably one we should work on doing better at in the future + - name: early-return - name: defer - name: constant-logical-expr - name: confusing-naming - name: confusing-results - name: bool-literal-in-expr - name: atomic + depguard: + rules: + main: + list-mode: lax + deny: + - pkg: cosmossdk.io/errors + desc: Use the standard library instead + - pkg: github.com/gofrs/uuid + desc: Use github.com/google/uuid instead + - pkg: github.com/jackc/pgx3 + desc: Use github.com/jackc/pgx4 instead + - pkg: github.com/jackc/pgx5 + desc: Use github.com/jackc/pgx4 instead + - pkg: github.com/satori/go.uuid + desc: Use github.com/google/uuid instead + - pkg: github.com/test-go/testify/assert + desc: Use github.com/stretchr/testify/assert instead + - pkg: github.com/test-go/testify/mock + desc: Use github.com/stretchr/testify/mock instead + - pkg: github.com/test-go/testify/require + desc: Use github.com/stretchr/testify/require instead + - pkg: go.uber.org/multierr + desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join + - pkg: gopkg.in/guregu/null.v1 + desc: Use gopkg.in/guregu/null.v4 instead + - pkg: gopkg.in/guregu/null.v2 + desc: Use gopkg.in/guregu/null.v4 instead + - pkg: gopkg.in/guregu/null.v3 + desc: Use gopkg.in/guregu/null.v4 instead + - pkg: github.com/go-gorm/gorm + desc: Use github.com/jmoiron/sqlx directly instead + loggercheck: + # Check that *w logging functions have even number of args (i.e., well formed key-value pairs). + rules: + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Tracew + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Debugw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Infow + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Warnw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Errorw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Criticalw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Panicw + - (github.com/smartcontractkit/chainlink/v2/core/logger.Logger).Fatalw + - (github.com/smartcontractkit/chainlink/v2/core/logger.SugaredLogger).AssumptionViolationw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Debugw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Infow + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Warnw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Errorw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Panicw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.Logger).Fatalw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).AssumptionViolationw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Tracew + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).Criticalw + - (github.com/smartcontractkit/chainlink-common/pkg/logger.SugaredLogger).With + nolintlint: + require-specific: true + require-explanation: true issues: exclude-rules: - text: "^G404: Use of weak random number generator" diff --git a/integration-tests/crib/README.md b/integration-tests/crib/README.md index c37cbfec9c9..b3ba2c41823 100644 --- a/integration-tests/crib/README.md +++ b/integration-tests/crib/README.md @@ -6,7 +6,7 @@ It runs OCRv1 and reboots the environment confirming integration with environmen Go to the [CRIB](https://github.com/smartcontractkit/crib) repository and spin up a cluster. ```shell -./scripts/cribbit.sh crib-oh-my-crib +DEVSPACE_NAMESPACE=crib-oh-my-crib crib init devspace deploy --debug --profile local-dev-simulated-core-ocr1 ```