diff --git a/.changeset/many-carrots-share.md b/.changeset/many-carrots-share.md new file mode 100644 index 00000000000..da22ac6ed4f --- /dev/null +++ b/.changeset/many-carrots-share.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +#internal Update ccip contract reader cfg for ccip message sent to use output codec wrapper modifier diff --git a/.github/workflows/solidity-foundry.yml b/.github/workflows/solidity-foundry.yml index 7f9e7f1f90f..866fb4a7b86 100644 --- a/.github/workflows/solidity-foundry.yml +++ b/.github/workflows/solidity-foundry.yml @@ -256,7 +256,7 @@ jobs: || needs.changes.outputs.non_src_changes == 'true') && matrix.product.setup.run-gas-snapshot }} run: | - forge snapshot --nmt "test_?Fuzz_\w{1,}?" --check gas-snapshots/${{ matrix.product.name }}.gas-snapshot + forge snapshot --nmt "test?(Fuzz|Fork|.*_RevertWhen)_.*" --check gas-snapshots/${{ matrix.product.name }}.gas-snapshot id: snapshot working-directory: contracts env: diff --git a/contracts/.changeset/dull-otters-behave.md b/contracts/.changeset/dull-otters-behave.md new file mode 100644 index 00000000000..00b45157a51 --- /dev/null +++ b/contracts/.changeset/dull-otters-behave.md @@ -0,0 +1,5 @@ +--- +'@chainlink/contracts': patch +--- + +#internal rework the regex for snapshot inclusion diff --git a/contracts/GNUmakefile b/contracts/GNUmakefile index 4d47fa05ba5..5fae1cdf927 100644 --- a/contracts/GNUmakefile +++ b/contracts/GNUmakefile @@ -16,11 +16,11 @@ ALL_FOUNDRY_PRODUCTS = ccip functions keystone l2ep liquiditymanager llo-feeds o # a static fuzz seed by default, flaky gas results per platform are still observed. .PHONY: snapshot snapshot: ## Make a snapshot for a specific product. - export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "test_?Fuzz_\w{1,}?" --snap gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot + export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "test?(Fuzz|Fork|.*_RevertWhen)_.*" --snap gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot .PHONY: snapshot-diff snapshot-diff: ## Make a snapshot for a specific product. - export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "test_?Fuzz_\w{1,}?" --diff gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot + export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "test?(Fuzz|Fork|.*_RevertWhen)_.*" --diff gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot .PHONY: snapshot-all diff --git a/contracts/gas-snapshots/ccip.gas-snapshot b/contracts/gas-snapshots/ccip.gas-snapshot index 32f87cc6326..3904b4ef2e6 100644 --- a/contracts/gas-snapshots/ccip.gas-snapshot +++ b/contracts/gas-snapshots/ccip.gas-snapshot @@ -14,7 +14,7 @@ BurnMintTokenPool_lockOrBurn:test_PoolBurn_Success() (gas: 242205) BurnMintTokenPool_lockOrBurn:test_Setup_Success() (gas: 17873) BurnMintTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 28903) BurnMintTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56399) -BurnMintTokenPool_releaseOrMint:test_PoolMint_Success() (gas: 112591) +BurnMintTokenPool_releaseOrMint:test_PoolMint_Success() (gas: 112631) BurnMintWithLockReleaseFlagTokenPool_lockOrBurn:test_LockOrBurn_CorrectReturnData_Success() (gas: 242835) BurnWithFromMintTokenPool_lockOrBurn:test_ChainNotAllowed_Revert() (gas: 28962) BurnWithFromMintTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 55385) @@ -68,12 +68,12 @@ CCIPHome_setCandidate:test_setCandidate_success() (gas: 1365439) CCIPHome_supportsInterface:test_supportsInterface_success() (gas: 9885) DefensiveExampleTest:test_HappyPath_Success() (gas: 200540) DefensiveExampleTest:test_Recovery() (gas: 425013) -E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1520217) -EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 96962) +E2E:test_E2E_3MessagesMMultiOffRampSuccess_gas() (gas: 1520337) +EtherSenderReceiverTest_ccipReceive:test_ccipReceive_fallbackToWethTransfer() (gas: 96980) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_happyPath() (gas: 49812) -EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongToken() (gas: 17457) +EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongToken() (gas: 17479) EtherSenderReceiverTest_ccipReceive:test_ccipReceive_wrongTokenAmount() (gas: 15753) -EtherSenderReceiverTest_ccipSend:test_ccipSend_reverts_insufficientFee_feeToken() (gas: 99930) +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) @@ -86,10 +86,10 @@ EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_reverts_feeToken_ EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_valid_feeToken() (gas: 16682) EtherSenderReceiverTest_validateFeeToken:test_validateFeeToken_valid_native() (gas: 16615) EtherSenderReceiverTest_validatedMessage:test_validatedMessage_dataOverwrittenToMsgSender() (gas: 25456) -EtherSenderReceiverTest_validatedMessage:test_validatedMessage_emptyDataOverwrittenToMsgSender() (gas: 25351) +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: 26392) +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) @@ -119,31 +119,31 @@ 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: 41217) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroInput_Success() (gas: 12452) -FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates_Success() (gas: 140665) +FeeQuoter_applyDestChainConfigUpdates:test_InvalidChainFamilySelector_Revert() (gas: 16824) +FeeQuoter_applyDestChainConfigUpdates:test_InvalidDestChainConfigDestChainSelectorEqZero_Revert() (gas: 16737) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesDefaultTxGasLimitEqZero_Revert() (gas: 16791) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesDefaultTxGasLimitGtMaxPerMessageGasLimit_Revert() (gas: 41195) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdatesZeroInput_Success() (gas: 12541) +FeeQuoter_applyDestChainConfigUpdates:test_applyDestChainConfigUpdates_Success() (gas: 140643) FeeQuoter_applyFeeTokensUpdates:test_ApplyFeeTokensUpdates_Success() (gas: 162508) FeeQuoter_applyFeeTokensUpdates:test_OnlyCallableByOwner_Revert() (gas: 12241) FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 11564) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens_Success() (gas: 54882) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken_Success() (gas: 45290) -FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12434) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesMultipleTokens_Success() (gas: 54904) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesSingleToken_Success() (gas: 45323) +FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates:test_applyPremiumMultiplierWeiPerEthUpdatesZeroInput() (gas: 12456) FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeConfig_Success() (gas: 88930) FeeQuoter_applyTokenTransferFeeConfigUpdates:test_ApplyTokenTransferFeeZeroInput() (gas: 13324) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_InvalidDestBytesOverhead_Revert() (gas: 17501) -FeeQuoter_applyTokenTransferFeeConfigUpdates:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 12305) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_InvalidDestBytesOverhead_Revert() (gas: 17413) +FeeQuoter_applyTokenTransferFeeConfigUpdates:test_OnlyCallableByOwnerOrAdmin_Revert() (gas: 12327) FeeQuoter_constructor:test_InvalidLinkTokenEqZeroAddress_Revert() (gas: 106573) FeeQuoter_constructor:test_InvalidMaxFeeJuelsPerMsg_Revert() (gas: 110923) FeeQuoter_constructor:test_InvalidStalenessThreshold_Revert() (gas: 110998) FeeQuoter_constructor:test_Setup_Success() (gas: 4974931) -FeeQuoter_convertTokenAmount:test_ConvertTokenAmount_Success() (gas: 68394) +FeeQuoter_convertTokenAmount:test_ConvertTokenAmount_Success() (gas: 68416) FeeQuoter_convertTokenAmount:test_LinkTokenNotSupported_Revert() (gas: 29300) FeeQuoter_getDataAvailabilityCost:test_EmptyMessageCalculatesDataAvailabilityCost_Success() (gas: 96323) -FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() (gas: 14857) -FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 20877) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCostUnsupportedDestChainSelector_Success() (gas: 14835) +FeeQuoter_getDataAvailabilityCost:test_SimpleMessageCalculatesDataAvailabilityCost_Success() (gas: 20944) FeeQuoter_getTokenAndGasPrices:test_GetFeeTokenAndGasPrices_Success() (gas: 73071) FeeQuoter_getTokenAndGasPrices:test_StaleGasPrice_Revert() (gas: 26476) FeeQuoter_getTokenAndGasPrices:test_StalenessCheckDisabled_Success() (gas: 112021) @@ -158,35 +158,35 @@ FeeQuoter_getTokenTransferCost:test_LargeTokenTransferChargesMaxFeeAndGas_Succes FeeQuoter_getTokenTransferCost:test_MixedTokenTransferFee_Success() (gas: 96218) FeeQuoter_getTokenTransferCost:test_NoTokenTransferChargesZeroFee_Success() (gas: 20702) FeeQuoter_getTokenTransferCost:test_SmallTokenTransferChargesMinFeeAndGas_Success() (gas: 28049) -FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28072) +FeeQuoter_getTokenTransferCost:test_ZeroAmountTokenTransferChargesMinFeeAndGas_Success() (gas: 28094) FeeQuoter_getTokenTransferCost:test_ZeroFeeConfigChargesMinFee_Success() (gas: 40887) FeeQuoter_getTokenTransferCost:test_getTokenTransferCost_selfServeUsesDefaults_Success() (gas: 29801) FeeQuoter_getValidatedFee:test_DestinationChainNotEnabled_Revert() (gas: 18465) FeeQuoter_getValidatedFee:test_EmptyMessage_Success() (gas: 83208) FeeQuoter_getValidatedFee:test_EnforceOutOfOrder_Revert() (gas: 53548) FeeQuoter_getValidatedFee:test_HighGasMessage_Success() (gas: 239604) -FeeQuoter_getValidatedFee:test_InvalidEVMAddress_Revert() (gas: 22646) +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: 143157) +FeeQuoter_getValidatedFee:test_MessageWithDataAndTokenTransfer_Success() (gas: 143112) FeeQuoter_getValidatedFee:test_NotAFeeToken_Revert() (gas: 21280) -FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 114442) -FeeQuoter_getValidatedFee:test_TooManyTokens_Revert() (gas: 23473) +FeeQuoter_getValidatedFee:test_SingleTokenMessage_Success() (gas: 114464) +FeeQuoter_getValidatedFee:test_TooManyTokens_Revert() (gas: 23495) FeeQuoter_getValidatedFee:test_ZeroDataAvailabilityMultiplier_Success() (gas: 63843) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 1887407) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 1887365) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 1867484) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 1887139) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 1887343) -FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 1887155) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Above18Decimals_Success() (gas: 1897830) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedErc20Below18Decimals_Success() (gas: 1897788) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt0Decimals_Success() (gas: 1877907) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFeedAt18Decimals_Success() (gas: 1897562) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedFlippedDecimals_Success() (gas: 1897766) +FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedMaxInt224Value_Success() (gas: 1897578) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeedOverStalenessPeriod_Success() (gas: 65210) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPriceFromFeed_Success() (gas: 65090) FeeQuoter_getValidatedTokenPrice:test_GetValidatedTokenPrice_Success() (gas: 58872) -FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 1886781) +FeeQuoter_getValidatedTokenPrice:test_OverflowFeedPrice_Revert() (gas: 1897204) FeeQuoter_getValidatedTokenPrice:test_StaleFeeToken_Success() (gas: 61821) FeeQuoter_getValidatedTokenPrice:test_TokenNotSupportedFeed_Revert() (gas: 116926) FeeQuoter_getValidatedTokenPrice:test_TokenNotSupported_Revert() (gas: 14160) -FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 1885458) +FeeQuoter_getValidatedTokenPrice:test_UnderflowFeedPrice_Revert() (gas: 1895881) FeeQuoter_onReport:test_OnReport_StaleUpdate_SkipPriceUpdate_Success() (gas: 43936) FeeQuoter_onReport:test_onReport_InvalidForwarder_Reverts() (gas: 23657) FeeQuoter_onReport:test_onReport_Success() (gas: 80700) @@ -235,12 +235,12 @@ HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism_Success() HybridLockReleaseUSDCTokenPool_lockOrBurn:test_onLockReleaseMechanism_thenswitchToPrimary_Success() (gas: 209322) HybridLockReleaseUSDCTokenPool_releaseOrMint:test_OnLockReleaseMechanism_Success() (gas: 216938) HybridLockReleaseUSDCTokenPool_releaseOrMint:test_WhileMigrationPause_Revert() (gas: 113472) -HybridLockReleaseUSDCTokenPool_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 269080) +HybridLockReleaseUSDCTokenPool_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 269112) LockReleaseTokenPool_canAcceptLiquidity:test_CanAcceptLiquidity_Success() (gas: 2788658) -LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30110) +LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30088) LockReleaseTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Success() (gas: 80282) LockReleaseTokenPool_lockOrBurn:test_PoolBurnRevertNotHealthy_Revert() (gas: 59734) -LockReleaseTokenPool_provideLiquidity:test_LiquidityNotAccepted_Revert() (gas: 2785075) +LockReleaseTokenPool_provideLiquidity:test_LiquidityNotAccepted_Revert() (gas: 2785053) LockReleaseTokenPool_provideLiquidity:test_Unauthorized_Revert() (gas: 11489) LockReleaseTokenPool_releaseOrMint:test_ChainNotAllowed_Revert() (gas: 72956) LockReleaseTokenPool_releaseOrMint:test_PoolMintNotHealthy_Revert() (gas: 56520) @@ -250,13 +250,13 @@ LockReleaseTokenPool_setRebalancer:test_SetRebalancer_Success() (gas: 18160) LockReleaseTokenPool_supportsInterface:test_SupportsInterface_Success() (gas: 10250) LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_Success() (gas: 83306) LockReleaseTokenPool_transferLiquidity:test_transferLiquidity_transferTooMuch_Revert() (gas: 56079) -LockReleaseTokenPool_withdrawalLiquidity:test_InsufficientLiquidity_Revert() (gas: 60170) -LockReleaseTokenPool_withdrawalLiquidity:test_Unauthorized_Revert() (gas: 11464) -MerkleMultiProofTest:test_CVE_2023_34459() (gas: 5500) -MerkleMultiProofTest:test_EmptyLeaf_Revert() (gas: 3607) +LockReleaseTokenPool_withdrawalLiquidity:test_InsufficientLiquidity_Revert() (gas: 60188) +LockReleaseTokenPool_withdrawalLiquidity:test_Unauthorized_Revert() (gas: 11486) +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_SpecSync_gas() (gas: 34107) +MerkleMultiProofTest:test_SpecSync_gas() (gas: 34152) MockRouterTest:test_ccipSendWithInsufficientNativeTokens_Revert() (gas: 34081) MockRouterTest:test_ccipSendWithInvalidMsgValue_Revert() (gas: 60886) MockRouterTest:test_ccipSendWithLinkFeeTokenAndValidMsgValue_Success() (gas: 126631) @@ -313,7 +313,7 @@ MultiAggregateRateLimiter_updateRateLimitTokens:test_ZeroDestToken_AbiEncoded_Re 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: 44212) +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) @@ -330,13 +330,13 @@ 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: 476204) +MultiOCR3Base_setOCR3Configs:test_UpdateConfigTransmittersWithoutSigners_Success() (gas: 476186) MultiOCR3Base_transmit:test_ConfigDigestMismatch_Revert() (gas: 42957) MultiOCR3Base_transmit:test_ForkedChain_Revert() (gas: 48640) MultiOCR3Base_transmit:test_InsufficientSignatures_Revert() (gas: 77185) MultiOCR3Base_transmit:test_NonUniqueSignature_Revert() (gas: 65925) MultiOCR3Base_transmit:test_SignatureOutOfRegistration_Revert() (gas: 33494) -MultiOCR3Base_transmit:test_TooManySignatures_Revert() (gas: 79844) +MultiOCR3Base_transmit:test_TooManySignatures_Revert() (gas: 79889) MultiOCR3Base_transmit:test_TransmitSigners_gas_Success() (gas: 33686) MultiOCR3Base_transmit:test_TransmitWithExtraCalldataArgs_Revert() (gas: 47188) MultiOCR3Base_transmit:test_TransmitWithLessCalldataArgs_Revert() (gas: 25711) @@ -368,25 +368,24 @@ NonceManager_applyPreviousRampsUpdates:test_SingleRampUpdate_success() (gas: 668 NonceManager_applyPreviousRampsUpdates:test_ZeroInput_success() (gas: 12213) NonceManager_typeAndVersion:test_typeAndVersion() (gas: 9705) OffRamp_afterOC3ConfigSet:test_afterOCR3ConfigSet_SignatureVerificationDisabled_Revert() (gas: 5880050) -OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 626115) -OffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 166493) -OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 16741) -OffRamp_applySourceChainConfigUpdates:test_InvalidOnRampUpdate_Revert() (gas: 274735) +OffRamp_applySourceChainConfigUpdates:test_AddMultipleChains_Success() (gas: 626160) +OffRamp_applySourceChainConfigUpdates:test_AddNewChain_Success() (gas: 166527) +OffRamp_applySourceChainConfigUpdates:test_ApplyZeroUpdates_Success() (gas: 16719) +OffRamp_applySourceChainConfigUpdates:test_InvalidOnRampUpdate_Revert() (gas: 274713) OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChainOnRamp_Success() (gas: 168604) OffRamp_applySourceChainConfigUpdates:test_ReplaceExistingChain_Success() (gas: 181059) -OffRamp_applySourceChainConfigUpdates:test_RouterAddress_Revert() (gas: 13463) -OffRamp_applySourceChainConfigUpdates:test_ZeroOnRampAddress_Revert() (gas: 72746) -OffRamp_applySourceChainConfigUpdates:test_ZeroSourceChainSelector_Revert() (gas: 15476) -OffRamp_applySourceChainConfigUpdates:test_allowNonOnRampUpdateAfterLaneIsUsed_success() (gas: 285063) +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: 285041) OffRamp_batchExecute:test_MultipleReportsDifferentChainsSkipCursedChain_Success() (gas: 177349) OffRamp_batchExecute:test_MultipleReportsDifferentChains_Success() (gas: 333175) OffRamp_batchExecute:test_MultipleReportsSameChain_Success() (gas: 276441) OffRamp_batchExecute:test_MultipleReportsSkipDuplicate_Success() (gas: 168334) OffRamp_batchExecute:test_OutOfBoundsGasLimitsAccess_Revert() (gas: 187853) OffRamp_batchExecute:test_SingleReport_Success() (gas: 156369) -OffRamp_batchExecute:test_Unhealthy_Success() (gas: 553587) +OffRamp_batchExecute:test_Unhealthy_Success() (gas: 553667) OffRamp_batchExecute:test_ZeroReports_Revert() (gas: 10600) -OffRamp_ccipReceive:test_RevertWhen_Always() (gas: 9303) OffRamp_commit:test_CommitOnRampMismatch_Revert() (gas: 92744) OffRamp_commit:test_FailedRMNVerification_Reverts() (gas: 63432) OffRamp_commit:test_InvalidIntervalMinLargerThanMax_Revert() (gas: 69993) @@ -427,42 +426,42 @@ OffRamp_execute:test_UnauthorizedTransmitter_Revert() (gas: 147783) OffRamp_execute:test_WrongConfigWithSigners_Revert() (gas: 6940958) OffRamp_execute:test_ZeroReports_Revert() (gas: 17361) OffRamp_executeSingleMessage:test_MessageSender_Revert() (gas: 18533) -OffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 244245) +OffRamp_executeSingleMessage:test_NonContractWithTokens_Success() (gas: 244285) OffRamp_executeSingleMessage:test_NonContract_Success() (gas: 20363) OffRamp_executeSingleMessage:test_TokenHandlingError_Revert() (gas: 205686) OffRamp_executeSingleMessage:test_ZeroGasDONExecution_Revert() (gas: 48880) OffRamp_executeSingleMessage:test_executeSingleMessage_NoTokens_Success() (gas: 56102) OffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidationNoRouterCall_Revert() (gas: 212824) OffRamp_executeSingleMessage:test_executeSingleMessage_WithFailingValidation_Revert() (gas: 85495) -OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 274353) +OffRamp_executeSingleMessage:test_executeSingleMessage_WithTokens_Success() (gas: 274393) OffRamp_executeSingleMessage:test_executeSingleMessage_WithVInterception_Success() (gas: 91918) -OffRamp_executeSingleReport:test_DisabledSourceChain_Revert() (gas: 28636) -OffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 15580) -OffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 481507) -OffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 48295) -OffRamp_executeSingleReport:test_MismatchingDestChainSelector_Revert() (gas: 34188) -OffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 28823) -OffRamp_executeSingleReport:test_ReceiverError_Success() (gas: 187522) -OffRamp_executeSingleReport:test_RetryFailedMessageWithoutManualExecution_Revert() (gas: 197799) -OffRamp_executeSingleReport:test_RootNotCommitted_Revert() (gas: 40664) -OffRamp_executeSingleReport:test_RouterYULCall_Revert() (gas: 404911) -OffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain_Success() (gas: 248582) -OffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered_Success() (gas: 192204) -OffRamp_executeSingleReport:test_SingleMessageNoTokens_Success() (gas: 212228) -OffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver_Success() (gas: 243641) -OffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 141397) -OffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 408705) -OffRamp_executeSingleReport:test_SkippedIncorrectNonce_Success() (gas: 58241) -OffRamp_executeSingleReport:test_TokenDataMismatch_Revert() (gas: 73786) -OffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 582594) -OffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 531260) -OffRamp_executeSingleReport:test_UnexpectedTokenData_Revert() (gas: 26751) -OffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 549205) -OffRamp_executeSingleReport:test_Unhealthy_Success() (gas: 549241) -OffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 460352) -OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 135139) -OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 164782) -OffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3888824) +OffRamp_executeSingleReport:test_DisabledSourceChain_Revert() (gas: 28666) +OffRamp_executeSingleReport:test_EmptyReport_Revert() (gas: 15584) +OffRamp_executeSingleReport:test_InvalidSourcePoolAddress_Success() (gas: 481623) +OffRamp_executeSingleReport:test_ManualExecutionNotYetEnabled_Revert() (gas: 48303) +OffRamp_executeSingleReport:test_MismatchingDestChainSelector_Revert() (gas: 34108) +OffRamp_executeSingleReport:test_NonExistingSourceChain_Revert() (gas: 28831) +OffRamp_executeSingleReport:test_ReceiverError_Success() (gas: 187607) +OffRamp_executeSingleReport:test_RetryFailedMessageWithoutManualExecution_Revert() (gas: 197746) +OffRamp_executeSingleReport:test_RootNotCommitted_Revert() (gas: 40694) +OffRamp_executeSingleReport:test_RouterYULCall_Revert() (gas: 404953) +OffRamp_executeSingleReport:test_SingleMessageNoTokensOtherChain_Success() (gas: 248622) +OffRamp_executeSingleReport:test_SingleMessageNoTokensUnordered_Success() (gas: 192288) +OffRamp_executeSingleReport:test_SingleMessageNoTokens_Success() (gas: 212314) +OffRamp_executeSingleReport:test_SingleMessageToNonCCIPReceiver_Success() (gas: 243661) +OffRamp_executeSingleReport:test_SingleMessagesNoTokensSuccess_gas() (gas: 141439) +OffRamp_executeSingleReport:test_SkippedIncorrectNonceStillExecutes_Success() (gas: 408827) +OffRamp_executeSingleReport:test_SkippedIncorrectNonce_Success() (gas: 58249) +OffRamp_executeSingleReport:test_TokenDataMismatch_Revert() (gas: 73816) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensAndGE_Success() (gas: 582798) +OffRamp_executeSingleReport:test_TwoMessagesWithTokensSuccess_gas() (gas: 531349) +OffRamp_executeSingleReport:test_UnexpectedTokenData_Revert() (gas: 26755) +OffRamp_executeSingleReport:test_UnhealthySingleChainCurse_Revert() (gas: 549373) +OffRamp_executeSingleReport:test_Unhealthy_Success() (gas: 549320) +OffRamp_executeSingleReport:test_WithCurseOnAnotherSourceChain_Success() (gas: 460462) +OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessageUnordered_Success() (gas: 135167) +OffRamp_executeSingleReport:test__execute_SkippedAlreadyExecutedMessage_Success() (gas: 164806) +OffRamp_getExecutionState:test_FillExecutionState_Success() (gas: 3888846) OffRamp_getExecutionState:test_GetDifferentChainExecutionState_Success() (gas: 121048) OffRamp_getExecutionState:test_GetExecutionState_Success() (gas: 89561) OffRamp_manuallyExecute:test_ManualExecGasLimitMismatchSingleReport_Revert() (gas: 81178) @@ -488,21 +487,21 @@ OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_InvalidDataLength_Rever OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_ReleaseOrMintBalanceMismatch_Revert() (gas: 94643) OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_TokenHandlingError_BalanceOf_Revert() (gas: 37323) OffRamp_releaseOrMintSingleToken:test_releaseOrMintToken_skip_ReleaseOrMintBalanceMismatch_if_pool_Revert() (gas: 86755) -OffRamp_releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 162950) +OffRamp_releaseOrMintTokens:test_TokenHandlingError_Reverts() (gas: 162972) OffRamp_releaseOrMintTokens:test__releaseOrMintTokens_PoolIsNotAPool_Reverts() (gas: 23836) OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_InvalidDataLengthReturnData_Revert() (gas: 62866) OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_PoolDoesNotSupportDest_Reverts() (gas: 80036) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 175107) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_WithGasOverride_Success() (gas: 177019) -OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 188241) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_Success() (gas: 175147) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_WithGasOverride_Success() (gas: 177059) +OffRamp_releaseOrMintTokens:test_releaseOrMintTokens_destDenominatedDecimals_Success() (gas: 188281) OffRamp_setDynamicConfig:test_FeeQuoterZeroAddress_Revert() (gas: 11509) OffRamp_setDynamicConfig:test_NonOwner_Revert() (gas: 14019) OffRamp_setDynamicConfig:test_SetDynamicConfigWithInterceptor_Success() (gas: 47579) OffRamp_setDynamicConfig:test_SetDynamicConfig_Success() (gas: 25552) OffRamp_trialExecute:test_RateLimitError_Success() (gas: 219967) OffRamp_trialExecute:test_TokenHandlingErrorIsCaught_Success() (gas: 228644) -OffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 295676) -OffRamp_trialExecute:test_trialExecute_Success() (gas: 278150) +OffRamp_trialExecute:test_TokenPoolIsNotAContract_Success() (gas: 295716) +OffRamp_trialExecute:test_trialExecute_Success() (gas: 278190) OnRampTokenPoolReentrancy:test_OnRampTokenPoolReentrancy_Success() (gas: 251641) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_InvalidAllowListRequestDisabledAllowListWithAdds() (gas: 17227) OnRamp_applyAllowlistUpdates:test_applyAllowlistUpdates_Revert() (gas: 67101) @@ -515,28 +514,28 @@ OnRamp_constructor:test_Constructor_InvalidConfigNonceManagerEqAddressZero_Rever 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: 115410) +OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2AllowOutOfOrderTrue_Success() (gas: 115388) OnRamp_forwardFromRouter:test_ForwardFromRouterExtraArgsV2_Success() (gas: 146256) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145853) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 143969) -OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 146050) -OnRamp_forwardFromRouter:test_ForwardFromRouter_Success() (gas: 145448) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessCustomExtraArgs() (gas: 145831) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessEmptyExtraArgs() (gas: 144036) +OnRamp_forwardFromRouter:test_ForwardFromRouterSuccessLegacyExtraArgs() (gas: 146028) +OnRamp_forwardFromRouter:test_ForwardFromRouter_Success() (gas: 145426) OnRamp_forwardFromRouter:test_ForwardFromRouter_Success_ConfigurableSourceRouter() (gas: 140709) OnRamp_forwardFromRouter:test_InvalidExtraArgsTag_Revert() (gas: 38504) -OnRamp_forwardFromRouter:test_MessageInterceptionError_Revert() (gas: 143134) -OnRamp_forwardFromRouter:test_MesssageFeeTooHigh_Revert() (gas: 36611) +OnRamp_forwardFromRouter:test_MessageInterceptionError_Revert() (gas: 143112) +OnRamp_forwardFromRouter:test_MesssageFeeTooHigh_Revert() (gas: 36589) OnRamp_forwardFromRouter:test_MultiCannotSendZeroTokens_Revert() (gas: 36493) OnRamp_forwardFromRouter:test_OriginalSender_Revert() (gas: 18290) -OnRamp_forwardFromRouter:test_Paused_Revert() (gas: 38434) -OnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 23651) -OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 186649) -OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 213078) -OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 147059) -OnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 161248) +OnRamp_forwardFromRouter:test_Paused_Revert() (gas: 38412) +OnRamp_forwardFromRouter:test_Permissions_Revert() (gas: 23629) +OnRamp_forwardFromRouter:test_ShouldIncrementNonceOnlyOnOrdered_Success() (gas: 186583) +OnRamp_forwardFromRouter:test_ShouldIncrementSeqNumAndNonce_Success() (gas: 213012) +OnRamp_forwardFromRouter:test_ShouldStoreLinkFees() (gas: 147026) +OnRamp_forwardFromRouter:test_ShouldStoreNonLinkFees() (gas: 161215) OnRamp_forwardFromRouter:test_SourceTokenDataTooLarge_Revert() (gas: 3528787) OnRamp_forwardFromRouter:test_UnAllowedOriginalSender_Revert() (gas: 24015) -OnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 75854) -OnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 38610) +OnRamp_forwardFromRouter:test_UnsupportedToken_Revert() (gas: 75832) +OnRamp_forwardFromRouter:test_forwardFromRouter_UnsupportedToken_Revert() (gas: 38588) OnRamp_forwardFromRouter:test_forwardFromRouter_WithInterception_Success() (gas: 280356) OnRamp_getFee:test_EmptyMessage_Success() (gas: 98692) OnRamp_getFee:test_EnforceOutOfOrder_Revert() (gas: 65453) @@ -623,8 +622,8 @@ RegistryModuleOwnerCustom_registerAdminViaGetCCIPAdmin:test_registerAdminViaGetC RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Revert() (gas: 19602) RegistryModuleOwnerCustom_registerAdminViaOwner:test_registerAdminViaOwner_Success() (gas: 129930) Router_applyRampUpdates:test_OffRampMismatch_Revert() (gas: 89591) -Router_applyRampUpdates:test_OffRampUpdatesWithRouting() (gas: 10749462) -Router_applyRampUpdates:test_OnRampDisable() (gas: 56428) +Router_applyRampUpdates:test_OffRampUpdatesWithRouting() (gas: 10750087) +Router_applyRampUpdates:test_OnRampDisable() (gas: 56445) Router_applyRampUpdates:test_OnlyOwner_Revert() (gas: 12414) Router_ccipSend:test_CCIPSendLinkFeeNoTokenSuccess_gas() (gas: 131425) Router_ccipSend:test_CCIPSendLinkFeeOneTokenSuccess_gas() (gas: 221322) @@ -655,7 +654,7 @@ 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: 11008) +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) @@ -666,10 +665,10 @@ 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: 15155) +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: 116194) +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) @@ -707,7 +706,7 @@ TokenPool_onlyOffRamp:test_onlyOffRamp_Success() (gas: 350358) TokenPool_onlyOnRamp:test_CallerIsNotARampOnRouter_Revert() (gas: 277250) TokenPool_onlyOnRamp:test_ChainNotAllowed_Revert() (gas: 254443) TokenPool_onlyOnRamp:test_onlyOnRamp_Success() (gas: 305359) -TokenPool_setChainRateLimiterConfig:test_NonExistentChain_Revert() (gas: 17225) +TokenPool_setChainRateLimiterConfig:test_NonExistentChain_Revert() (gas: 17203) TokenPool_setChainRateLimiterConfig:test_OnlyOwnerOrRateLimitAdmin_Revert() (gas: 15330) TokenPool_setRateLimitAdmin:test_SetRateLimitAdmin_Revert() (gas: 11024) TokenPool_setRateLimitAdmin:test_SetRateLimitAdmin_Success() (gas: 37584) @@ -735,9 +734,9 @@ USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_Success() (gas: USDCBridgeMigrator_provideLiquidity:test_onLockReleaseMechanism_thenswitchToPrimary_Success() (gas: 209376) USDCBridgeMigrator_releaseOrMint:test_OnLockReleaseMechanism_Success() (gas: 216971) USDCBridgeMigrator_releaseOrMint:test_WhileMigrationPause_Revert() (gas: 113505) -USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 269132) +USDCBridgeMigrator_releaseOrMint:test_incomingMessageWithPrimaryMechanism() (gas: 269164) USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_destChain_Success() (gas: 156100) -USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain_Success() (gas: 516280) +USDCBridgeMigrator_releaseOrMint:test_unstickManualTxAfterMigration_homeChain_Success() (gas: 516312) USDCBridgeMigrator_updateChainSelectorMechanism:test_PrimaryMechanism_Success() (gas: 135968) USDCBridgeMigrator_updateChainSelectorMechanism:test_WhileMigrationPause_Revert() (gas: 109746) USDCBridgeMigrator_updateChainSelectorMechanism:test_cannotRevertChainMechanism_afterMigration_Revert() (gas: 313315) @@ -746,13 +745,13 @@ USDCBridgeMigrator_updateChainSelectorMechanism:test_lockOrBurn_then_BurnInCCTPM USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism_Success() (gas: 147032) USDCBridgeMigrator_updateChainSelectorMechanism:test_onLockReleaseMechanism_thenswitchToPrimary_Success() (gas: 209340) USDCTokenPool__validateMessage:test_ValidateInvalidMessage_Revert() (gas: 25854) -USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35504) -USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30235) -USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133508) +USDCTokenPool_lockOrBurn:test_CallerIsNotARampOnRouter_Revert() (gas: 35526) +USDCTokenPool_lockOrBurn:test_LockOrBurnWithAllowList_Revert() (gas: 30257) +USDCTokenPool_lockOrBurn:test_LockOrBurn_Success() (gas: 133526) USDCTokenPool_lockOrBurn:test_UnknownDomain_Revert() (gas: 478407) -USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 268847) -USDCTokenPool_releaseOrMint:test_TokenMaxCapacityExceeded_Revert() (gas: 51004) -USDCTokenPool_releaseOrMint:test_UnlockingUSDCFailed_Revert() (gas: 99046) +USDCTokenPool_releaseOrMint:test_ReleaseOrMintRealTx_Success() (gas: 268879) +USDCTokenPool_releaseOrMint:test_TokenMaxCapacityExceeded_Revert() (gas: 51026) +USDCTokenPool_releaseOrMint:test_UnlockingUSDCFailed_Revert() (gas: 99086) 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 diff --git a/contracts/gas-snapshots/keystone.gas-snapshot b/contracts/gas-snapshots/keystone.gas-snapshot index d8ba041a5df..5a52ecb96c9 100644 --- a/contracts/gas-snapshots/keystone.gas-snapshot +++ b/contracts/gas-snapshots/keystone.gas-snapshot @@ -1,38 +1,11 @@ CapabilitiesRegistry_AddCapabilitiesTest:test_AddCapability_NoConfigurationContract() (gas: 154800) CapabilitiesRegistry_AddCapabilitiesTest:test_AddCapability_WithConfiguration() (gas: 180392) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_CalledByNonAdmin() (gas: 24678) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_CapabilityExists() (gas: 145611) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_ConfigurationContractDoesNotMatchInterface() (gas: 94542) -CapabilitiesRegistry_AddCapabilitiesTest:test_RevertWhen_ConfigurationContractNotDeployed() (gas: 96348) CapabilitiesRegistry_AddDONTest:test_AddDON() (gas: 373985) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19333) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 169812) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 239851) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 250973) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 116928) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_FaultToleranceIsZero() (gas: 43396) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_NodeAlreadyBelongsToWorkflowDON() (gas: 344127) -CapabilitiesRegistry_AddDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 180188) -CapabilitiesRegistry_AddDONTest_WhenMaliciousCapabilityConfigurationConfigured:test_RevertWhen_MaliciousCapabilitiesConfigContractTriesToRemoveCapabilitiesFromDONNodes() (gas: 340769) CapabilitiesRegistry_AddNodeOperatorsTest:test_AddNodeOperators() (gas: 184201) -CapabilitiesRegistry_AddNodeOperatorsTest:test_RevertWhen_CalledByNonAdmin() (gas: 17624) -CapabilitiesRegistry_AddNodeOperatorsTest:test_RevertWhen_NodeOperatorAdminAddressZero() (gas: 18542) CapabilitiesRegistry_AddNodesTest:test_AddsNodeParams() (gas: 380796) CapabilitiesRegistry_AddNodesTest:test_OwnerCanAddNodes() (gas: 380784) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingDuplicateP2PId() (gas: 323602) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 55328) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithInvalidNodeOperator() (gas: 25090) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_AddingNodeWithoutCapabilities() (gas: 27844) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25258) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_EncryptionPublicKeyEmpty() (gas: 29852) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 27558) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 27241) -CapabilitiesRegistry_AddNodesTest:test_RevertWhen_SignerAddressNotUnique() (gas: 332070) CapabilitiesRegistry_DeprecateCapabilitiesTest:test_DeprecatesCapability() (gas: 89796) CapabilitiesRegistry_DeprecateCapabilitiesTest:test_EmitsEvent() (gas: 89924) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CalledByNonAdmin() (gas: 22911) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 16188) -CapabilitiesRegistry_DeprecateCapabilitiesTest:test_RevertWhen_CapabilityIsDeprecated() (gas: 91210) CapabilitiesRegistry_GetCapabilitiesTest:test_ReturnsCapabilities() (gas: 135531) CapabilitiesRegistry_GetDONsTest:test_CorrectlyFetchesDONs() (gas: 65490) CapabilitiesRegistry_GetDONsTest:test_DoesNotIncludeRemovedDONs() (gas: 65060) @@ -46,46 +19,17 @@ CapabilitiesRegistry_GetNodesTest:test_CorrectlyFetchesSpecificNodes() (gas: 321 CapabilitiesRegistry_GetNodesTest:test_DoesNotIncludeRemovedNodes() (gas: 79284) CapabilitiesRegistry_GetNodesTest:test_GetNodesByP2PIdsInvalidNode_Revers() (gas: 26249) CapabilitiesRegistry_RemoveDONsTest:test_RemovesDON() (gas: 55026) -CapabilitiesRegistry_RemoveDONsTest:test_RevertWhen_CalledByNonAdmin() (gas: 15647) -CapabilitiesRegistry_RemoveDONsTest:test_RevertWhen_DONDoesNotExist() (gas: 16561) CapabilitiesRegistry_RemoveNodeOperatorsTest:test_RemovesNodeOperator() (gas: 36157) -CapabilitiesRegistry_RemoveNodeOperatorsTest:test_RevertWhen_CalledByNonOwner() (gas: 15816) CapabilitiesRegistry_RemoveNodesTest:test_CanAddNodeWithSameSignerAddressAfterRemoving() (gas: 117736) CapabilitiesRegistry_RemoveNodesTest:test_CanRemoveWhenDONDeleted() (gas: 288163) CapabilitiesRegistry_RemoveNodesTest:test_CanRemoveWhenNodeNoLongerPartOfDON() (gas: 561487) CapabilitiesRegistry_RemoveNodesTest:test_OwnerCanRemoveNodes() (gas: 77404) CapabilitiesRegistry_RemoveNodesTest:test_RemovesNode() (gas: 79239) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 25008) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 18373) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_NodePartOfCapabilitiesDON() (gas: 385467) -CapabilitiesRegistry_RemoveNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 18363) CapabilitiesRegistry_TypeAndVersionTest:test_TypeAndVersion() (gas: 9768) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_CalledByNonAdmin() (gas: 19323) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_CapabilityDoesNotExist() (gas: 152958) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DONDoesNotExist() (gas: 17749) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DeprecatedCapabilityAdded() (gas: 222997) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DuplicateCapabilityAdded() (gas: 236986) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_DuplicateNodeAdded() (gas: 107687) -CapabilitiesRegistry_UpdateDONTest:test_RevertWhen_NodeDoesNotSupportCapability() (gas: 163401) CapabilitiesRegistry_UpdateDONTest:test_UpdatesDON() (gas: 373535) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_CalledByNonAdminAndNonOwner() (gas: 20728) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorAdminIsZeroAddress() (gas: 20097) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorDoesNotExist() (gas: 19790) -CapabilitiesRegistry_UpdateNodeOperatorTest:test_RevertWhen_NodeOperatorIdAndParamLengthsMismatch() (gas: 15452) CapabilitiesRegistry_UpdateNodeOperatorTest:test_UpdatesNodeOperator() (gas: 37144) CapabilitiesRegistry_UpdateNodesTest:test_CanUpdateParamsIfNodeSignerAddressNoLongerUsed() (gas: 261420) CapabilitiesRegistry_UpdateNodesTest:test_OwnerCanUpdateNodes() (gas: 164875) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_AddingNodeWithInvalidCapability() (gas: 36026) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_CalledByAnotherNodeOperatorAdmin() (gas: 29326) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_CalledByNonNodeOperatorAdminAndNonOwner() (gas: 29504) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_EncryptionPublicKeyEmpty() (gas: 29746) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_NodeDoesNotExist() (gas: 29326) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_NodeSignerAlreadyAssignedToAnotherNode() (gas: 31452) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_P2PIDEmpty() (gas: 29292) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_RemovingCapabilityRequiredByCapabilityDON() (gas: 471202) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_RemovingCapabilityRequiredByWorkflowDON() (gas: 341548) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_SignerAddressEmpty() (gas: 29184) -CapabilitiesRegistry_UpdateNodesTest:test_RevertWhen_UpdatingNodeWithoutCapabilities() (gas: 27739) CapabilitiesRegistry_UpdateNodesTest:test_UpdatesNodeParams() (gas: 164929) KeystoneForwarder_ReportTest:test_Report_ConfigVersion() (gas: 2006852) KeystoneForwarder_ReportTest:test_Report_FailedDelieryWhenReportReceiverConsumesAllGas() (gas: 1004833) @@ -94,28 +38,8 @@ KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReceiverNotContract() KeystoneForwarder_ReportTest:test_Report_FailedDeliveryWhenReportReceiverConsumesAllGasAndInterfaceCheckUsesMax() (gas: 440303) KeystoneForwarder_ReportTest:test_Report_SuccessfulDelivery() (gas: 362838) KeystoneForwarder_ReportTest:test_Report_SuccessfulRetryWithMoreGas() (gas: 510677) -KeystoneForwarder_ReportTest:test_RevertWhen_AnySignatureIsInvalid() (gas: 86326) -KeystoneForwarder_ReportTest:test_RevertWhen_AnySignerIsInvalid() (gas: 118476) -KeystoneForwarder_ReportTest:test_RevertWhen_AttemptingTransmissionWithInsufficientGas() (gas: 96629) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasDuplicateSignatures() (gas: 94538) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasIncorrectDON() (gas: 75930) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportHasInexistentConfigVersion() (gas: 76298) -KeystoneForwarder_ReportTest:test_RevertWhen_ReportIsMalformed() (gas: 45563) -KeystoneForwarder_ReportTest:test_RevertWhen_RetryingInvalidContractTransmission() (gas: 144231) -KeystoneForwarder_ReportTest:test_RevertWhen_RetryingSuccessfulTransmission() (gas: 355976) -KeystoneForwarder_ReportTest:test_RevertWhen_TooFewSignatures() (gas: 55270) -KeystoneForwarder_ReportTest:test_RevertWhen_TooManySignatures() (gas: 56050) -KeystoneForwarder_SetConfigTest:test_RevertWhen_ExcessSigners() (gas: 20184) -KeystoneForwarder_SetConfigTest:test_RevertWhen_FaultToleranceIsZero() (gas: 88057) -KeystoneForwarder_SetConfigTest:test_RevertWhen_InsufficientSigners() (gas: 14555) -KeystoneForwarder_SetConfigTest:test_RevertWhen_NotOwner() (gas: 88766) -KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingDuplicateSigners() (gas: 114578) -KeystoneForwarder_SetConfigTest:test_RevertWhen_ProvidingZeroAddressSigner() (gas: 114233) KeystoneForwarder_SetConfigTest:test_SetConfig_FirstTime() (gas: 1540687) KeystoneForwarder_SetConfigTest:test_SetConfig_WhenSignersAreRemoved() (gas: 1535361) KeystoneForwarder_TypeAndVersionTest:test_TypeAndVersion() (gas: 9641) -KeystoneRouter_SetConfigTest:test_AddForwarder_RevertWhen_NotOwner() (gas: 10960) -KeystoneRouter_SetConfigTest:test_RemoveForwarder_RevertWhen_NotOwner() (gas: 10950) KeystoneRouter_SetConfigTest:test_RemoveForwarder_Success() (gas: 17603) -KeystoneRouter_SetConfigTest:test_Route_RevertWhen_UnauthorizedForwarder() (gas: 18530) KeystoneRouter_SetConfigTest:test_Route_Success() (gas: 80948) \ No newline at end of file diff --git a/contracts/gas-snapshots/operatorforwarder.gas-snapshot b/contracts/gas-snapshots/operatorforwarder.gas-snapshot index 724b764a19d..3c9bb6fae51 100644 --- a/contracts/gas-snapshots/operatorforwarder.gas-snapshot +++ b/contracts/gas-snapshots/operatorforwarder.gas-snapshot @@ -2,14 +2,10 @@ FactoryTest:test_DeployNewForwarderAndTransferOwnership_Success() (gas: 1059722) FactoryTest:test_DeployNewForwarder_Success() (gas: 1048209) FactoryTest:test_DeployNewOperatorAndForwarder_Success() (gas: 4069305) FactoryTest:test_DeployNewOperator_Success() (gas: 3020509) -ForwarderTest:test_Forward_Success(uint256) (runs: 257, μ: 226966, ~: 227276) -ForwarderTest:test_MultiForward_Success(uint256,uint256) (runs: 257, μ: 258642, ~: 259185) -ForwarderTest:test_OwnerForward_Success() (gas: 30090) +ForwarderTest:test_OwnerForward_Success() (gas: 30112) ForwarderTest:test_SetAuthorizedSenders_Success() (gas: 160524) -ForwarderTest:test_TransferOwnershipWithMessage_Success() (gas: 35141) +ForwarderTest:test_TransferOwnershipWithMessage_Success() (gas: 35159) OperatorTest:test_CancelOracleRequest_Success() (gas: 274465) OperatorTest:test_FulfillOracleRequest_Success() (gas: 330649) -OperatorTest:test_NotAuthorizedSender_Revert() (gas: 246764) -OperatorTest:test_OracleRequest_Success() (gas: 250043) -OperatorTest:test_SendRequestAndCancelRequest_Success(uint96) (runs: 257, μ: 387179, ~: 387183) -OperatorTest:test_SendRequest_Success(uint96) (runs: 257, μ: 303633, ~: 303636) \ No newline at end of file +OperatorTest:test_NotAuthorizedSender_Revert() (gas: 246781) +OperatorTest:test_OracleRequest_Success() (gas: 250043) \ No newline at end of file diff --git a/contracts/gas-snapshots/shared.gas-snapshot b/contracts/gas-snapshots/shared.gas-snapshot index 3f31180a7ba..53fa23695e1 100644 --- a/contracts/gas-snapshots/shared.gas-snapshot +++ b/contracts/gas-snapshots/shared.gas-snapshot @@ -25,9 +25,7 @@ BurnMintERC20constructor:test_Constructor_Success() (gas: 1694875) BurnMintERC20getCCIPAdmin:test_getCCIPAdmin_Success() (gas: 10525) BurnMintERC20getCCIPAdmin:test_setCCIPAdmin_Success() (gas: 21612) BurnMintERC20grantMintAndBurnRoles:test_GrantMintAndBurnRoles_Success() (gas: 79120) -BurnMintERC20mint:test_mint_MaxSupplyExceeded_Reverts() (gas: 50416) -BurnMintERC20mint:test_mint_SenderNotMinter_Reverts() (gas: 66337) -BurnMintERC20mint:test_mint_Success() (gas: 101870) +BurnMintERC20mint:test_mint() (gas: 101849) BurnMintERC20supportsInterface:test_SupportsInterface_Success() (gas: 11217) BurnMintERC20transfer:test_transfer_InvalidAddress_Reverts() (gas: 11301) BurnMintERC20transfer:test_transfer_Success() (gas: 42316) @@ -63,18 +61,16 @@ CallWithExactGas__callWithExactGas:test_CallWithExactGasSafeReturnDataExactGas() CallWithExactGas__callWithExactGas:test_NoContractReverts() (gas: 11559) CallWithExactGas__callWithExactGas:test_NoGasForCallExactCheckReverts() (gas: 15788) CallWithExactGas__callWithExactGas:test_NotEnoughGasForCallReverts() (gas: 16241) -CallWithExactGas__callWithExactGas:test_callWithExactGasSuccess(bytes,bytes4) (runs: 257, μ: 15744, ~: 15697) -CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractExactGasSuccess() (gas: 20116) -CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractReceiverErrorSuccess() (gas: 66439) -CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractSuccess(bytes,bytes4) (runs: 257, μ: 16254, ~: 16207) +CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractExactGasSuccess() (gas: 20073) +CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_CallWithExactGasEvenIfTargetIsNoContractReceiverErrorSuccess() (gas: 66461) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_NoContractSuccess() (gas: 12962) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_NoGasForCallExactCheckReturnFalseSuccess() (gas: 13005) CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract:test_NotEnoughGasForCallReturnsFalseSuccess() (gas: 13317) CallWithExactGas__callWithExactGasSafeReturnData:test_CallWithExactGasSafeReturnDataExactGas() (gas: 20331) CallWithExactGas__callWithExactGasSafeReturnData:test_NoContractReverts() (gas: 13939) CallWithExactGas__callWithExactGasSafeReturnData:test_NoGasForCallExactCheckReverts() (gas: 16139) -CallWithExactGas__callWithExactGasSafeReturnData:test_NotEnoughGasForCallReverts() (gas: 16569) -CallWithExactGas__callWithExactGasSafeReturnData:test_callWithExactGasSafeReturnData_ThrowOOGError_Revert() (gas: 36711) +CallWithExactGas__callWithExactGasSafeReturnData:test_NotEnoughGasForCallReverts() (gas: 16547) +CallWithExactGas__callWithExactGasSafeReturnData:test_callWithExactGasSafeReturnData_ThrowOOGError_Revert() (gas: 36755) EnumerableMapAddresses_at:testAtSuccess() (gas: 95086) EnumerableMapAddresses_at:testBytes32AtSuccess() (gas: 94855) EnumerableMapAddresses_at:testBytesAtSuccess() (gas: 96542) diff --git a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipReceive.t.sol b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipReceive.t.sol index 4df7e23b3d7..6233b9999d2 100644 --- a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipReceive.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.ccipReceive.t.sol @@ -12,7 +12,7 @@ contract EtherSenderReceiverTest_ccipReceive is EtherSenderReceiverTestSetup { error InvalidTokenAmounts(uint256 gotAmounts); error InvalidToken(address gotToken, address expectedToken); - function test_Fuzz_ccipReceive( + function testFuzz_ccipReceive( uint256 tokenAmount ) public { // cap to 10 ether because OWNER only has 10 ether. 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 a64ce7c2120..dea42f36098 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 @@ -13,7 +13,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { uint256 internal constant FEE_WEI = 121212; uint256 internal constant FEE_JUELS = 232323; - function test_Fuzz_ccipSend(uint256 feeFromRouter, uint256 feeSupplied) public { + function testFuzz_ccipSend(uint256 feeFromRouter, uint256 feeSupplied) public { // cap the fuzzer because OWNER only has a million ether. vm.assume(feeSupplied < 1_000_000 ether - AMOUNT); @@ -56,7 +56,7 @@ contract EtherSenderReceiverTest_ccipSend is EtherSenderReceiverTestSetup { } } - function test_Fuzz_ccipSend_feeToken(uint256 feeFromRouter, uint256 feeSupplied) public { + function testFuzz_ccipSend_feeToken(uint256 feeFromRouter, uint256 feeSupplied) public { // cap the fuzzer because OWNER only has a million LINK. vm.assume(feeSupplied < 1_000_000 ether - AMOUNT); diff --git a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validatedMessage.t.sol b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validatedMessage.t.sol index 91ccf2034d9..d6ececefd96 100644 --- a/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validatedMessage.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/EtherSenderReceiver/EtherSenderReceiverTest.validatedMessage.t.sol @@ -10,7 +10,7 @@ contract EtherSenderReceiverTest_validatedMessage is EtherSenderReceiverTestSetu error InvalidWethAddress(address want, address got); error GasLimitTooLow(uint256 minLimit, uint256 gotLimit); - function test_Fuzz_validatedMessage_msgSenderOverwrite( + function testFuzz_validatedMessage_msgSenderOverwrite( bytes memory data ) public view { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); @@ -35,7 +35,7 @@ contract EtherSenderReceiverTest_validatedMessage is EtherSenderReceiverTestSetu assertEq(validatedMessage.extraArgs, bytes(""), "extraArgs must be empty"); } - function test_Fuzz_validatedMessage_tokenAddressOverwrite( + function testFuzz_validatedMessage_tokenAddressOverwrite( address token ) public view { Client.EVMTokenAmount[] memory tokenAmounts = new Client.EVMTokenAmount[](1); diff --git a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpart.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpart.t.sol index 365ccf33e71..8db2e75c5d7 100644 --- a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpart.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpart.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {PingPongDappSetup} from "./PingPongDappSetup.t.sol"; contract PingPong_setCounterpart is PingPongDappSetup { - function test_Fuzz_CounterPartAddress_Success(uint64 chainSelector, address counterpartAddress) public { + function testFuzz_CounterPartAddress_Success(uint64 chainSelector, address counterpartAddress) public { s_pingPong.setCounterpartChainSelector(chainSelector); s_pingPong.setCounterpart(chainSelector, counterpartAddress); diff --git a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartAddress.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartAddress.t.sol index 6762d8aab85..0e5587dac5f 100644 --- a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartAddress.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartAddress.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {PingPongDappSetup} from "./PingPongDappSetup.t.sol"; contract PingPong_setCounterpartAddress is PingPongDappSetup { - function test_Fuzz_CounterPartAddress_Success( + function testFuzz_CounterPartAddress_Success( address counterpartAddress ) public { s_pingPong.setCounterpartAddress(counterpartAddress); diff --git a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartChainSelector.t.sol b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartChainSelector.t.sol index a6fea957753..a7d148089bc 100644 --- a/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartChainSelector.t.sol +++ b/contracts/src/v0.8/ccip/test/applications/PingPong/PingPong.setCounterpartChainSelector.t.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {PingPongDappSetup} from "./PingPongDappSetup.t.sol"; contract PingPong_setCounterpartChainSelector is PingPongDappSetup { - function test_Fuzz_CounterPartChainSelector_Success( + function testFuzz_CounterPartChainSelector_Success( uint64 chainSelector ) public { s_pingPong.setCounterpartChainSelector(chainSelector); 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 44fe0e33eba..b663151a96c 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 @@ -6,7 +6,7 @@ import {Internal} from "../../libraries/Internal.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_applyDestChainConfigUpdates is FeeQuoterSetup { - function test_Fuzz_applyDestChainConfigUpdates_Success( + function testFuzz_applyDestChainConfigUpdates_Success( FeeQuoter.DestChainConfigArgs memory destChainConfigArgs ) public { vm.assume(destChainConfigArgs.destChainSelector != 0); 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 d31202e8a99..67b1ed9ae92 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 @@ -6,7 +6,7 @@ import {FeeQuoter} from "../../FeeQuoter.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_applyPremiumMultiplierWeiPerEthUpdates is FeeQuoterSetup { - function test_Fuzz_applyPremiumMultiplierWeiPerEthUpdates_Success( + function testFuzz_applyPremiumMultiplierWeiPerEthUpdates_Success( FeeQuoter.PremiumMultiplierWeiPerEthArgs memory premiumMultiplierWeiPerEthArg ) public { FeeQuoter.PremiumMultiplierWeiPerEthArgs[] memory premiumMultiplierWeiPerEthArgs = 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 72ef7b89a75..711374a2441 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 @@ -7,7 +7,7 @@ import {Pool} from "../../libraries/Pool.sol"; import {FeeQuoterSetup} from "./FeeQuoterSetup.t.sol"; contract FeeQuoter_applyTokenTransferFeeConfigUpdates is FeeQuoterSetup { - function test_Fuzz_ApplyTokenTransferFeeConfig_Success( + function testFuzz_ApplyTokenTransferFeeConfig_Success( FeeQuoter.TokenTransferFeeConfig[2] memory tokenTransferFeeConfigs ) public { // To prevent Invalid Fee Range error from the fuzzer, bound the results to a valid range that 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 ca6a7e16126..33e941cfbe3 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 @@ -15,7 +15,7 @@ contract FeeQuoter_convertTokenAmount is FeeQuoterSetup { assertEq(s_feeQuoter.convertTokenAmount(s_weth, amount, s_sourceTokens[0]), expected); } - function test_Fuzz_ConvertTokenAmount_Success( + function testFuzz_ConvertTokenAmount_Success( uint256 feeTokenAmount, uint224 usdPerFeeToken, uint160 usdPerLinkToken, 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 2e498746c3d..6f2566ac754 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 @@ -64,7 +64,7 @@ contract FeeQuoter_getDataAvailabilityCost is FeeQuoterSetup { assertEq(dataAvailabilityCostUSD, 0); } - function test_Fuzz_ZeroDataAvailabilityGasPriceAlwaysCalculatesZeroDataAvailabilityCost_Success( + function testFuzz_ZeroDataAvailabilityGasPriceAlwaysCalculatesZeroDataAvailabilityCost_Success( uint64 messageDataLength, uint32 numberOfTokens, uint32 tokenTransferBytesOverhead @@ -76,7 +76,7 @@ contract FeeQuoter_getDataAvailabilityCost is FeeQuoterSetup { assertEq(0, dataAvailabilityCostUSD); } - function test_Fuzz_CalculateDataAvailabilityCost_Success( + function testFuzz_CalculateDataAvailabilityCost_Success( uint64 destChainSelector, uint32 destDataAvailabilityOverheadGas, uint16 destGasPerDataAvailabilityByte, 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 a426775ca63..9f0aa9440b8 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 @@ -158,7 +158,7 @@ contract FeeQuoter_getTokenTransferCost is FeeQuoterFeeSetup { assertEq(Pool.CCIP_LOCK_OR_BURN_V1_RET_BYTES, destBytesOverhead); } - function test_Fuzz_TokenTransferFeeDuplicateTokens_Success(uint256 transfers, uint256 amount) public view { + function testFuzz_TokenTransferFeeDuplicateTokens_Success(uint256 transfers, uint256 amount) public view { // It shouldn't be possible to pay materially lower fees by splitting up the transfers. // Note it is possible to pay higher fees since the minimum fees are added. FeeQuoter.DestChainConfig memory destChainConfig = s_feeQuoter.getDestChainConfig(DEST_CHAIN_SELECTOR); 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 fdafde91f62..1f76f3120ae 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 @@ -171,7 +171,7 @@ contract FeeQuoter_getValidatedFee is FeeQuoterFeeSetup { } } - function test_Fuzz_EnforceOutOfOrder(bool enforce, bool allowOutOfOrderExecution) public { + function testFuzz_EnforceOutOfOrder(bool enforce, bool allowOutOfOrderExecution) public { // Update config to enforce allowOutOfOrderExecution = defaultVal. vm.stopPrank(); vm.startPrank(OWNER); 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 e7a9462c93b..4f03f3e6f55 100644 --- a/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol +++ b/contracts/src/v0.8/ccip/test/libraries/MerkleMultiProof.t.sol @@ -64,7 +64,7 @@ contract MerkleMultiProofTest is Test { assertEq(expectedRoot, root); } - function test_Fuzz_MerkleRoot2(bytes32 left, bytes32 right) public pure { + function testFuzz_MerkleRoot2(bytes32 left, bytes32 right) public pure { bytes32[] memory leaves = new bytes32[](2); leaves[0] = left; leaves[1] = right; @@ -91,7 +91,7 @@ contract MerkleMultiProofTest is Test { assertEq(root, expectedRoot); } - function test_Fuzz_MerkleMulti1of4(bytes32 leaf1, bytes32 proof1, bytes32 proof2) public pure { + function testFuzz_MerkleMulti1of4(bytes32 leaf1, bytes32 proof1, bytes32 proof2) public pure { bytes32[] memory leaves = new bytes32[](1); leaves[0] = leaf1; bytes32[] memory proofs = new bytes32[](2); @@ -106,7 +106,7 @@ contract MerkleMultiProofTest is Test { assertEq(MerkleMultiProof._merkleRoot(leaves, proofs, 0), result); } - function test_Fuzz_MerkleMulti2of4(bytes32 leaf1, bytes32 leaf2, bytes32 proof1, bytes32 proof2) public pure { + function testFuzz_MerkleMulti2of4(bytes32 leaf1, bytes32 leaf2, bytes32 proof1, bytes32 proof2) public pure { bytes32[] memory leaves = new bytes32[](2); leaves[0] = leaf1; leaves[1] = leaf2; @@ -124,7 +124,7 @@ contract MerkleMultiProofTest is Test { assertEq(MerkleMultiProof._merkleRoot(leaves, proofs, 4), finalResult); } - function test_Fuzz_MerkleMulti3of4(bytes32 leaf1, bytes32 leaf2, bytes32 leaf3, bytes32 proof) public pure { + function testFuzz_MerkleMulti3of4(bytes32 leaf1, bytes32 leaf2, bytes32 leaf3, bytes32 proof) public pure { bytes32[] memory leaves = new bytes32[](3); leaves[0] = leaf1; leaves[1] = leaf2; @@ -142,7 +142,7 @@ contract MerkleMultiProofTest is Test { assertEq(MerkleMultiProof._merkleRoot(leaves, proofs, 5), finalResult); } - function test_Fuzz_MerkleMulti4of4(bytes32 leaf1, bytes32 leaf2, bytes32 leaf3, bytes32 leaf4) public pure { + function testFuzz_MerkleMulti4of4(bytes32 leaf1, bytes32 leaf2, bytes32 leaf3, bytes32 leaf4) public pure { bytes32[] memory leaves = new bytes32[](4); leaves[0] = leaf1; leaves[1] = leaf2; 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 458767a4512..c70a8666654 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 @@ -256,7 +256,7 @@ contract MultiOCR3Base_setOCR3Configs is MultiOCR3BaseSetup { _assertOCRConfigUnconfigured(s_multiOCR3.latestConfigDetails(3)); } - function test_Fuzz_SetConfig_Success(MultiOCR3Base.OCRConfigArgs memory ocrConfig, uint64 randomAddressOffset) public { + function testFuzz_SetConfig_Success(MultiOCR3Base.OCRConfigArgs memory ocrConfig, uint64 randomAddressOffset) public { // condition: cannot assume max oracle count vm.assume(ocrConfig.transmitters.length <= 255); vm.assume(ocrConfig.signers.length <= 255); 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 3d619dfa116..c6d948a70c2 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 @@ -77,7 +77,7 @@ contract MultiOCR3Base_transmit is MultiOCR3BaseSetup { s_multiOCR3.transmitWithoutSignatures(reportContext, REPORT); } - function test_Fuzz_TransmitSignersWithSignatures_Success(uint8 F, uint64 randomAddressOffset) public { + function testFuzz_TransmitSignersWithSignatures_Success(uint8 F, uint64 randomAddressOffset) public { vm.pauseGasMetering(); F = uint8(bound(F, 1, 3)); 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 7ed5c22b800..84c522108ae 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 @@ -126,7 +126,7 @@ contract OffRamp_applySourceChainConfigUpdates is OffRampSetup { // Setting lower fuzz run as 256 runs was sometimes resulting in flakes. /// forge-config: default.fuzz.runs = 32 /// forge-config: ccip.fuzz.runs = 32 - function test_Fuzz_applySourceChainConfigUpdate_Success( + function testFuzz_applySourceChainConfigUpdate_Success( OffRamp.SourceChainConfigArgs memory sourceChainConfigArgs ) public { // Skip invalid inputs 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 e651ad3836a..4894cd2544c 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 @@ -374,7 +374,7 @@ contract OffRamp_executeSingleReport is OffRampSetup { assertEq(uint64(2), s_inboundNonceManager.getInboundNonce(SOURCE_CHAIN_SELECTOR_1, abi.encode(OWNER))); } - function test_Fuzz_InterleavingOrderedAndUnorderedMessages_Success( + function testFuzz_InterleavingOrderedAndUnorderedMessages_Success( bool[7] memory orderings ) public { Internal.Any2EVMRampMessage[] memory messages = new Internal.Any2EVMRampMessage[](orderings.length); 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 9b8e719053b..ac9cfe86cd9 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 @@ -10,7 +10,7 @@ contract OffRamp_getExecutionState is OffRampSetup { /// forge-config: default.fuzz.runs = 32 /// forge-config: ccip.fuzz.runs = 32 - function test_Fuzz_Differential_Success( + function testFuzz_Differential_Success( uint64 sourceChainSelector, uint16[500] memory seqNums, uint8[500] memory values 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 22f82bdf694..74594f7031d 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 @@ -224,7 +224,7 @@ contract OffRamp_releaseOrMintTokens is OffRampSetup { /// forge-config: default.fuzz.runs = 32 /// forge-config: ccip.fuzz.runs = 1024 // Uint256 gives a good range of values to test, both inside and outside of the eth address space. - function test_Fuzz__releaseOrMintTokens_AnyRevertIsCaught_Success( + function testFuzz__releaseOrMintTokens_AnyRevertIsCaught_Success( address destPool ) public { // Input 447301751254033913445893214690834296930546521452, which is 0x4E59B44847B379578588920CA78FBF26C0B4956C 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 2033e7a135f..46726b41c19 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 @@ -238,7 +238,7 @@ contract OnRamp_forwardFromRouter is OnRampSetup { // https://github.com/foundry-rs/foundry/issues/5689 /// forge-dynamicConfig: default.fuzz.runs = 32 /// forge-dynamicConfig: ccip.fuzz.runs = 32 - function test_Fuzz_ForwardFromRouter_Success(address originalSender, address receiver, uint96 feeTokenAmount) public { + function testFuzz_ForwardFromRouter_Success(address originalSender, address receiver, uint96 feeTokenAmount) public { // To avoid RouterMustSetOriginalSender vm.assume(originalSender != address(0)); vm.assume(uint160(receiver) >= Internal.PRECOMPILE_SPACE); 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 d4a297c103c..2af7242150a 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 @@ -31,7 +31,7 @@ contract OnRamp_withdrawFeeTokens is OnRampSetup { } } - function test_Fuzz_WithdrawFeeTokens_Success( + function testFuzz_WithdrawFeeTokens_Success( uint256[5] memory amounts ) public { vm.startPrank(OWNER); 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 667386ae7e0..7c87fbcc95d 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 @@ -8,7 +8,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {LockReleaseTokenPoolSetup} from "./LockReleaseTokenPoolSetup.t.sol"; contract LockReleaseTokenPool_lockOrBurn is LockReleaseTokenPoolSetup { - function test_Fuzz_LockOrBurnNoAllowList_Success( + function testFuzz_LockOrBurnNoAllowList_Success( uint256 amount ) public { amount = bound(amount, 1, _getOutboundRateLimiterConfig().capacity); 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 664d9526063..f402750eb19 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 @@ -7,7 +7,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {LockReleaseTokenPoolSetup} from "./LockReleaseTokenPoolSetup.t.sol"; contract LockReleaseTokenPool_provideLiquidity is LockReleaseTokenPoolSetup { - function test_Fuzz_ProvideLiquidity_Success( + function testFuzz_ProvideLiquidity_Success( uint256 amount ) public { uint256 balancePre = s_token.balanceOf(OWNER); @@ -28,7 +28,7 @@ contract LockReleaseTokenPool_provideLiquidity is LockReleaseTokenPoolSetup { s_lockReleaseTokenPool.provideLiquidity(1); } - function test_Fuzz_ExceedsAllowance( + function testFuzz_ExceedsAllowance( uint256 amount ) public { vm.assume(amount > 0); 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 06ccfc38065..b20b19fe973 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 @@ -49,7 +49,7 @@ contract LockReleaseTokenPool_releaseOrMint is LockReleaseTokenPoolSetup { ); } - function test_Fuzz_ReleaseOrMint_Success(address recipient, uint256 amount) public { + function testFuzz_ReleaseOrMint_Success(address recipient, uint256 amount) public { // Since the owner already has tokens this would break the checks vm.assume(recipient != OWNER); vm.assume(recipient != address(0)); 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 0a2b7b28b0f..29b6ef6c7f8 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 @@ -7,7 +7,7 @@ import {TokenPool} from "../../../pools/TokenPool.sol"; import {LockReleaseTokenPoolSetup} from "./LockReleaseTokenPoolSetup.t.sol"; contract LockReleaseTokenPool_withdrawalLiquidity is LockReleaseTokenPoolSetup { - function test_Fuzz_WithdrawalLiquidity_Success( + function testFuzz_WithdrawalLiquidity_Success( uint256 amount ) public { uint256 balancePre = s_token.balanceOf(OWNER); 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 bee2218a7ff..e44dc96f1a8 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 @@ -23,7 +23,7 @@ contract TokenPool_setChainRateLimiterConfig is TokenPoolSetup { s_tokenPool.applyChainUpdates(chainUpdates); } - function test_Fuzz_SetChainRateLimiterConfig_Success(uint128 capacity, uint128 rate, uint32 newTime) public { + function testFuzz_SetChainRateLimiterConfig_Success(uint128 capacity, uint128 rate, uint32 newTime) public { // Cap the lower bound to 4 so 4/2 is still >= 2 vm.assume(capacity >= 4); // Cap the lower bound to 2 so 2/2 is still >= 1 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 2ca33ad4f5f..9be60c97218 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 @@ -52,7 +52,7 @@ contract USDCTokenPool_lockOrBurn is USDCTokenPoolSetup { assertEq(s_mockUSDC.s_nonce() - 1, nonce); } - function test_Fuzz_LockOrBurn_Success(bytes32 destinationReceiver, uint256 amount) public { + function testFuzz_LockOrBurn_Success(bytes32 destinationReceiver, uint256 amount) public { vm.assume(destinationReceiver != bytes32(0)); amount = bound(amount, 1, _getOutboundRateLimiterConfig().capacity); s_token.transfer(address(s_usdcTokenPool), amount); @@ -93,7 +93,7 @@ contract USDCTokenPool_lockOrBurn is USDCTokenPoolSetup { assertEq(poolReturnDataV1.destTokenAddress, abi.encode(DEST_CHAIN_USDC_TOKEN)); } - function test_Fuzz_LockOrBurnWithAllowList_Success(bytes32 destinationReceiver, uint256 amount) public { + function testFuzz_LockOrBurnWithAllowList_Success(bytes32 destinationReceiver, uint256 amount) public { vm.assume(destinationReceiver != bytes32(0)); amount = bound(amount, 1, _getOutboundRateLimiterConfig().capacity); s_token.transfer(address(s_usdcTokenPoolWithAllowList), amount); 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 f4ffde6c82c..4499c748a6b 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 @@ -21,7 +21,7 @@ contract USDCTokenPool_releaseOrMint is USDCTokenPoolSetup { return abi.encodePacked(_version, _burnToken, _mintRecipient, _amount, _messageSender); } - function test_Fuzz_ReleaseOrMint_Success(address recipient, uint256 amount) public { + function testFuzz_ReleaseOrMint_Success(address recipient, uint256 amount) public { vm.assume(recipient != address(0) && recipient != address(s_token)); amount = bound(amount, 0, _getInboundRateLimiterConfig().capacity); 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 1fe5d828bdb..7fcb75fdf3f 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 @@ -11,7 +11,7 @@ contract USDCTokenPool_setDomains is USDCTokenPoolSetup { // Setting lower fuzz run as 256 runs was causing differing gas results in snapshot. /// forge-config: default.fuzz.runs = 32 /// forge-config: ccip.fuzz.runs = 32 - function test_Fuzz_SetDomains_Success( + function testFuzz_SetDomains_Success( bytes32[5] calldata allowedCallers, uint32[5] calldata domainIdentifiers, uint64[5] calldata destChainSelectors 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 c53fa6e81b9..975368c38b9 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 @@ -5,7 +5,7 @@ import {USDCTokenPool} from "../../../../pools/USDC/USDCTokenPool.sol"; import {USDCTokenPoolSetup} from "./USDCTokenPoolSetup.t.sol"; contract USDCTokenPool__validateMessage is USDCTokenPoolSetup { - function test_Fuzz_ValidateMessage_Success(uint32 sourceDomain, uint64 nonce) public { + function testFuzz_ValidateMessage_Success(uint32 sourceDomain, uint64 nonce) public { vm.pauseGasMetering(); USDCMessage memory usdcMessage = USDCMessage({ version: 0, 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 f877a4c6532..9b46741f96d 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 @@ -38,7 +38,7 @@ contract Router_applyRampUpdates is RouterSetup { ); } - function test_Fuzz_OffRampUpdates( + function testFuzz_OffRampUpdates( address[20] memory offRampsInput ) public { Router.OffRamp[] memory offRamps = new Router.OffRamp[](20); @@ -219,7 +219,7 @@ contract Router_applyRampUpdates is RouterSetup { } } - function test_Fuzz_OnRampUpdates( + function testFuzz_OnRampUpdates( Router.OnRamp[] memory onRamps ) public { // Test adding onRamps 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 823aa8d144e..a23d98e4eaa 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 @@ -4,7 +4,7 @@ pragma solidity 0.8.24; import {OnRampSetup} from "../../onRamp/OnRamp/OnRampSetup.t.sol"; contract Router_setWrappedNative is OnRampSetup { - function test_Fuzz_SetWrappedNative_Success( + function testFuzz_SetWrappedNative_Success( address wrappedNative ) public { s_sourceRouter.setWrappedNative(wrappedNative); 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 ab34fd3ab0a..6e16f27eca7 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 @@ -5,7 +5,7 @@ import {TokenAdminRegistry} from "../../../tokenAdminRegistry/TokenAdminRegistry import {TokenAdminRegistrySetup} from "./TokenAdminRegistrySetup.t.sol"; contract TokenAdminRegistry_getAllConfiguredTokens is TokenAdminRegistrySetup { - function test_Fuzz_getAllConfiguredTokens_Success( + function testFuzz_getAllConfiguredTokens_Success( uint8 numberOfTokens ) public { TokenAdminRegistry cleanTokenAdminRegistry = new TokenAdminRegistry(); 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 c1be3a27b13..6f3ac4449c6 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 @@ -69,7 +69,7 @@ contract TokenAdminRegistry_proposeAdministrator is TokenAdminRegistrySetup { mapping(address token => address admin) internal s_AdminByToken; - function test_Fuzz_proposeAdministrator_Success(address[50] memory tokens, address[50] memory admins) public { + function testFuzz_proposeAdministrator_Success(address[50] memory tokens, address[50] memory admins) public { TokenAdminRegistry cleanTokenAdminRegistry = new TokenAdminRegistry(); for (uint256 i = 0; i < tokens.length; i++) { if (admins[i] == address(0)) { diff --git a/contracts/src/v0.8/operatorforwarder/test/Forwarder.t.sol b/contracts/src/v0.8/operatorforwarder/test/Forwarder.t.sol index ba6ce1c17c1..cdc38080ae2 100644 --- a/contracts/src/v0.8/operatorforwarder/test/Forwarder.t.sol +++ b/contracts/src/v0.8/operatorforwarder/test/Forwarder.t.sol @@ -70,7 +70,7 @@ contract ForwarderTest is Deployer { require(returnedSenders[0] == senders[0]); } - function test_Forward_Success(uint256 _value) public { + function testFuzz_Forward_Success(uint256 _value) public { _addSenders(); vm.expectRevert("Not authorized sender"); @@ -98,7 +98,7 @@ contract ForwarderTest is Deployer { require(s_mockReceiver.getValue() == _value); } - function test_MultiForward_Success(uint256 _value1, uint256 _value2) public { + function testFuzz_MultiForward_Success(uint256 _value1, uint256 _value2) public { _addSenders(); address[] memory tos; diff --git a/contracts/src/v0.8/operatorforwarder/test/operator.t.sol b/contracts/src/v0.8/operatorforwarder/test/operator.t.sol index 6c4a7c2ae1a..870238b5e93 100644 --- a/contracts/src/v0.8/operatorforwarder/test/operator.t.sol +++ b/contracts/src/v0.8/operatorforwarder/test/operator.t.sol @@ -23,7 +23,7 @@ contract OperatorTest is Deployer { s_callback = new Callback(address(s_operator)); } - function test_SendRequest_Success(uint96 payment) public { + function testFuzz_SendRequest_Success(uint96 payment) public { vm.assume(payment > 0); deal(address(s_link), address(s_client), payment); // We're going to cancel one request and fulfill the other @@ -47,7 +47,7 @@ contract OperatorTest is Deployer { assertEq(s_link.balanceOf(address(s_client)), payment); } - function test_SendRequestAndCancelRequest_Success(uint96 payment) public { + function testFuzz_SendRequestAndCancelRequest_Success(uint96 payment) public { vm.assume(payment > 1); payment /= payment; diff --git a/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol b/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol index b432de58a5f..9d1a8e35ce5 100644 --- a/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol +++ b/contracts/src/v0.8/shared/test/call/CallWithExactGas.t.sol @@ -26,7 +26,7 @@ contract CallWithExactGasSetup is BaseTest { } contract CallWithExactGas__callWithExactGas is CallWithExactGasSetup { - function test_callWithExactGasSuccess(bytes memory payload, bytes4 funcSelector) public { + function testFuzz_callWithExactGasSuccess(bytes memory payload, bytes4 funcSelector) public { vm.pauseGasMetering(); bytes memory data = abi.encodeWithSelector(funcSelector, payload); @@ -220,7 +220,7 @@ contract CallWithExactGas__callWithExactGasSafeReturnData is CallWithExactGasSet assertGt(gasUsed, 500); } - function test_Fuzz_CallWithExactGasSafeReturnData_ConsumeAllGas_Success(uint8 gasLimitMultiplier) external { + function testFuzz_CallWithExactGasSafeReturnData_ConsumeAllGas_Success(uint8 gasLimitMultiplier) external { vm.assume(gasLimitMultiplier > 0); // Assume not zero to avoid zero gas being passed to s_gasConsumer uint16 maxRetBytes = 0; @@ -368,7 +368,7 @@ contract CallWithExactGas__callWithExactGasSafeReturnData is CallWithExactGasSet } contract CallWithExactGas__callWithExactGasEvenIfTargetIsNoContract is CallWithExactGasSetup { - function test_CallWithExactGasEvenIfTargetIsNoContractSuccess(bytes memory payload, bytes4 funcSelector) public { + function testFuzz_CallWithExactGasEvenIfTargetIsNoContractSuccess(bytes memory payload, bytes4 funcSelector) public { vm.pauseGasMetering(); bytes memory data = abi.encodeWithSelector(funcSelector, payload); vm.assume( diff --git a/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20/BurnMintERC20.mint.t.sol b/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20/BurnMintERC20.mint.t.sol index a0e46af5921..bdb3ff61505 100644 --- a/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20/BurnMintERC20.mint.t.sol +++ b/contracts/src/v0.8/shared/test/token/ERC20/BurnMintERC20/BurnMintERC20.mint.t.sol @@ -8,7 +8,7 @@ import {IERC20} from "../../../../../vendor/openzeppelin-solidity/v4.8.3/contrac import {Strings} from "../../../../../vendor/openzeppelin-solidity/v4.8.3/contracts/utils/Strings.sol"; contract BurnMintERC20mint is BurnMintERC20Setup { - function test_mint_Success() public { + function test_mint() public { uint256 balancePre = s_burnMintERC20.balanceOf(OWNER); s_burnMintERC20.grantMintAndBurnRoles(OWNER); @@ -23,7 +23,7 @@ contract BurnMintERC20mint is BurnMintERC20Setup { // Revert - function test_mint_SenderNotMinter_Reverts() public { + function test_mint_RevertWhen_SenderNotMinter() public { vm.startPrank(STRANGER); // OZ Access Control v4.8.3 inherited by BurnMintERC20 does not use custom errors, but the revert message is still useful @@ -40,7 +40,7 @@ contract BurnMintERC20mint is BurnMintERC20Setup { s_burnMintERC20.mint(STRANGER, 1e18); } - function test_mint_MaxSupplyExceeded_Reverts() public { + function test_mint_RevertWhen_MaxSupplyExceeded() public { changePrank(s_mockPool); // Mint max supply @@ -51,4 +51,11 @@ contract BurnMintERC20mint is BurnMintERC20Setup { // Attempt to mint 1 more than max supply s_burnMintERC20.mint(OWNER, 1); } + + function test_mint_RevertWhen_InvalidRecipient() public { + s_burnMintERC20.grantMintAndBurnRoles(OWNER); + + vm.expectRevert(abi.encodeWithSelector(BurnMintERC20.InvalidRecipient.selector, address(s_burnMintERC20))); + s_burnMintERC20.mint(address(s_burnMintERC20), 1e18); + } } diff --git a/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go b/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go index 6c8a5ee415d..150a51f93fb 100644 --- a/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go +++ b/core/capabilities/ccip/ccip_integration_tests/ccipreader/ccipreader_test.go @@ -18,6 +18,7 @@ import ( "golang.org/x/exp/maps" cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3" + "github.com/smartcontractkit/chainlink-common/pkg/codec" "github.com/smartcontractkit/chainlink-common/pkg/types" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" @@ -260,6 +261,13 @@ func TestCCIPReader_MsgsBetweenSeqNums(t *testing.T) { consts.EventAttributeSequenceNumber: {Name: "message.header.sequenceNumber"}, }, }, + OutputModifications: codec.ModifiersConfig{ + &codec.WrapperModifierConfig{Fields: map[string]string{ + "Message.FeeTokenAmount": "Int", + "Message.FeeValueJuels": "Int", + "Message.TokenAmounts.Amount": "Int", + }}, + }, }, }, }, @@ -282,7 +290,7 @@ func TestCCIPReader_MsgsBetweenSeqNums(t *testing.T) { FeeToken: utils.RandomAddress(), FeeTokenAmount: big.NewInt(1), FeeValueJuels: big.NewInt(2), - TokenAmounts: make([]ccip_reader_tester.InternalEVM2AnyTokenTransfer, 0), + TokenAmounts: []ccip_reader_tester.InternalEVM2AnyTokenTransfer{{Amount: big.NewInt(1)}, {Amount: big.NewInt(2)}}, }) assert.NoError(t, err) @@ -300,7 +308,7 @@ func TestCCIPReader_MsgsBetweenSeqNums(t *testing.T) { FeeToken: utils.RandomAddress(), FeeTokenAmount: big.NewInt(3), FeeValueJuels: big.NewInt(4), - TokenAmounts: make([]ccip_reader_tester.InternalEVM2AnyTokenTransfer, 0), + TokenAmounts: []ccip_reader_tester.InternalEVM2AnyTokenTransfer{{Amount: big.NewInt(3)}, {Amount: big.NewInt(4)}}, }) assert.NoError(t, err) @@ -329,10 +337,14 @@ func TestCCIPReader_MsgsBetweenSeqNums(t *testing.T) { require.Equal(t, cciptypes.SeqNum(10), msgs[0].Header.SequenceNumber) require.Equal(t, big.NewInt(1), msgs[0].FeeTokenAmount.Int) require.Equal(t, big.NewInt(2), msgs[0].FeeValueJuels.Int) + require.Equal(t, int64(1), msgs[0].TokenAmounts[0].Amount.Int64()) + require.Equal(t, int64(2), msgs[0].TokenAmounts[1].Amount.Int64()) require.Equal(t, cciptypes.SeqNum(15), msgs[1].Header.SequenceNumber) require.Equal(t, big.NewInt(3), msgs[1].FeeTokenAmount.Int) require.Equal(t, big.NewInt(4), msgs[1].FeeValueJuels.Int) + require.Equal(t, int64(3), msgs[1].TokenAmounts[0].Amount.Int64()) + require.Equal(t, int64(4), msgs[1].TokenAmounts[1].Amount.Int64()) for _, msg := range msgs { require.Equal(t, chainS1, msg.Header.SourceChainSelector) diff --git a/core/capabilities/ccip/configs/evm/contract_reader.go b/core/capabilities/ccip/configs/evm/contract_reader.go index 7cbc4a9fa8d..dc0f257c713 100644 --- a/core/capabilities/ccip/configs/evm/contract_reader.go +++ b/core/capabilities/ccip/configs/evm/contract_reader.go @@ -6,6 +6,7 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/smartcontractkit/chainlink-common/pkg/codec" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_home" "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/rmn_proxy_contract" @@ -228,6 +229,13 @@ var SourceReaderConfig = evmrelaytypes.ChainReaderConfig{ consts.EventAttributeSequenceNumber: {Name: "message.header.sequenceNumber"}, }, }, + OutputModifications: codec.ModifiersConfig{ + &codec.WrapperModifierConfig{Fields: map[string]string{ + "Message.FeeTokenAmount": "Int", + "Message.FeeValueJuels": "Int", + "Message.TokenAmounts.Amount": "Int", + }}, + }, }, consts.MethodNameOnRampGetStaticConfig: { ChainSpecificName: mustGetMethodName("getStaticConfig", onrampABI), diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 833bb2746cc..6de43b49e55 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -24,9 +24,9 @@ require ( github.com/prometheus/client_golang v1.20.5 github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.19.0 @@ -294,13 +294,13 @@ require ( github.com/shirou/gopsutil/v3 v3.24.3 // indirect github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 // indirect github.com/smartcontractkit/chain-selectors v1.0.27 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 37c01952857..3a7f6db8076 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1092,10 +1092,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 h1:BeLnOf2KKQpJj9nzfnE7QEg9ZqJ2jy/sbpNYVixVM2Y= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= @@ -1106,8 +1106,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeD github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= diff --git a/core/services/relay/evm/bindings/chain_config_factory.go b/core/services/relay/evm/bindings/chain_config_factory.go new file mode 100644 index 00000000000..4dfaffe80dc --- /dev/null +++ b/core/services/relay/evm/bindings/chain_config_factory.go @@ -0,0 +1,108 @@ +package bindings + +import ( + "github.com/ethereum/go-ethereum/common" + + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +func NewChainReaderConfig() types.ChainReaderConfig { + chainReaderConfig := types.ChainReaderConfig{ + Contracts: map[string]types.ChainContractReader{ + "ChainReaderTester": types.ChainContractReader{ + Configs: map[string]*types.ChainReaderDefinition{ + "GetAlterablePrimitiveValue": &types.ChainReaderDefinition{ + CacheEnabled: false, + ChainSpecificName: "getAlterablePrimitiveValue", + ReadType: 0, + }, "GetDifferentPrimitiveValue": &types.ChainReaderDefinition{ + CacheEnabled: false, + ChainSpecificName: "getDifferentPrimitiveValue", + ReadType: 0, + }, "GetElementAtIndex": &types.ChainReaderDefinition{ + CacheEnabled: false, + ChainSpecificName: "getElementAtIndex", + ReadType: 0, + }, "GetPrimitiveValue": &types.ChainReaderDefinition{ + CacheEnabled: false, + ChainSpecificName: "getPrimitiveValue", + ReadType: 0, + }, "GetSliceValue": &types.ChainReaderDefinition{ + CacheEnabled: false, + ChainSpecificName: "getSliceValue", + ReadType: 0, + }, "ReturnSeen": &types.ChainReaderDefinition{ + CacheEnabled: false, + ChainSpecificName: "returnSeen", + ReadType: 0, + }, + }, + ContractABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"StaticBytes\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"}],\"name\":\"Triggered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"fieldHash\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"TriggeredEventWithDynamicTopic\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"TriggeredWithFourTopics\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"field1\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint8[32]\",\"name\":\"field2\",\"type\":\"uint8[32]\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"field3\",\"type\":\"bytes32\"}],\"name\":\"TriggeredWithFourTopicsWithHashed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"}],\"name\":\"addTestStruct\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAlterablePrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDifferentPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"getElementAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"AccountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"NestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"NestedStaticStruct\",\"type\":\"tuple\"}],\"internalType\":\"struct TestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSliceValue\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"}],\"name\":\"returnSeen\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"AccountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"NestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"NestedStaticStruct\",\"type\":\"tuple\"}],\"internalType\":\"struct TestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"value\",\"type\":\"uint64\"}],\"name\":\"setAlterablePrimitiveValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"}],\"name\":\"triggerEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"triggerEventWithDynamicTopic\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"val1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"val2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"val3\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"val4\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"val5\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"val6\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"val7\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"raw\",\"type\":\"bytes\"}],\"name\":\"triggerStaticBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"triggerWithFourTopics\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"field1\",\"type\":\"string\"},{\"internalType\":\"uint8[32]\",\"name\":\"field2\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"field3\",\"type\":\"bytes32\"}],\"name\":\"triggerWithFourTopicsWithHashed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + ContractPollingFilter: types.ContractPollingFilter{ + PollingFilter: types.PollingFilter{ + LogsPerBlock: 0, + MaxLogsKept: 0, + Retention: 0, + }, + }, + }, + }, + } + return chainReaderConfig +} + +func NewChainWriterConfig(maxGasPrice assets.Wei, defaultGasPrice uint64, fromAddress common.Address) types.ChainWriterConfig { + chainWriterConfig := types.ChainWriterConfig{ + Contracts: map[string]*types.ContractConfig{ + "ChainReaderTester": &types.ContractConfig{ + Configs: map[string]*types.ChainWriterDefinition{ + "AddTestStruct": &types.ChainWriterDefinition{ + ChainSpecificName: "addTestStruct", + Checker: "simulate", + FromAddress: fromAddress, + GasLimit: 0, + }, "SetAlterablePrimitiveValue": &types.ChainWriterDefinition{ + ChainSpecificName: "setAlterablePrimitiveValue", + Checker: "simulate", + FromAddress: fromAddress, + GasLimit: 0, + }, "TriggerEvent": &types.ChainWriterDefinition{ + ChainSpecificName: "triggerEvent", + Checker: "simulate", + FromAddress: fromAddress, + GasLimit: 0, + }, "TriggerEventWithDynamicTopic": &types.ChainWriterDefinition{ + ChainSpecificName: "triggerEventWithDynamicTopic", + Checker: "simulate", + FromAddress: fromAddress, + GasLimit: 0, + }, "TriggerStaticBytes": &types.ChainWriterDefinition{ + ChainSpecificName: "triggerStaticBytes", + Checker: "simulate", + FromAddress: fromAddress, + GasLimit: 0, + }, "TriggerWithFourTopics": &types.ChainWriterDefinition{ + ChainSpecificName: "triggerWithFourTopics", + Checker: "simulate", + FromAddress: fromAddress, + GasLimit: 0, + }, "TriggerWithFourTopicsWithHashed": &types.ChainWriterDefinition{ + ChainSpecificName: "triggerWithFourTopicsWithHashed", + Checker: "simulate", + FromAddress: fromAddress, + GasLimit: 0, + }, + }, + ContractABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"StaticBytes\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"indexed\":false,\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"indexed\":false,\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"}],\"name\":\"Triggered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"fieldHash\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"TriggeredEventWithDynamicTopic\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"indexed\":true,\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"TriggeredWithFourTopics\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"string\",\"name\":\"field1\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint8[32]\",\"name\":\"field2\",\"type\":\"uint8[32]\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"field3\",\"type\":\"bytes32\"}],\"name\":\"TriggeredWithFourTopicsWithHashed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"}],\"name\":\"addTestStruct\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAlterablePrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getDifferentPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"i\",\"type\":\"uint256\"}],\"name\":\"getElementAtIndex\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"AccountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"NestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"NestedStaticStruct\",\"type\":\"tuple\"}],\"internalType\":\"struct TestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPrimitiveValue\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getSliceValue\",\"outputs\":[{\"internalType\":\"uint64[]\",\"name\":\"\",\"type\":\"uint64[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"}],\"name\":\"returnSeen\",\"outputs\":[{\"components\":[{\"internalType\":\"int32\",\"name\":\"Field\",\"type\":\"int32\"},{\"internalType\":\"string\",\"name\":\"DifferentField\",\"type\":\"string\"},{\"internalType\":\"uint8\",\"name\":\"OracleId\",\"type\":\"uint8\"},{\"internalType\":\"uint8[32]\",\"name\":\"OracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"AccountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"Accounts\",\"type\":\"address[]\"},{\"internalType\":\"int192\",\"name\":\"BigField\",\"type\":\"int192\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"NestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"NestedStaticStruct\",\"type\":\"tuple\"}],\"internalType\":\"struct TestStruct\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"value\",\"type\":\"uint64\"}],\"name\":\"setAlterablePrimitiveValue\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field\",\"type\":\"int32\"},{\"internalType\":\"uint8\",\"name\":\"oracleId\",\"type\":\"uint8\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"string\",\"name\":\"S\",\"type\":\"string\"}],\"internalType\":\"struct InnerDynamicTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelDynamicTestStruct\",\"name\":\"nestedDynamicStruct\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes2\",\"name\":\"FixedBytes\",\"type\":\"bytes2\"},{\"components\":[{\"internalType\":\"int64\",\"name\":\"IntVal\",\"type\":\"int64\"},{\"internalType\":\"address\",\"name\":\"A\",\"type\":\"address\"}],\"internalType\":\"struct InnerStaticTestStruct\",\"name\":\"Inner\",\"type\":\"tuple\"}],\"internalType\":\"struct MidLevelStaticTestStruct\",\"name\":\"nestedStaticStruct\",\"type\":\"tuple\"},{\"internalType\":\"uint8[32]\",\"name\":\"oracleIds\",\"type\":\"uint8[32]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"Account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"AccountStr\",\"type\":\"address\"}],\"internalType\":\"struct AccountStruct\",\"name\":\"accountStruct\",\"type\":\"tuple\"},{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"differentField\",\"type\":\"string\"},{\"internalType\":\"int192\",\"name\":\"bigField\",\"type\":\"int192\"}],\"name\":\"triggerEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"field\",\"type\":\"string\"}],\"name\":\"triggerEventWithDynamicTopic\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"val1\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"val2\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"val3\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"val4\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"val5\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"val6\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"val7\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"raw\",\"type\":\"bytes\"}],\"name\":\"triggerStaticBytes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int32\",\"name\":\"field1\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field2\",\"type\":\"int32\"},{\"internalType\":\"int32\",\"name\":\"field3\",\"type\":\"int32\"}],\"name\":\"triggerWithFourTopics\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"field1\",\"type\":\"string\"},{\"internalType\":\"uint8[32]\",\"name\":\"field2\",\"type\":\"uint8[32]\"},{\"internalType\":\"bytes32\",\"name\":\"field3\",\"type\":\"bytes32\"}],\"name\":\"triggerWithFourTopicsWithHashed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", + }, + }, + } + chainWriterConfig.MaxGasPrice = &maxGasPrice + for _, contract := range chainWriterConfig.Contracts { + for _, chainWriterDefinition := range contract.Configs { + chainWriterDefinition.GasLimit = defaultGasPrice + } + } + return chainWriterConfig +} diff --git a/core/services/relay/evm/bindings/chain_reader_tester.go b/core/services/relay/evm/bindings/chain_reader_tester.go new file mode 100644 index 00000000000..f15f1431679 --- /dev/null +++ b/core/services/relay/evm/bindings/chain_reader_tester.go @@ -0,0 +1,201 @@ +// Code generated evm-bindings; DO NOT EDIT. + +package bindings + +import ( + "context" + "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "math/big" +) + +// CodeDetails methods inputs and outputs structs +type ChainReaderTester struct { + BoundContract types.BoundContract + ContractReader types.ContractReader + ChainWriter types.ChainWriter +} + +type AccountStruct struct { + Account []byte + AccountStr []byte +} + +type AddTestStructInput struct { + Field int32 + DifferentField string + OracleId uint8 + OracleIds [32]uint8 + AccountStruct AccountStruct + Accounts [][]byte + BigField *big.Int + NestedDynamicStruct MidLevelDynamicTestStruct + NestedStaticStruct MidLevelStaticTestStruct +} + +type GetAlterablePrimitiveValueOutput struct { + Value uint64 +} + +type GetDifferentPrimitiveValueOutput struct { + Value uint64 +} + +type GetElementAtIndexInput struct { + I *big.Int +} + +type GetPrimitiveValueOutput struct { + Value uint64 +} + +type GetSliceValueOutput struct { + Value []uint64 +} + +type InnerDynamicTestStruct struct { + IntVal int64 + S string +} + +type InnerStaticTestStruct struct { + IntVal int64 + A []byte +} + +type MidLevelDynamicTestStruct struct { + FixedBytes [2]uint8 + Inner InnerDynamicTestStruct +} + +type MidLevelStaticTestStruct struct { + FixedBytes [2]uint8 + Inner InnerStaticTestStruct +} + +type ReturnSeenInput struct { + Field int32 + DifferentField string + OracleId uint8 + OracleIds [32]uint8 + AccountStruct AccountStruct + Accounts [][]byte + BigField *big.Int + NestedDynamicStruct MidLevelDynamicTestStruct + NestedStaticStruct MidLevelStaticTestStruct +} + +type SetAlterablePrimitiveValueInput struct { + Value uint64 +} + +type TestStruct struct { + Field int32 + DifferentField string + OracleId uint8 + OracleIds [32]uint8 + AccountStruct AccountStruct + Accounts [][]byte + BigField *big.Int + NestedDynamicStruct MidLevelDynamicTestStruct + NestedStaticStruct MidLevelStaticTestStruct +} + +type TriggerEventInput struct { + Field int32 + OracleId uint8 + NestedDynamicStruct MidLevelDynamicTestStruct + NestedStaticStruct MidLevelStaticTestStruct + OracleIds [32]uint8 + AccountStruct AccountStruct + Accounts [][]byte + DifferentField string + BigField *big.Int +} + +type TriggerEventWithDynamicTopicInput struct { + Field string +} + +type TriggerStaticBytesInput struct { + Val1 uint32 + Val2 uint32 + Val3 uint32 + Val4 uint64 + Val5 [32]uint8 + Val6 [32]uint8 + Val7 [32]uint8 + Raw []uint8 +} + +type TriggerWithFourTopicsInput struct { + Field1 int32 + Field2 int32 + Field3 int32 +} + +type TriggerWithFourTopicsWithHashedInput struct { + Field1 string + Field2 [32]uint8 + Field3 [32]uint8 +} + +func (b ChainReaderTester) GetPrimitiveValue(ctx context.Context, confidence primitives.ConfidenceLevel) (uint64, error) { + var output uint64 + err := b.ContractReader.GetLatestValue(ctx, b.BoundContract.ReadIdentifier("GetPrimitiveValue"), confidence, nil, &output) + return output, err +} + +func (b ChainReaderTester) GetSliceValue(ctx context.Context, confidence primitives.ConfidenceLevel) ([]uint64, error) { + var output []uint64 + err := b.ContractReader.GetLatestValue(ctx, b.BoundContract.ReadIdentifier("GetSliceValue"), confidence, nil, &output) + return output, err +} + +func (b ChainReaderTester) ReturnSeen(ctx context.Context, input ReturnSeenInput, confidence primitives.ConfidenceLevel) (TestStruct, error) { + output := TestStruct{} + err := b.ContractReader.GetLatestValue(ctx, b.BoundContract.ReadIdentifier("ReturnSeen"), confidence, input, &output) + return output, err +} + +func (b ChainReaderTester) TriggerEvent(ctx context.Context, input TriggerEventInput, txId string, toAddress string, meta *types.TxMeta) error { + return b.ChainWriter.SubmitTransaction(ctx, "ChainReaderTester", "TriggerEvent", input, txId, toAddress, meta, big.NewInt(0)) +} + +func (b ChainReaderTester) GetDifferentPrimitiveValue(ctx context.Context, confidence primitives.ConfidenceLevel) (uint64, error) { + var output uint64 + err := b.ContractReader.GetLatestValue(ctx, b.BoundContract.ReadIdentifier("GetDifferentPrimitiveValue"), confidence, nil, &output) + return output, err +} + +func (b ChainReaderTester) GetElementAtIndex(ctx context.Context, input GetElementAtIndexInput, confidence primitives.ConfidenceLevel) (TestStruct, error) { + output := TestStruct{} + err := b.ContractReader.GetLatestValue(ctx, b.BoundContract.ReadIdentifier("GetElementAtIndex"), confidence, input, &output) + return output, err +} + +func (b ChainReaderTester) SetAlterablePrimitiveValue(ctx context.Context, input SetAlterablePrimitiveValueInput, txId string, toAddress string, meta *types.TxMeta) error { + return b.ChainWriter.SubmitTransaction(ctx, "ChainReaderTester", "SetAlterablePrimitiveValue", input, txId, toAddress, meta, big.NewInt(0)) +} + +func (b ChainReaderTester) TriggerEventWithDynamicTopic(ctx context.Context, input TriggerEventWithDynamicTopicInput, txId string, toAddress string, meta *types.TxMeta) error { + return b.ChainWriter.SubmitTransaction(ctx, "ChainReaderTester", "TriggerEventWithDynamicTopic", input, txId, toAddress, meta, big.NewInt(0)) +} + +func (b ChainReaderTester) TriggerWithFourTopics(ctx context.Context, input TriggerWithFourTopicsInput, txId string, toAddress string, meta *types.TxMeta) error { + return b.ChainWriter.SubmitTransaction(ctx, "ChainReaderTester", "TriggerWithFourTopics", input, txId, toAddress, meta, big.NewInt(0)) +} + +func (b ChainReaderTester) TriggerWithFourTopicsWithHashed(ctx context.Context, input TriggerWithFourTopicsWithHashedInput, txId string, toAddress string, meta *types.TxMeta) error { + return b.ChainWriter.SubmitTransaction(ctx, "ChainReaderTester", "TriggerWithFourTopicsWithHashed", input, txId, toAddress, meta, big.NewInt(0)) +} + +func (b ChainReaderTester) AddTestStruct(ctx context.Context, input AddTestStructInput, txId string, toAddress string, meta *types.TxMeta) error { + return b.ChainWriter.SubmitTransaction(ctx, "ChainReaderTester", "AddTestStruct", input, txId, toAddress, meta, big.NewInt(0)) +} + +func (b ChainReaderTester) GetAlterablePrimitiveValue(ctx context.Context, confidence primitives.ConfidenceLevel) (uint64, error) { + var output uint64 + err := b.ContractReader.GetLatestValue(ctx, b.BoundContract.ReadIdentifier("GetAlterablePrimitiveValue"), confidence, nil, &output) + return output, err +} diff --git a/core/services/relay/evm/chain_components_test.go b/core/services/relay/evm/chain_components_test.go index b46b644e681..3efa50d1ec5 100644 --- a/core/services/relay/evm/chain_components_test.go +++ b/core/services/relay/evm/chain_components_test.go @@ -207,12 +207,12 @@ func TestContractReaderEventsInitValidation(t *testing.T) { func TestChainComponents(t *testing.T) { t.Parallel() it := &EVMChainComponentsInterfaceTester[*testing.T]{Helper: &helper{}} - - it.Helper.Init(t) + it.Init(t) // add new subtests here so that it can be run on real chains too RunChainComponentsEvmTests(t, it) RunChainComponentsInLoopEvmTests[*testing.T](t, commontestutils.WrapContractReaderTesterForLoop(it)) + RunChainComponentsInLoopEvmTests(t, WrapContractReaderTesterWithBindings(t, it)) } type helper struct { @@ -236,7 +236,6 @@ func (h *helper) Init(t *testing.T) { h.client = h.Client(t) h.txm = h.TXM(t, h.client) - h.Commit() } func (h *helper) SetupKeys(t *testing.T) { diff --git a/core/services/relay/evm/chain_writer_historical_wrapper_test.go b/core/services/relay/evm/chain_writer_historical_wrapper_test.go index c849d1f3d57..233d7bc2e2f 100644 --- a/core/services/relay/evm/chain_writer_historical_wrapper_test.go +++ b/core/services/relay/evm/chain_writer_historical_wrapper_test.go @@ -2,11 +2,13 @@ package evm import ( "context" + "math/big" commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" interfacetesttypes "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" - primitives "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/bindings" ) // This wrapper is required to enable the ChainReader to access historical data @@ -22,7 +24,8 @@ func NewChainWriterHistoricalWrapper(cw commontypes.ChainWriter, cwh *ClientWith } func (cwhw *ChainWriterHistoricalWrapper) SubmitTransaction(ctx context.Context, contractName, method string, args any, transactionID string, toAddress string, meta *commontypes.TxMeta, value *big.Int) error { - if primArgs, ok := args.(interfacetesttypes.PrimitiveArgs); ok { + alterablePrimitiveCall, newValue := cwhw.getPrimitiveValueIfPossible(args) + if alterablePrimitiveCall { callArgs := interfacetesttypes.ExpectedGetLatestValueArgs{ ContractName: contractName, ReadName: "GetAlterablePrimitiveValue", @@ -30,10 +33,25 @@ func (cwhw *ChainWriterHistoricalWrapper) SubmitTransaction(ctx context.Context, Params: nil, ReturnVal: nil, } - err := cwhw.cwh.SetUintLatestValue(ctx, primArgs.Value, callArgs) + err := cwhw.cwh.SetUintLatestValue(ctx, newValue, callArgs) if err != nil { return err } } return cwhw.ChainWriter.SubmitTransaction(ctx, contractName, method, args, transactionID, toAddress, meta, value) } + +func (cwhw *ChainWriterHistoricalWrapper) getPrimitiveValueIfPossible(args any) (bool, uint64) { + primitiveArgs, alterablePrimitiveCall := args.(interfacetesttypes.PrimitiveArgs) + var newValue uint64 + var alterablePrimitiveValue bindings.SetAlterablePrimitiveValueInput + if alterablePrimitiveCall { + newValue = primitiveArgs.Value + } else { + alterablePrimitiveValue, alterablePrimitiveCall = args.(bindings.SetAlterablePrimitiveValueInput) + if alterablePrimitiveCall { + newValue = alterablePrimitiveValue.Value + } + } + return alterablePrimitiveCall, newValue +} diff --git a/core/services/relay/evm/codec/codec_test.go b/core/services/relay/evm/codec/codec_test.go index d63ed5342c4..2da88abaac1 100644 --- a/core/services/relay/evm/codec/codec_test.go +++ b/core/services/relay/evm/codec/codec_test.go @@ -172,7 +172,9 @@ func TestCodec_EncodeTupleWithLists(t *testing.T) { require.Equal(t, expected, hexutil.Encode(result)[2:]) } -type codecInterfaceTester struct{} +type codecInterfaceTester struct { + TestSelectionSupport +} func (it *codecInterfaceTester) Setup(_ *testing.T) {} diff --git a/core/services/relay/evm/evmtesting/bindings_test_adapter.go b/core/services/relay/evm/evmtesting/bindings_test_adapter.go new file mode 100644 index 00000000000..3dd625266ad --- /dev/null +++ b/core/services/relay/evm/evmtesting/bindings_test_adapter.go @@ -0,0 +1,523 @@ +package evmtesting + +import ( + "context" + "errors" + "fmt" + "math/big" + "reflect" + "strings" + "testing" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/go-viper/mapstructure/v2" + + "github.com/smartcontractkit/chainlink-common/pkg/codec" + commontypes "github.com/smartcontractkit/chainlink-common/pkg/types" + "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" + "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" + "github.com/smartcontractkit/chainlink/v2/core/chains/evm/assets" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/bindings" + evmcodec "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/codec" + "github.com/smartcontractkit/chainlink/v2/core/services/relay/evm/types" +) + +const contractName = "ChainReaderTester" + +// Wraps EVMChainComponentsInterfaceTester to rely on the EVM bindings generated for CR/CW instead of going directly to CR/CW. This way we can reuse all existing tests. Transformation between expected +// contract names and read keys will be done here as well as invocation delegation to generated code. +func WrapContractReaderTesterWithBindings(t *testing.T, wrapped *EVMChainComponentsInterfaceTester[*testing.T]) interfacetests.ChainComponentsInterfaceTester[*testing.T] { + // Tests not yet supported by EVM bindings. + wrapped.DisableTests([]string{ + interfacetests.ContractReaderGetLatestValueAsValuesDotValue, interfacetests.ContractReaderGetLatestValueNoArgumentsAndPrimitiveReturnAsValuesDotValue, interfacetests.ContractReaderGetLatestValueNoArgumentsAndSliceReturnAsValueDotValue, + interfacetests.ContractReaderGetLatestValueGetsLatestForEvent, interfacetests.ContractReaderGetLatestValueBasedOnConfidenceLevelForEvent, + interfacetests.ContractReaderGetLatestValueReturnsNotFoundWhenNotTriggeredForEvent, interfacetests.ContractReaderGetLatestValueWithFilteringForEvent, interfacetests.ContractReaderBatchGetLatestValue, interfacetests.ContractReaderBatchGetLatestValueMultipleContractNamesSameFunction, + interfacetests.ContractReaderBatchGetLatestValueDifferentParamsResultsRetainOrder, interfacetests.ContractReaderBatchGetLatestValueDifferentParamsResultsRetainOrderMultipleContracts, interfacetests.ContractReaderBatchGetLatestValueNoArgumentsPrimitiveReturn, + interfacetests.ContractReaderBatchGetLatestValueSetsErrorsProperly, interfacetests.ContractReaderBatchGetLatestValueNoArgumentsWithSliceReturn, interfacetests.ContractReaderBatchGetLatestValueWithModifiersOwnMapstructureOverride, + interfacetests.ContractReaderQueryKeyNotFound, interfacetests.ContractReaderQueryKeyReturnsData, interfacetests.ContractReaderQueryKeyReturnsDataAsValuesDotValue, interfacetests.ContractReaderQueryKeyReturnsDataAsValuesDotValue, + interfacetests.ContractReaderQueryKeyCanFilterWithValueComparator, interfacetests.ContractReaderQueryKeyCanLimitResultsWithCursor, + ContractReaderQueryKeyFilterOnDataWordsWithValueComparator, ContractReaderQueryKeyOnDataWordsWithValueComparatorOnNestedField, + ContractReaderQueryKeyFilterOnDataWordsWithValueComparatorOnDynamicField, ContractReaderQueryKeyFilteringOnDataWordsUsingValueComparatorsOnFieldsWithManualIndex, + // TODO BCFR-1073 - Fix flaky tests + interfacetests.ContractReaderGetLatestValueBasedOnConfidenceLevel, + }) + wrapped.SetChainReaderConfigSupplier(func(t *testing.T) types.ChainReaderConfig { + return getChainReaderConfig(wrapped) + }) + wrapped.SetChainWriterConfigSupplier(func(t *testing.T) types.ChainWriterConfig { + return getChainWriterConfig(t, wrapped) + }) + return newBindingClientTester(wrapped) +} + +func newBindingClientTester(wrapped *EVMChainComponentsInterfaceTester[*testing.T]) bindingClientTester { + bindingsMapping := newBindingsMapping() + return bindingClientTester{ + ChainComponentsInterfaceTester: wrapped, + bindingsMapping: &bindingsMapping, + } +} + +func newBindingsMapping() bindingsMapping { + contractReaderProxy := bindingContractReaderProxy{} + chainWriterProxy := bindingChainWriterProxy{} + methodNameMappingByContract := make(map[string]map[string]string) + methodNameMappingByContract[interfacetests.AnyContractName] = map[string]string{ + interfacetests.MethodTakingLatestParamsReturningTestStruct: "GetElementAtIndex", + interfacetests.MethodReturningSeenStruct: "ReturnSeen", + interfacetests.MethodReturningAlterableUint64: "GetAlterablePrimitiveValue", + interfacetests.MethodReturningUint64: "GetPrimitiveValue", + interfacetests.MethodReturningUint64Slice: "getSliceValue", + interfacetests.MethodSettingStruct: "AddTestStruct", + interfacetests.MethodSettingUint64: "SetAlterablePrimitiveValue", + interfacetests.MethodTriggeringEvent: "TriggerEvent", + } + methodNameMappingByContract[interfacetests.AnySecondContractName] = map[string]string{ + interfacetests.MethodReturningUint64: "GetDifferentPrimitiveValue", + } + + bm := bindingsMapping{ + contractNameMapping: map[string]string{ + interfacetests.AnyContractName: contractName, + interfacetests.AnySecondContractName: contractName, + }, + methodNameMappingByContract: methodNameMappingByContract, + contractReaderProxy: &contractReaderProxy, + chainWriterProxy: &chainWriterProxy, + chainReaderTesters: map[string]*bindings.ChainReaderTester{}, + } + contractReaderProxy.bm = &bm + chainWriterProxy.bm = &bm + bm.createDelegates() + return bm +} + +func getChainReaderConfig(wrapped *EVMChainComponentsInterfaceTester[*testing.T]) types.ChainReaderConfig { + testStruct := interfacetests.CreateTestStruct[*testing.T](0, wrapped) + chainReaderConfig := bindings.NewChainReaderConfig() + chainReaderConfig.Contracts["ChainReaderTester"].Configs["ReturnSeen"] = &types.ChainReaderDefinition{ + CacheEnabled: false, + ChainSpecificName: "returnSeen", + ReadType: 0, + InputModifications: codec.ModifiersConfig{ + &codec.HardCodeModifierConfig{ + OnChainValues: map[string]any{ + "BigField": testStruct.BigField.String(), + "AccountStruct.Account": hexutil.Encode(testStruct.AccountStruct.Account), + }, + }, + }, + OutputModifications: codec.ModifiersConfig{ + &codec.HardCodeModifierConfig{OffChainValues: map[string]any{"ExtraField": interfacetests.AnyExtraValue}}, + }, + } + return chainReaderConfig +} + +func getChainWriterConfig(t *testing.T, wrapped *EVMChainComponentsInterfaceTester[*testing.T]) types.ChainWriterConfig { + return bindings.NewChainWriterConfig(*assets.NewWei(big.NewInt(1000000000000000000)), 2_000_000, wrapped.Helper.Accounts(t)[1].From) +} + +func (b bindingClientTester) Name() string { + return "generated bindings" +} + +type bindingClientTester struct { + interfacetests.ChainComponentsInterfaceTester[*testing.T] + bindingsMapping *bindingsMapping +} + +func (b bindingClientTester) GetContractReader(t *testing.T) commontypes.ContractReader { + contractReader := b.ChainComponentsInterfaceTester.GetContractReader(t) + if b.bindingsMapping.contractReaderProxy.ContractReader == nil { + b.bindingsMapping.contractReaderProxy.ContractReader = contractReader + b.addDefaultBindings(t) + for _, tester := range b.bindingsMapping.chainReaderTesters { + tester.ContractReader = contractReader + } + } + return b.bindingsMapping.contractReaderProxy +} + +func (b bindingClientTester) addDefaultBindings(t *testing.T) { + defaultBindings := b.ChainComponentsInterfaceTester.GetBindings(t) + for _, binding := range defaultBindings { + chainReaderTester := b.bindingsMapping.chainReaderTesters[binding.Address] + if chainReaderTester == nil { + chainReaderTester = &bindings.ChainReaderTester{ + BoundContract: binding, + ChainWriter: b.bindingsMapping.chainWriterProxy.ChainWriter, + } + b.bindingsMapping.chainReaderTesters[binding.Address] = chainReaderTester + } else { + chainReaderTester.ChainWriter = b.bindingsMapping.chainWriterProxy.ChainWriter + } + } +} + +func (b bindingClientTester) GetChainWriter(t *testing.T) commontypes.ChainWriter { + chainWriter := b.ChainComponentsInterfaceTester.GetChainWriter(t) + if b.bindingsMapping.chainWriterProxy.ChainWriter == nil { + b.addDefaultBindings(t) + for _, tester := range b.bindingsMapping.chainReaderTesters { + tester.ChainWriter = chainWriter + } + b.bindingsMapping.chainWriterProxy.ChainWriter = chainWriter + } + return b.bindingsMapping.chainWriterProxy +} + +type bindingsMapping struct { + contractNameMapping map[string]string + methodNameMappingByContract map[string]map[string]string + delegates map[string]*Delegate + chainReaderTesters map[string]*bindings.ChainReaderTester + contractReaderProxy *bindingContractReaderProxy + chainWriterProxy *bindingChainWriterProxy +} + +type bindingContractReaderProxy struct { + commontypes.ContractReader + bm *bindingsMapping +} + +type bindingChainWriterProxy struct { + commontypes.ChainWriter + bm *bindingsMapping +} + +func (b bindingContractReaderProxy) Bind(ctx context.Context, boundContracts []commontypes.BoundContract) error { + updatedBindings := b.bm.translateContractNames(boundContracts) + for _, updatedBinding := range updatedBindings { + b.bm.chainReaderTesters[updatedBinding.Address] = &bindings.ChainReaderTester{ + BoundContract: updatedBinding, + ContractReader: b.ContractReader, + ChainWriter: b.bm.chainWriterProxy.ChainWriter, + } + } + return b.ContractReader.Bind(ctx, updatedBindings) +} + +func (b bindingsMapping) translateContractNames(boundContracts []commontypes.BoundContract) []commontypes.BoundContract { + updatedBindings := make([]commontypes.BoundContract, 0, len(boundContracts)) + for _, boundContract := range boundContracts { + updatedBindings = append(updatedBindings, commontypes.BoundContract{ + Address: boundContract.Address, + Name: b.translateContractName(boundContract.Name), + }) + } + return updatedBindings +} + +func (b bindingContractReaderProxy) Close() error { + return b.ContractReader.Close() +} + +func (b bindingContractReaderProxy) GetLatestValue(ctx context.Context, readKey string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) error { + delegate, err := b.bm.getBindingDelegate(readKey) + if err != nil { + return err + } + output, err := delegate.apply(ctx, readKey, params, confidenceLevel) + if err != nil { + return err + } + if output == nil { + return nil + } + err = convertStruct(output, returnVal) + if err != nil { + return err + } + return nil +} + +func (b bindingChainWriterProxy) SubmitTransaction(ctx context.Context, contract, method string, args any, transactionID string, toAddress string, meta *commontypes.TxMeta, value *big.Int) error { + chainReaderTesters := b.bm.chainReaderTesters[toAddress] + switch contract { + case interfacetests.AnyContractName, interfacetests.AnySecondContractName: + switch method { + case interfacetests.MethodSettingStruct: + bindingsInput := bindings.AddTestStructInput{} + _ = convertStruct(args, &bindingsInput) + return chainReaderTesters.AddTestStruct(ctx, bindingsInput, transactionID, toAddress, meta) + case interfacetests.MethodSettingUint64: + bindingsInput := bindings.SetAlterablePrimitiveValueInput{} + _ = convertStruct(args, &bindingsInput) + return chainReaderTesters.SetAlterablePrimitiveValue(ctx, bindingsInput, transactionID, toAddress, meta) + case interfacetests.MethodTriggeringEvent: + bindingsInput := bindings.TriggerEventInput{} + _ = convertStruct(args, &bindingsInput) + return chainReaderTesters.TriggerEvent(ctx, bindingsInput, transactionID, toAddress, meta) + default: + return errors.New("No logic implemented for method: " + method) + } + default: + return errors.New("contract with id not supported " + contract) + } +} + +func (b *bindingChainWriterProxy) GetTransactionStatus(ctx context.Context, transactionID string) (commontypes.TransactionStatus, error) { + return b.ChainWriter.GetTransactionStatus(ctx, transactionID) +} + +func removeAddressFromReadIdentifier(s string) string { + index := strings.Index(s, "-") + if index == -1 { + return s + } + return s[index+1:] +} + +func (b *bindingsMapping) createDelegates() { + delegates := make(map[string]*Delegate) + boundContract := commontypes.BoundContract{Address: "", Name: contractName} + methodTakingLatestParamsKey := removeAddressFromReadIdentifier(boundContract.ReadIdentifier(b.methodNameMappingByContract[interfacetests.AnyContractName][interfacetests.MethodTakingLatestParamsReturningTestStruct])) + delegates[methodTakingLatestParamsKey] = b.createDelegateForMethodTakingLatestParams() + methodReturningAlterableUint64Key := removeAddressFromReadIdentifier(boundContract.ReadIdentifier(b.methodNameMappingByContract[interfacetests.AnyContractName][interfacetests.MethodReturningAlterableUint64])) + delegates[methodReturningAlterableUint64Key] = b.createDelegateForMethodReturningAlterableUint64() + methodReturningSeenStructKey := removeAddressFromReadIdentifier(boundContract.ReadIdentifier(b.methodNameMappingByContract[interfacetests.AnyContractName][interfacetests.MethodReturningSeenStruct])) + delegates[methodReturningSeenStructKey] = b.createDelegateForMethodReturningSeenStruct() + methodReturningUint64Key := removeAddressFromReadIdentifier(boundContract.ReadIdentifier(b.methodNameMappingByContract[interfacetests.AnyContractName][interfacetests.MethodReturningUint64])) + delegates[methodReturningUint64Key] = b.createDelegateForMethodReturningUint64() + methodReturningUint64SliceKey := removeAddressFromReadIdentifier(boundContract.ReadIdentifier(b.methodNameMappingByContract[interfacetests.AnyContractName][interfacetests.MethodReturningUint64Slice])) + delegates[methodReturningUint64SliceKey] = b.createDelegateForMethodReturningUint64Slice() + methodReturningDifferentUint64Key := removeAddressFromReadIdentifier(boundContract.ReadIdentifier(b.methodNameMappingByContract[interfacetests.AnySecondContractName][interfacetests.MethodReturningUint64])) + delegates[methodReturningDifferentUint64Key] = b.createDelegateForSecondContractMethodReturningUint64() + b.delegates = delegates +} + +func (b *bindingsMapping) createDelegateForMethodTakingLatestParams() *Delegate { + delegate := Delegate{inputType: reflect.TypeOf(bindings.GetElementAtIndexInput{})} + delegate.delegateFunc = func(ctx context.Context, readyKey string, input *any, level primitives.ConfidenceLevel) (any, error) { + methodInvocation := func(ctx context.Context, readKey string, input *bindings.GetElementAtIndexInput, level primitives.ConfidenceLevel) (any, error) { + chainReaderTester := b.GetChainReaderTester(readKey) + return chainReaderTester.GetElementAtIndex(ctx, *input, level) + } + return invokeSpecificMethod(ctx, b.translateReadKey(readyKey), (*input).(*bindings.GetElementAtIndexInput), level, methodInvocation) + } + return &delegate +} + +func (b *bindingsMapping) createDelegateForMethodReturningAlterableUint64() *Delegate { + delegate := Delegate{} + delegate.delegateFunc = func(ctx context.Context, readyKey string, input *any, level primitives.ConfidenceLevel) (any, error) { + methodInvocation := func(ctx context.Context, readKey string, input any, level primitives.ConfidenceLevel) (any, error) { + chainReaderTester := b.GetChainReaderTester(readKey) + return chainReaderTester.GetAlterablePrimitiveValue(ctx, level) + } + return invokeSpecificMethod(ctx, b.translateReadKey(readyKey), nil, level, methodInvocation) + } + return &delegate +} + +func (b *bindingsMapping) createDelegateForMethodReturningSeenStruct() *Delegate { + delegate := Delegate{inputType: reflect.TypeOf(bindings.ReturnSeenInput{})} + delegate.delegateFunc = func(ctx context.Context, readyKey string, input *any, level primitives.ConfidenceLevel) (any, error) { + methodInvocation := func(ctx context.Context, readKey string, input *bindings.ReturnSeenInput, level primitives.ConfidenceLevel) (any, error) { + chainReaderTester := b.GetChainReaderTester(readKey) + return chainReaderTester.ReturnSeen(ctx, *input, level) + } + return invokeSpecificMethod(ctx, b.translateReadKey(readyKey), (*input).(*bindings.ReturnSeenInput), level, methodInvocation) + } + return &delegate +} + +func (b *bindingsMapping) createDelegateForMethodReturningUint64() *Delegate { + delegate := Delegate{} + delegate.delegateFunc = func(ctx context.Context, readyKey string, input *any, level primitives.ConfidenceLevel) (any, error) { + methodInvocation := func(ctx context.Context, readKey string, input any, level primitives.ConfidenceLevel) (any, error) { + chainReaderTester := b.GetChainReaderTester(readKey) + return chainReaderTester.GetPrimitiveValue(ctx, level) + } + return invokeSpecificMethod(ctx, b.translateReadKey(readyKey), nil, level, methodInvocation) + } + return &delegate +} + +func (b *bindingsMapping) createDelegateForMethodReturningUint64Slice() *Delegate { + delegate := Delegate{} + delegate.delegateFunc = func(ctx context.Context, readyKey string, input *any, level primitives.ConfidenceLevel) (any, error) { + methodInvocation := func(ctx context.Context, readKey string, input any, level primitives.ConfidenceLevel) (any, error) { + chainReaderTester := b.GetChainReaderTester(readKey) + return chainReaderTester.GetSliceValue(ctx, level) + } + return invokeSpecificMethod(ctx, b.translateReadKey(readyKey), nil, level, methodInvocation) + } + return &delegate +} + +func (b *bindingsMapping) createDelegateForSecondContractMethodReturningUint64() *Delegate { + delegate := Delegate{} + delegate.delegateFunc = func(ctx context.Context, readyKey string, input *any, level primitives.ConfidenceLevel) (any, error) { + methodInvocation := func(ctx context.Context, readKey string, input any, level primitives.ConfidenceLevel) (any, error) { + chainReaderTester := b.GetChainReaderTester(readKey) + return chainReaderTester.GetDifferentPrimitiveValue(ctx, level) + } + return invokeSpecificMethod(ctx, b.translateReadKey(readyKey), nil, level, methodInvocation) + } + return &delegate +} + +// Transforms a readKey from ChainReader using the generic testing config to the actual config being used with go bindings which is the auto-generated from the solidity contract. +func (b bindingsMapping) translateReadKey(key string) string { + var updatedKey = key + parts := strings.Split(key, "-") + contractName := parts[1] + methodName := parts[2] + for testConfigName, bindingsName := range b.contractNameMapping { + if contractName == testConfigName { + updatedKey = strings.Replace(updatedKey, testConfigName, bindingsName, 1) + } + } + for testConfigName, bindingsName := range b.methodNameMappingByContract[contractName] { + if methodName == testConfigName { + updatedKey = strings.Replace(updatedKey, testConfigName, bindingsName, 1) + } + } + return updatedKey +} + +// Transforms a readKey from ChainReader using the generic testing config to the actual config being used with go bindings which is the auto-generated from the solidity contract. +func (b bindingsMapping) translateContractName(contractName string) string { + for testContractName, bindingsName := range b.contractNameMapping { + if contractName == testContractName { + return bindingsName + } + } + return contractName +} + +func invokeSpecificMethod[T any](ctx context.Context, readKey string, input T, level primitives.ConfidenceLevel, methodInvocation func(ctx context.Context, readKey string, input T, level primitives.ConfidenceLevel) (any, error)) (any, error) { + return methodInvocation(ctx, readKey, input, level) +} + +func (b bindingsMapping) getBindingDelegate(readKey string) (*Delegate, error) { + translatedKey := removeAddressFromReadIdentifier(b.translateReadKey(readKey)) + delegate := b.delegates[translatedKey] + + if delegate == nil { + return nil, fmt.Errorf("delegate not found for readerKey %s", translatedKey) + } + return delegate, nil +} + +func (b bindingsMapping) GetChainReaderTester(key string) *bindings.ChainReaderTester { + address := key[0:strings.Index(key, "-")] + return b.chainReaderTesters[address] +} + +type Delegate struct { + inputType reflect.Type + delegateFunc func(context.Context, string, *any, primitives.ConfidenceLevel) (any, error) +} + +func (d Delegate) getInput(input any) (*any, error) { + if input == nil { + return nil, nil + } + adaptedInput := reflect.New(d.inputType).Interface() + err := convertStruct(input, adaptedInput) + if err != nil { + return nil, err + } + return &adaptedInput, nil +} + +func (d Delegate) apply(ctx context.Context, readKey string, input any, confidenceLevel primitives.ConfidenceLevel) (any, error) { + adaptedInput, err := d.getInput(input) + if err != nil { + return nil, err + } + output, err := d.delegateFunc(ctx, readKey, adaptedInput, confidenceLevel) + if err != nil { + return nil, err + } + return output, nil +} + +// Utility function to converted original types from and to bindings expected types. +func convertStruct(src any, dst any) error { + if reflect.TypeOf(src).Kind() == reflect.Ptr && reflect.TypeOf(dst).Kind() == reflect.Ptr && reflect.TypeOf(src).Elem() == reflect.TypeOf(interfacetests.LatestParams{}) && reflect.TypeOf(dst).Elem() == reflect.TypeOf(bindings.GetElementAtIndexInput{}) { + value := src.(*interfacetests.LatestParams).I + dst.(*bindings.GetElementAtIndexInput).I = big.NewInt(int64(value)) + return nil + } + decoder, err := createDecoder(dst) + if err != nil { + return err + } + err = decoder.Decode(src) + if err != nil { + return err + } + switch { + case reflect.TypeOf(dst).Elem() == reflect.TypeOf(interfacetests.TestStructWithExtraField{}): + destTestStruct := dst.(*interfacetests.TestStructWithExtraField) + if destTestStruct != nil { + auxTestStruct := &interfacetests.TestStruct{} + decoder, _ := createDecoder(auxTestStruct) + _ = decoder.Decode(src) + destTestStruct.TestStruct = *auxTestStruct + sourceTestStruct := src.(bindings.TestStruct) + destTestStruct.BigField = sourceTestStruct.BigField + destTestStruct.NestedStaticStruct.Inner.I = int(sourceTestStruct.NestedStaticStruct.Inner.IntVal) + destTestStruct.NestedStaticStruct.FixedBytes = sourceTestStruct.NestedStaticStruct.FixedBytes + destTestStruct.NestedDynamicStruct.Inner.I = int(sourceTestStruct.NestedDynamicStruct.Inner.IntVal) + destTestStruct.NestedDynamicStruct.FixedBytes = sourceTestStruct.NestedDynamicStruct.FixedBytes + destTestStruct.ExtraField = interfacetests.AnyExtraValue + } + case reflect.TypeOf(dst).Elem() == reflect.TypeOf(interfacetests.TestStruct{}): + destTestStruct := dst.(*interfacetests.TestStruct) + if destTestStruct != nil { + sourceTestStruct := src.(bindings.TestStruct) + destTestStruct.BigField = sourceTestStruct.BigField + destTestStruct.NestedStaticStruct.Inner.I = int(sourceTestStruct.NestedStaticStruct.Inner.IntVal) + destTestStruct.NestedStaticStruct.FixedBytes = sourceTestStruct.NestedStaticStruct.FixedBytes + destTestStruct.NestedDynamicStruct.Inner.I = int(sourceTestStruct.NestedDynamicStruct.Inner.IntVal) + destTestStruct.NestedDynamicStruct.FixedBytes = sourceTestStruct.NestedDynamicStruct.FixedBytes + } + case reflect.TypeOf(src) == reflect.TypeOf(interfacetests.TestStruct{}) && reflect.TypeOf(dst) == reflect.TypeOf(&bindings.AddTestStructInput{}): + destTestStruct := dst.(*bindings.AddTestStructInput) + if destTestStruct != nil { + sourceTestStruct := src.(interfacetests.TestStruct) + destTestStruct.BigField = sourceTestStruct.BigField + destTestStruct.NestedStaticStruct.Inner.IntVal = int64(sourceTestStruct.NestedStaticStruct.Inner.I) + destTestStruct.NestedStaticStruct.FixedBytes = sourceTestStruct.NestedStaticStruct.FixedBytes + destTestStruct.NestedDynamicStruct.Inner.IntVal = int64(sourceTestStruct.NestedDynamicStruct.Inner.I) + destTestStruct.NestedDynamicStruct.FixedBytes = sourceTestStruct.NestedDynamicStruct.FixedBytes + } + case reflect.TypeOf(src) == reflect.TypeOf(interfacetests.TestStruct{}) && reflect.TypeOf(dst) == reflect.TypeOf(&bindings.ReturnSeenInput{}): + destTestStruct := dst.(*bindings.ReturnSeenInput) + if destTestStruct != nil { + sourceTestStruct := src.(interfacetests.TestStruct) + destTestStruct.BigField = sourceTestStruct.BigField + destTestStruct.NestedStaticStruct.Inner.IntVal = int64(sourceTestStruct.NestedStaticStruct.Inner.I) + destTestStruct.NestedStaticStruct.FixedBytes = sourceTestStruct.NestedStaticStruct.FixedBytes + destTestStruct.NestedDynamicStruct.Inner.IntVal = int64(sourceTestStruct.NestedDynamicStruct.Inner.I) + destTestStruct.NestedDynamicStruct.FixedBytes = sourceTestStruct.NestedDynamicStruct.FixedBytes + } + } + return err +} + +func createDecoder(dst any) (*mapstructure.Decoder, error) { + decoderConfig := &mapstructure.DecoderConfig{ + DecodeHook: mapstructure.ComposeDecodeHookFunc( + stringToByteArrayHook, + ), + Result: dst, + } + decoder, err := mapstructure.NewDecoder(decoderConfig) + return decoder, err +} + +func stringToByteArrayHook(from reflect.Type, to reflect.Type, data interface{}) (interface{}, error) { + if from.Kind() == reflect.String && to == reflect.TypeOf([]byte{}) { + return evmcodec.EVMAddressModifier{}.DecodeAddress(data.(string)) + } + if from == reflect.TypeOf([]byte{}) && to.Kind() == reflect.String { + return evmcodec.EVMAddressModifier{}.EncodeAddress(data.([]byte)) + } + return data, nil +} diff --git a/core/services/relay/evm/evmtesting/chain_components_interface_tester.go b/core/services/relay/evm/evmtesting/chain_components_interface_tester.go index c0d1754f6fd..9655fb78457 100644 --- a/core/services/relay/evm/evmtesting/chain_components_interface_tester.go +++ b/core/services/relay/evm/evmtesting/chain_components_interface_tester.go @@ -14,7 +14,7 @@ import ( "github.com/smartcontractkit/libocr/commontypes" "github.com/stretchr/testify/require" - commoncodec "github.com/smartcontractkit/chainlink-common/pkg/codec" + "github.com/smartcontractkit/chainlink-common/pkg/codec" clcommontypes "github.com/smartcontractkit/chainlink-common/pkg/types" . "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" //nolint common practice to import test mods with . "github.com/smartcontractkit/chainlink-common/pkg/types/query/primitives" @@ -60,20 +60,24 @@ type EVMChainComponentsInterfaceTesterHelper[T TestingT[T]] interface { } type EVMChainComponentsInterfaceTester[T TestingT[T]] struct { - Helper EVMChainComponentsInterfaceTesterHelper[T] - client client.Client - address string - address2 string - contractTesters map[string]*chain_reader_tester.ChainReaderTester - chainReaderConfig types.ChainReaderConfig - chainWriterConfig types.ChainWriterConfig - deployerAuth *bind.TransactOpts - senderAuth *bind.TransactOpts - cr evm.ChainReaderService - cw evm.ChainWriterService - dirtyContracts bool - txm evmtxmgr.TxManager - gasEstimator gas.EvmFeeEstimator + TestSelectionSupport + Helper EVMChainComponentsInterfaceTesterHelper[T] + client client.Client + address string + address2 string + contractTesters map[string]*chain_reader_tester.ChainReaderTester + chainReaderConfig types.ChainReaderConfig + chainWriterConfig types.ChainWriterConfig + deployerAuth *bind.TransactOpts + senderAuth *bind.TransactOpts + cr evm.ChainReaderService + cw evm.ChainWriterService + dirtyContracts bool + txm evmtxmgr.TxManager + gasEstimator gas.EvmFeeEstimator + chainReaderConfigSupplier func(t T) types.ChainReaderConfig + chainWriterConfigSupplier func(t T) types.ChainWriterConfig + dirtyConfig bool } func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { @@ -95,7 +99,7 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { }) // can re-use the same chain for tests, just make new contract for each test - if it.client != nil { + if it.client != nil && !it.dirtyConfig { it.deployNewContracts(t) return } @@ -106,20 +110,31 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { it.deployerAuth = accounts[0] it.senderAuth = accounts[1] + it.chainReaderConfig = it.chainReaderConfigSupplier(t) + it.GetContractReader(t) + + it.txm = it.Helper.TXM(t, it.client) + it.chainWriterConfig = it.chainWriterConfigSupplier(t) + + it.deployNewContracts(t) + it.dirtyConfig = false +} + +func (it *EVMChainComponentsInterfaceTester[T]) getChainReaderConfig(t T) types.ChainReaderConfig { testStruct := CreateTestStruct[T](0, it) methodTakingLatestParamsReturningTestStructConfig := types.ChainReaderDefinition{ ChainSpecificName: "getElementAtIndex", - OutputModifications: commoncodec.ModifiersConfig{ - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, - &commoncodec.AddressBytesToStringModifierConfig{ + OutputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + &codec.AddressBytesToStringModifierConfig{ Fields: []string{"AccountStruct.AccountStr"}, }, }, } - it.chainReaderConfig = types.ChainReaderConfig{ + return types.ChainReaderConfig{ Contracts: map[string]types.ChainContractReader{ AnyContractName: { ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, @@ -150,10 +165,10 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { "BigField": {Name: "bigField"}, }, }, - OutputModifications: commoncodec.ModifiersConfig{ - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, - &commoncodec.AddressBytesToStringModifierConfig{ + OutputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + &codec.AddressBytesToStringModifierConfig{ Fields: []string{"AccountStruct.AccountStr"}, }, }, @@ -174,8 +189,8 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { EventWithFilterName: { ChainSpecificName: "Triggered", ReadType: types.Event, - OutputModifications: commoncodec.ModifiersConfig{ - &commoncodec.AddressBytesToStringModifierConfig{ + OutputModifications: codec.ModifiersConfig{ + &codec.AddressBytesToStringModifierConfig{ Fields: []string{"AccountStruct.AccountStr"}, }, }, @@ -187,8 +202,8 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { // No specific reason for filter being defined here instead of on contract level, this is just for test case variety. PollingFilter: &types.PollingFilter{}, }, - InputModifications: commoncodec.ModifiersConfig{ - &commoncodec.RenameModifierConfig{Fields: map[string]string{"FieldHash": "Field"}}, + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"FieldHash": "Field"}}, }, }, triggerWithAllTopics: { @@ -209,24 +224,24 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { }, MethodReturningSeenStruct: { ChainSpecificName: "returnSeen", - InputModifications: commoncodec.ModifiersConfig{ - &commoncodec.HardCodeModifierConfig{ + InputModifications: codec.ModifiersConfig{ + &codec.HardCodeModifierConfig{ OnChainValues: map[string]any{ "BigField": testStruct.BigField.String(), "AccountStruct.Account": hexutil.Encode(testStruct.AccountStruct.Account), }, }, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, - &commoncodec.AddressBytesToStringModifierConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + &codec.AddressBytesToStringModifierConfig{ Fields: []string{"AccountStruct.AccountStr"}, }, }, - OutputModifications: commoncodec.ModifiersConfig{ - &commoncodec.HardCodeModifierConfig{OffChainValues: map[string]any{"ExtraField": AnyExtraValue}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, - &commoncodec.AddressBytesToStringModifierConfig{ + OutputModifications: codec.ModifiersConfig{ + &codec.HardCodeModifierConfig{OffChainValues: map[string]any{"ExtraField": AnyExtraValue}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + &codec.AddressBytesToStringModifierConfig{ Fields: []string{"AccountStruct.AccountStr"}, }, }, @@ -244,10 +259,10 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { }, }, } - it.GetContractReader(t) - it.txm = it.Helper.TXM(t, it.client) +} - it.chainWriterConfig = types.ChainWriterConfig{ +func (it *EVMChainComponentsInterfaceTester[T]) getChainWriterConfig(t T) types.ChainWriterConfig { + return types.ChainWriterConfig{ Contracts: map[string]*types.ContractConfig{ AnyContractName: { ContractABI: chain_reader_tester.ChainReaderTesterMetaData.ABI, @@ -257,9 +272,9 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { FromAddress: it.Helper.Accounts(t)[1].From, GasLimit: 2_000_000, Checker: "simulate", - InputModifications: commoncodec.ModifiersConfig{ - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, }, }, "setAlterablePrimitiveValue": { @@ -273,9 +288,9 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { FromAddress: it.Helper.Accounts(t)[1].From, GasLimit: 2_000_000, Checker: "simulate", - InputModifications: commoncodec.ModifiersConfig{ - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, }, }, "triggerEventWithDynamicTopic": { @@ -312,9 +327,9 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { FromAddress: it.Helper.Accounts(t)[1].From, GasLimit: 2_000_000, Checker: "simulate", - InputModifications: commoncodec.ModifiersConfig{ - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, - &commoncodec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, + InputModifications: codec.ModifiersConfig{ + &codec.RenameModifierConfig{Fields: map[string]string{"NestedDynamicStruct.Inner.IntVal": "I"}}, + &codec.RenameModifierConfig{Fields: map[string]string{"NestedStaticStruct.Inner.IntVal": "I"}}, }, }, }, @@ -322,7 +337,6 @@ func (it *EVMChainComponentsInterfaceTester[T]) Setup(t T) { }, MaxGasPrice: assets.NewWei(big.NewInt(1000000000000000000)), } - it.deployNewContracts(t) } func (it *EVMChainComponentsInterfaceTester[T]) Name() string { @@ -461,6 +475,22 @@ func (it *EVMChainComponentsInterfaceTester[T]) MaxWaitTimeForEvents() time.Dura return it.Helper.MaxWaitTimeForEvents() } +func (it *EVMChainComponentsInterfaceTester[T]) Init(t T) { + it.Helper.Init(t) + it.chainWriterConfigSupplier = func(t T) types.ChainWriterConfig { return it.getChainWriterConfig(t) } + it.chainReaderConfigSupplier = func(t T) types.ChainReaderConfig { return it.getChainReaderConfig(t) } +} + +func (it *EVMChainComponentsInterfaceTester[T]) SetChainReaderConfigSupplier(chainReaderConfigSupplier func(t T) types.ChainReaderConfig) { + it.dirtyConfig = true + it.chainReaderConfigSupplier = chainReaderConfigSupplier +} + +func (it *EVMChainComponentsInterfaceTester[T]) SetChainWriterConfigSupplier(chainWriterConfigSupplier func(t T) types.ChainWriterConfig) { + it.dirtyConfig = true + it.chainWriterConfigSupplier = chainWriterConfigSupplier +} + func OracleIDsToBytes(oracleIDs [32]commontypes.OracleID) [32]byte { convertedIDs := [32]byte{} for i, id := range oracleIDs { diff --git a/core/services/relay/evm/evmtesting/run_tests.go b/core/services/relay/evm/evmtesting/run_tests.go index 2efe1c3f08a..5f3cdbb2fd7 100644 --- a/core/services/relay/evm/evmtesting/run_tests.go +++ b/core/services/relay/evm/evmtesting/run_tests.go @@ -21,6 +21,17 @@ import ( . "github.com/smartcontractkit/chainlink-common/pkg/types/interfacetests" //nolint common practice to import test mods with . ) +const ( + ContractReaderQueryKeyFilterOnDataWordsWithValueComparator = "Filtering can be done on data words using value comparator" + ContractReaderQueryKeyOnDataWordsWithValueComparatorOnNestedField = "Filtering can be done on data words using value comparator on a nested field" + ContractReaderQueryKeyFilterOnDataWordsWithValueComparatorOnDynamicField = "Filtering can be done on data words using value comparator on field that follows a dynamic field" + ContractReaderQueryKeyFilteringOnDataWordsUsingValueComparatorsOnFieldsWithManualIndex = "Filtering can be done on data words using value comparators on fields that require manual index input" + ContractReaderDynamicTypedTopicsFilterAndCorrectReturn = "Dynamically typed topics can be used to filter and have type correct in return" + ContractReaderMultipleTopicCanFilterTogether = "Multiple topics can filter together" + ContractReaderFilteringCanBeDoneOnHashedIndexedTopics = "Filtering can be done on indexed topics that get hashed" + ContractReaderBindReturnsErrorOnMissingContractAtAddress = "Bind returns error on missing contract at address" +) + func RunChainComponentsEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T]) { RunContractReaderEvmTests[T](t, it) // Add ChainWriter tests here @@ -34,257 +45,295 @@ func RunChainComponentsInLoopEvmTests[T TestingT[T]](t T, it ChainComponentsInte func RunContractReaderEvmTests[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T]) { RunContractReaderInterfaceTests[T](t, it, false) - t.Run("Dynamically typed topics can be used to filter and have type correct in return", func(t T) { - it.Setup(t) - - anyString := "foo" - ctx := it.Helper.Context(t) - - cr := it.GetContractReader(t) - bindings := it.GetBindings(t) - require.NoError(t, cr.Bind(ctx, bindings)) - - type DynamicEvent struct { - Field string - } - SubmitTransactionToCW(t, it, "triggerEventWithDynamicTopic", DynamicEvent{Field: anyString}, bindings[0], types.Unconfirmed) - - input := struct{ Field string }{Field: anyString} - tp := cr.(clcommontypes.ContractTypeProvider) - - readName := types.BoundContract{ - Address: bindings[0].Address, - Name: AnyContractName, - }.ReadIdentifier(triggerWithDynamicTopic) - - output, err := tp.CreateContractType(readName, false) - require.NoError(t, err) - rOutput := reflect.Indirect(reflect.ValueOf(output)) - - require.Eventually(t, func() bool { - return cr.GetLatestValue(ctx, readName, primitives.Unconfirmed, input, output) == nil - }, it.MaxWaitTimeForEvents(), 100*time.Millisecond) - - assert.Equal(t, &anyString, rOutput.FieldByName("Field").Interface()) - topic, err := abi.MakeTopics([]any{anyString}) - require.NoError(t, err) - assert.Equal(t, &topic[0][0], rOutput.FieldByName("FieldHash").Interface()) - }) - - t.Run("Multiple topics can filter together", func(t T) { - it.Setup(t) - ctx := it.Helper.Context(t) - cr := it.GetContractReader(t) - bindings := it.GetBindings(t) - - require.NoError(t, cr.Bind(ctx, bindings)) - - triggerFourTopics(t, it, int32(1), int32(2), int32(3)) - triggerFourTopics(t, it, int32(2), int32(2), int32(3)) - triggerFourTopics(t, it, int32(1), int32(3), int32(3)) - triggerFourTopics(t, it, int32(1), int32(2), int32(4)) - - var bound types.BoundContract - for idx := range bindings { - if bindings[idx].Name == AnyContractName { - bound = bindings[idx] - } - } - - var latest struct{ Field1, Field2, Field3 int32 } - params := struct{ Field1, Field2, Field3 int32 }{Field1: 1, Field2: 2, Field3: 3} - - time.Sleep(it.MaxWaitTimeForEvents()) - - require.NoError(t, cr.GetLatestValue(ctx, bound.ReadIdentifier(triggerWithAllTopics), primitives.Unconfirmed, params, &latest)) - assert.Equal(t, int32(1), latest.Field1) - assert.Equal(t, int32(2), latest.Field2) - assert.Equal(t, int32(3), latest.Field3) - }) - - t.Run("Filtering can be done on indexed topics that get hashed", func(t T) { - it.Setup(t) - - cr := it.GetContractReader(t) - ctx := it.Helper.Context(t) - bindings := it.GetBindings(t) - - require.NoError(t, cr.Bind(ctx, bindings)) - - triggerFourTopicsWithHashed(t, it, "1", [32]uint8{2}, [32]byte{5}) - triggerFourTopicsWithHashed(t, it, "2", [32]uint8{2}, [32]byte{3}) - triggerFourTopicsWithHashed(t, it, "1", [32]uint8{3}, [32]byte{3}) - - var bound types.BoundContract - for idx := range bindings { - if bindings[idx].Name == AnyContractName { - bound = bindings[idx] - } - } - - var latest struct { - Field3 [32]byte - } - params := struct { - Field1 string - Field2 [32]uint8 - Field3 [32]byte - }{Field1: "1", Field2: [32]uint8{2}, Field3: [32]byte{5}} - - time.Sleep(it.MaxWaitTimeForEvents()) - require.NoError(t, cr.GetLatestValue(ctx, bound.ReadIdentifier(triggerWithAllTopicsWithHashed), primitives.Unconfirmed, params, &latest)) - // only checking Field3 topic makes sense since it isn't hashed, to check other fields we'd have to replicate solidity encoding and hashing - assert.Equal(t, [32]uint8{5}, latest.Field3) - }) - - t.Run("Bind returns error on missing contract at address", func(t T) { - it.Setup(t) - - addr := common.BigToAddress(big.NewInt(42)) - reader := it.GetContractReader(t) - - ctx := it.Helper.Context(t) - err := reader.Bind(ctx, []clcommontypes.BoundContract{{Name: AnyContractName, Address: addr.Hex()}}) - - require.ErrorIs(t, err, read.NoContractExistsError{Err: clcommontypes.ErrInternal, Address: addr}) - }) + testCases := []Testcase[T]{ + { + Name: ContractReaderDynamicTypedTopicsFilterAndCorrectReturn, + Test: func(t T) { + it.Setup(t) + + anyString := "foo" + ctx := it.Helper.Context(t) + + cr := it.GetContractReader(t) + bindings := it.GetBindings(t) + require.NoError(t, cr.Bind(ctx, bindings)) + + type DynamicEvent struct { + Field string + } + SubmitTransactionToCW(t, it, "triggerEventWithDynamicTopic", DynamicEvent{Field: anyString}, bindings[0], types.Unconfirmed) + + input := struct{ Field string }{Field: anyString} + tp := cr.(clcommontypes.ContractTypeProvider) + + readName := types.BoundContract{ + Address: bindings[0].Address, + Name: AnyContractName, + }.ReadIdentifier(triggerWithDynamicTopic) + + output, err := tp.CreateContractType(readName, false) + require.NoError(t, err) + rOutput := reflect.Indirect(reflect.ValueOf(output)) + + require.Eventually(t, func() bool { + return cr.GetLatestValue(ctx, readName, primitives.Unconfirmed, input, output) == nil + }, it.MaxWaitTimeForEvents(), 100*time.Millisecond) + + assert.Equal(t, &anyString, rOutput.FieldByName("Field").Interface()) + topic, err := abi.MakeTopics([]any{anyString}) + require.NoError(t, err) + assert.Equal(t, &topic[0][0], rOutput.FieldByName("FieldHash").Interface()) + }, + }, + { + Name: ContractReaderMultipleTopicCanFilterTogether, + Test: func(t T) { + it.Setup(t) + ctx := it.Helper.Context(t) + cr := it.GetContractReader(t) + bindings := it.GetBindings(t) + + require.NoError(t, cr.Bind(ctx, bindings)) + + triggerFourTopics(t, it, int32(1), int32(2), int32(3)) + triggerFourTopics(t, it, int32(2), int32(2), int32(3)) + triggerFourTopics(t, it, int32(1), int32(3), int32(3)) + triggerFourTopics(t, it, int32(1), int32(2), int32(4)) + + var bound types.BoundContract + for idx := range bindings { + if bindings[idx].Name == AnyContractName { + bound = bindings[idx] + } + } + + var latest struct{ Field1, Field2, Field3 int32 } + params := struct{ Field1, Field2, Field3 int32 }{Field1: 1, Field2: 2, Field3: 3} + + time.Sleep(it.MaxWaitTimeForEvents()) + + require.NoError(t, cr.GetLatestValue(ctx, bound.ReadIdentifier(triggerWithAllTopics), primitives.Unconfirmed, params, &latest)) + assert.Equal(t, int32(1), latest.Field1) + assert.Equal(t, int32(2), latest.Field2) + assert.Equal(t, int32(3), latest.Field3) + }, + }, + { + Name: ContractReaderFilteringCanBeDoneOnHashedIndexedTopics, + Test: func(t T) { + it.Setup(t) + + cr := it.GetContractReader(t) + ctx := it.Helper.Context(t) + bindings := it.GetBindings(t) + + require.NoError(t, cr.Bind(ctx, bindings)) + + triggerFourTopicsWithHashed(t, it, "1", [32]uint8{2}, [32]byte{5}) + triggerFourTopicsWithHashed(t, it, "2", [32]uint8{2}, [32]byte{3}) + triggerFourTopicsWithHashed(t, it, "1", [32]uint8{3}, [32]byte{3}) + + var bound types.BoundContract + for idx := range bindings { + if bindings[idx].Name == AnyContractName { + bound = bindings[idx] + } + } + + var latest struct { + Field3 [32]byte + } + params := struct { + Field1 string + Field2 [32]uint8 + Field3 [32]byte + }{Field1: "1", Field2: [32]uint8{2}, Field3: [32]byte{5}} + + time.Sleep(it.MaxWaitTimeForEvents()) + require.NoError(t, cr.GetLatestValue(ctx, bound.ReadIdentifier(triggerWithAllTopicsWithHashed), primitives.Unconfirmed, params, &latest)) + // only checking Field3 topic makes sense since it isn't hashed, to check other fields we'd have to replicate solidity encoding and hashing + assert.Equal(t, [32]uint8{5}, latest.Field3) + }, + }, + { + Name: ContractReaderBindReturnsErrorOnMissingContractAtAddress, + Test: func(t T) { + it.Setup(t) + + addr := common.BigToAddress(big.NewInt(42)) + reader := it.GetContractReader(t) + + ctx := it.Helper.Context(t) + err := reader.Bind(ctx, []clcommontypes.BoundContract{{Name: AnyContractName, Address: addr.Hex()}}) + + require.ErrorIs(t, err, read.NoContractExistsError{Err: clcommontypes.ErrInternal, Address: addr}) + }, + }, + } + RunTests(t, it, testCases) } func RunContractReaderInLoopTests[T TestingT[T]](t T, it ChainComponentsInterfaceTester[T]) { RunContractReaderInterfaceTests[T](t, it, false) - it.Setup(t) - ctx := tests.Context(t) - cr := it.GetContractReader(t) - require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) - bindings := it.GetBindings(t) - boundContract := BindingsByName(bindings, AnyContractName)[0] - require.NoError(t, cr.Bind(ctx, bindings)) - - ts1 := CreateTestStruct[T](0, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) - ts2 := CreateTestStruct[T](15, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) - ts3 := CreateTestStruct[T](35, it) - _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) - - t.Run("Filtering can be done on data words using value comparator", func(t T) { - ts := &TestStruct{} - assert.Eventually(t, func() bool { - sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: EventName, Expressions: []query.Expression{ - query.Comparator("OracleID", - primitives.ValueComparator{ - Value: uint8(ts2.OracleID), - Operator: primitives.Eq, - }), - }, - }, query.LimitAndSort{}, ts) - return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) - }, it.MaxWaitTimeForEvents(), time.Millisecond*10) - }) - - t.Run("Filtering can be done on data words using value comparator on a nested field", func(t T) { - ts := &TestStruct{} - assert.Eventually(t, func() bool { - sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: EventName, Expressions: []query.Expression{ - query.Comparator("OracleID", - primitives.ValueComparator{ - Value: uint8(ts2.OracleID), - Operator: primitives.Eq, - }), - query.Comparator("NestedStaticStruct.Inner.IntVal", - primitives.ValueComparator{ - Value: ts2.NestedStaticStruct.Inner.I, - Operator: primitives.Eq, - }), + testCases := []Testcase[T]{ + { + Name: ContractReaderQueryKeyFilterOnDataWordsWithValueComparator, + Test: func(t T) { + ctx := tests.Context(t) + cr := it.GetContractReader(t) + require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + bindings := it.GetBindings(t) + boundContract := BindingsByName(bindings, AnyContractName)[0] + require.NoError(t, cr.Bind(ctx, bindings)) + + ts1 := CreateTestStruct[T](0, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) + ts2 := CreateTestStruct[T](15, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) + ts3 := CreateTestStruct[T](35, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) + ts := &TestStruct{} + assert.Eventually(t, func() bool { + sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ + Key: EventName, Expressions: []query.Expression{ + query.Comparator("OracleID", + primitives.ValueComparator{ + Value: uint8(ts2.OracleID), + Operator: primitives.Eq, + }), + }, + }, query.LimitAndSort{}, ts) + return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) + }, it.MaxWaitTimeForEvents(), time.Millisecond*10) }, - }, query.LimitAndSort{}, ts) - return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) - }, it.MaxWaitTimeForEvents(), time.Millisecond*10) - }) - - t.Run("Filtering can be done on data words using value comparator on field that follows a dynamic field", func(t T) { - ts := &TestStruct{} - assert.Eventually(t, func() bool { - sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: EventName, Expressions: []query.Expression{ - query.Comparator("OracleID", - primitives.ValueComparator{ - Value: uint8(ts2.OracleID), - Operator: primitives.Eq, - }), - query.Comparator("BigField", - primitives.ValueComparator{ - Value: ts2.BigField, - Operator: primitives.Eq, - }), + }, + { + Name: ContractReaderQueryKeyOnDataWordsWithValueComparatorOnNestedField, + Test: func(t T) { + ctx := tests.Context(t) + cr := it.GetContractReader(t) + require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + bindings := it.GetBindings(t) + boundContract := BindingsByName(bindings, AnyContractName)[0] + require.NoError(t, cr.Bind(ctx, bindings)) + + ts1 := CreateTestStruct[T](0, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) + ts2 := CreateTestStruct[T](15, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) + ts3 := CreateTestStruct[T](35, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) + ts := &TestStruct{} + assert.Eventually(t, func() bool { + sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ + Key: EventName, Expressions: []query.Expression{ + query.Comparator("OracleID", + primitives.ValueComparator{ + Value: uint8(ts2.OracleID), + Operator: primitives.Eq, + }), + query.Comparator("NestedStaticStruct.Inner.IntVal", + primitives.ValueComparator{ + Value: ts2.NestedStaticStruct.Inner.I, + Operator: primitives.Eq, + }), + }, + }, query.LimitAndSort{}, ts) + return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) + }, it.MaxWaitTimeForEvents(), time.Millisecond*10) }, - }, query.LimitAndSort{}, ts) - return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) - }, it.MaxWaitTimeForEvents(), time.Millisecond*10) - }) - - t.Run("Filtering can be done on data words using value comparator on a static field in a dynamic struct that is the first dynamic field", func(t T) { - ts := &TestStruct{} - assert.Eventually(t, func() bool { - sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: EventName, Expressions: []query.Expression{ - query.Comparator("OracleID", - primitives.ValueComparator{ - Value: uint8(ts2.OracleID), - Operator: primitives.Eq, - }), - query.Comparator("NestedDynamicStruct.FixedBytes", - primitives.ValueComparator{ - Value: ts2.NestedDynamicStruct.FixedBytes, - Operator: primitives.Eq, - }), + }, + { + Name: ContractReaderQueryKeyFilterOnDataWordsWithValueComparatorOnDynamicField, + Test: func(t T) { + ctx := tests.Context(t) + cr := it.GetContractReader(t) + require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + bindings := it.GetBindings(t) + boundContract := BindingsByName(bindings, AnyContractName)[0] + require.NoError(t, cr.Bind(ctx, bindings)) + + ts1 := CreateTestStruct[T](0, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts1, boundContract, types.Unconfirmed) + ts2 := CreateTestStruct[T](15, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts2, boundContract, types.Unconfirmed) + ts3 := CreateTestStruct[T](35, it) + _ = SubmitTransactionToCW(t, it, MethodTriggeringEvent, ts3, boundContract, types.Unconfirmed) + ts := &TestStruct{} + assert.Eventually(t, func() bool { + sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ + Key: EventName, Expressions: []query.Expression{ + query.Comparator("OracleID", + primitives.ValueComparator{ + Value: uint8(ts2.OracleID), + Operator: primitives.Eq, + }), + query.Comparator("BigField", + primitives.ValueComparator{ + Value: ts2.BigField, + Operator: primitives.Eq, + }), + }, + }, query.LimitAndSort{}, ts) + return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) + }, it.MaxWaitTimeForEvents(), time.Millisecond*10) }, - }, query.LimitAndSort{}, ts) - return err == nil && len(sequences) == 1 && reflect.DeepEqual(&ts2, sequences[0].Data) - }, it.MaxWaitTimeForEvents(), time.Millisecond*10) - }) - - t.Run("Filtering can be done on data words using value comparators on fields that require manual index input", func(t T) { - empty12Bytes := [12]byte{} - val1, val2, val3, val4 := uint32(1), uint32(2), uint32(3), uint64(4) - val5, val6, val7 := [32]byte{}, [32]byte{6}, [32]byte{7} - copy(val5[:], append(empty12Bytes[:], 5)) - raw := []byte{9, 8} - - var buf []byte - buf = binary.BigEndian.AppendUint32(buf, val1) - buf = binary.BigEndian.AppendUint32(buf, val2) - buf = binary.BigEndian.AppendUint32(buf, val3) - buf = binary.BigEndian.AppendUint64(buf, val4) - dataWordOnChainValueToQuery := buf - - resExpected := append(buf, common.LeftPadBytes(val5[:], 32)...) - resExpected = append(resExpected, common.LeftPadBytes(val6[:], 32)...) - resExpected = append(resExpected, common.LeftPadBytes(val7[:], 32)...) - resExpected = append(resExpected, raw...) - - type eventResAsStruct struct { - Message *[]uint8 - } - wrapExpectedRes := eventResAsStruct{Message: &resExpected} - - // emit the one we want to search for and a couple of random ones to confirm that filtering works - triggerStaticBytes(t, it, val1, val2, val3, val4, val5, val6, val7, raw) - triggerStaticBytes(t, it, 1337, 7331, 4747, val4, val5, val6, val7, raw) - triggerStaticBytes(t, it, 7331, 4747, 1337, val4, val5, val6, val7, raw) - triggerStaticBytes(t, it, 4747, 1337, 7331, val4, val5, val6, val7, raw) - - assert.Eventually(t, func() bool { - sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{Key: staticBytesEventName, Expressions: []query.Expression{ - query.Comparator("msgTransmitterEvent", - primitives.ValueComparator{ - Value: dataWordOnChainValueToQuery, - Operator: primitives.Eq, - }), + }, + { + Name: ContractReaderQueryKeyFilteringOnDataWordsUsingValueComparatorsOnFieldsWithManualIndex, + Test: func(t T) { + ctx := tests.Context(t) + cr := it.GetContractReader(t) + require.NoError(t, cr.Bind(ctx, it.GetBindings(t))) + bindings := it.GetBindings(t) + boundContract := BindingsByName(bindings, AnyContractName)[0] + require.NoError(t, cr.Bind(ctx, bindings)) + empty12Bytes := [12]byte{} + val1, val2, val3, val4 := uint32(1), uint32(2), uint32(3), uint64(4) + val5, val6, val7 := [32]byte{}, [32]byte{6}, [32]byte{7} + copy(val5[:], append(empty12Bytes[:], 5)) + raw := []byte{9, 8} + + var resExpected []byte + resExpected = binary.BigEndian.AppendUint32(resExpected, val1) + resExpected = binary.BigEndian.AppendUint32(resExpected, val2) + resExpected = binary.BigEndian.AppendUint32(resExpected, val3) + resExpected = binary.BigEndian.AppendUint64(resExpected, val4) + dataWordOnChainValueToQuery := resExpected + + resExpected = append(resExpected, common.LeftPadBytes(val5[:], 32)...) + resExpected = append(resExpected, common.LeftPadBytes(val6[:], 32)...) + resExpected = append(resExpected, common.LeftPadBytes(val7[:], 32)...) + resExpected = append(resExpected, raw...) + + type eventResAsStruct struct { + Message *[]uint8 + } + wrapExpectedRes := eventResAsStruct{Message: &resExpected} + + // emit the one we want to search for and a couple of random ones to confirm that filtering works + triggerStaticBytes(t, it, val1, val2, val3, val4, val5, val6, val7, raw) + triggerStaticBytes(t, it, 1337, 7331, 4747, val4, val5, val6, val7, raw) + triggerStaticBytes(t, it, 7331, 4747, 1337, val4, val5, val6, val7, raw) + triggerStaticBytes(t, it, 4747, 1337, 7331, val4, val5, val6, val7, raw) + + assert.Eventually(t, func() bool { + sequences, err := cr.QueryKey(ctx, boundContract, query.KeyFilter{ + Key: staticBytesEventName, Expressions: []query.Expression{ + query.Comparator("msgTransmitterEvent", + primitives.ValueComparator{ + Value: dataWordOnChainValueToQuery, + Operator: primitives.Eq, + }), + }, + }, query.LimitAndSort{}, eventResAsStruct{}) + return err == nil && len(sequences) == 1 && reflect.DeepEqual(wrapExpectedRes, sequences[0].Data) + }, it.MaxWaitTimeForEvents(), time.Millisecond*10) }, - }, query.LimitAndSort{}, eventResAsStruct{}) - return err == nil && len(sequences) == 1 && reflect.DeepEqual(wrapExpectedRes, sequences[0].Data) - }, it.MaxWaitTimeForEvents(), time.Millisecond*10) - }) + }, + } + RunTests(t, it, testCases) } func triggerFourTopics[T TestingT[T]](t T, it *EVMChainComponentsInterfaceTester[T], i1, i2, i3 int32) { diff --git a/deployment/README.md b/deployment/README.md index fa6c87cf527..723397edc1c 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -5,6 +5,79 @@ dependencies. The environment abstractions allow for complex and critical deployment/configuration logic to be tested against ephemeral environments and then exposed for use in persistent environments like testnet/mainnet. +## Table of Contents +- [Address Book](##Address-Book) +- [View](##View) +- [Environment](##Environment) +- [Job Distributor](##Job-Distributor) +- [Changesets](##Changesets) +- [Directory Structure](##Directory-Structure) +- [Integration Testing](##Integration-Testing) +- [FAQ](##FAQ) + +## Address Book +An [address book](https://github.com/smartcontractkit/chainlink/blob/develop/deployment/address_book.go#L79) represents +a set of versioned, onchain addresses for a given product across all blockchain families. The primary key +is a family agnostic [chain-selector](https://github.com/smartcontractkit/chain-selectors) chain identifier combined with a unique +address within the chain. Anything which is globally addressable on the chain can be used for the address field, for example +EVM smart contract addresses, Aptos objectIDs/accounts, Solana programs/accounts etc. +The address book holds the minimum amount of information to derive the onchain state of the system from +the chains themselves as a source of truth. + +It is recommended that you define a State struct holding Go bindings for each onchain component and author a +translation layer between the address book and the state struct. Think of it like an expanded/wrapped address book +which enables read/writing to those objects. See an example [here](https://github.com/smartcontractkit/chainlink/blob/develop/deployment/ccip/state.go#L205). +This way, given an address book, you can easily read/write state or generate a [View](##View). +Note that for contract upgrades its expected that you would have versioned field names in the State struct until the v1 is fully removed, this +way you can easily test upgrades and support multiple versions of contracts. + +## View +A [view](https://github.com/smartcontractkit/chainlink/blob/develop/deployment/changeset.go#L35) is a function which +serializes the state of the system into a JSON object. This is useful for exporting to other systems (like a UI, docs, DS&A etc). +You can generate it however you see fit, but a straightforward way is to translate +the address book into a State structure and then serialize that using Go bindings. + +## Environment +An [environment](https://github.com/smartcontractkit/chainlink/blob/develop/deployment/environment.go#L71) represents +the existing state of the system including onchain (including non-EVMs) and offchain components. Conceptually it contains +a set of pointers and interfaces to dereference those pointers from the source of truth. +The onchain "pointers" are an address book of existing addresses and the Chains field holds +clients to read/write to those addresses. The offchain "pointers" are a set of nodeIDs and +the Offchain client (interface to the [job-distributor](##Job Distributor)) to read/write to them. + +## Job Distributor +The job distributor is a product agnostic in-house service for +managing jobs and CL nodes. It is required to use if you want to +manage your system through chainlink deployments. + +## Changsets +A [changeset](https://github.com/smartcontractkit/chainlink/blob/develop/deployment/changeset.go#L21) is a +Go function which describes a set of changes to be applied to an environment given some configuration: +```go +type ChangeSet func(e Environment, config interface{}) (ChangesetOutput, error) +``` +For example, changesets might include: +- Deploying a new contract +- Deploying 2 contracts where the second contract depends on the first's address +- Deploying a contract and creating a job spec where the job spec points to the deployed contract address +- Creating an MCMS proposal to set a billing parameter on a contract +- Deploying a full system from scratch + - Mainly useful for integration tests +- Modifying a contract not yet owned by MCMS via the deployer key + +Once sufficient changesets are built and tested, the ongoing maintenance +of a product should be just invoking existing changesets with new configuration. +The configuration can be environment/product specific, for example +specific chain addresses, chain selectors, data sources etc. The outputs are +a set of diff artifacts to be applied to the environment (MCMS proposals, job specs, addresses created). +You can use the changeset for side effects only and return no artifacts. +An example would be making an onchain change with the deployer key instead of an MCMS proposal, +however that should generally be uncommon. Usually we'd expect an initial deployment to produce +a set of addresses and job specs (likely pointing to those addresses) and then from that point forward +we'd expect to use MCMS proposals to make changes. + +TODO: Add various examples in deployment/example. + ## Directory structure /deployment @@ -27,51 +100,27 @@ and then exposed for use in persistent environments like testnet/mainnet. contracts (like MCMS, LinkToken etc) which can be shared by products. -/deployment/ccip -- package name `ccipdeployment` -- Files and tests per product deployment/configuration workflows -- Tests can use deployment/memory for fast integration testing -- TODO: System state representation is defined here, need to define - an interface to comply with for all products. - -/deployment/ccip/changeset -- package name `changeset` imported as `ccipchangesets` -- These function like scripts describing state transitions - you wish to apply to _persistent_ environments like testnet/mainnet -- They should be go functions where the first argument is an - environment and the second argument is a config struct which can be unique to the - changeset. The return value should be a `deployment.ChangesetOutput` and an error. - -- `do_something.go` - ```Go - func DoSomethingChangeSet(env deployment.Environment, c ccipdeployment.Config) (deployment.ChangesetOutput, error) - { - // Deploy contracts, generate MCMS proposals, generate - // job specs according to contracts etc. - return deployment.ChangesetOutput{}, nil - } - ``` - -- `do_something_test.go` - ```Go - func TestDoSomething(t *testing.T) - { - // Set up memory env - // DoSomethingChangeSet function - // Take the artifacts from ChangeSet output - // Apply them to the memory env - // Send traffic, run assertions etc. - } - ``` -- Changesets are exposed and applied via a different repo. - -/deployment/llo -- package name `llodeployment` -- Similar to /deploymet/ccip, these are product-specific deployment/configuration workflows -- Tests can use deployment/memory for fast integration testing - -/deployment/llo/changeset -- package name `changeset` imported as `llochangesets` -- Similar to deployment/ccip/changesets -- These function like scripts describing state transitions - you wish to apply to _persistent_ environments like testnet/mainnet +/deployment/ +- package name `deployment` +- Internal building blocks for changesets +- TODO: can we make this `internal`? + +/deployment//changeset +- Think of this as the public API for deployment and configuration +of your product. +- All the changesets should have an associated test using a memory or devenv +environment. +- package name `changeset` imported as `changeset` + +## Integration testing +Integration tests should live in the integration-tests/go.mod module and leverage +the deployment module for product deployment and configuration. The integration tests +should only depend on deployment//changeset and deployment/environment. + +## FAQ +### Should my changeset be idempotent? +It depends on the use case and is at your discretion. In many cases +it would be beneficial to make it idempotent so that if anything goes wrong +you can re-run it without side effects. However, it's possible that the onchain contract +design doesn't allow for idempotency so in that case you'd have to be prepared +with recovery changesets if something goes wrong as re-running it would not be an option. diff --git a/deployment/go.mod b/deployment/go.mod index af4223b410e..c9da65fd6c6 100644 --- a/deployment/go.mod +++ b/deployment/go.mod @@ -23,8 +23,8 @@ require ( github.com/sethvargo/go-retry v0.2.4 github.com/smartcontractkit/ccip-owner-contracts v0.0.0-20240926212305-a6deabdfce86 github.com/smartcontractkit/chain-selectors v1.0.27 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 @@ -405,7 +405,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 // indirect diff --git a/deployment/go.sum b/deployment/go.sum index 27a0e15dcd6..38bcb4b96a1 100644 --- a/deployment/go.sum +++ b/deployment/go.sum @@ -1382,10 +1382,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 h1:BeLnOf2KKQpJj9nzfnE7QEg9ZqJ2jy/sbpNYVixVM2Y= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= @@ -1396,8 +1396,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeD github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 h1:T0kbw07Vb6xUyA9MIJZfErMgWseWi1zf7cYvRpoq7ug= diff --git a/go.mod b/go.mod index 7e74074dbe2..c96444a4260 100644 --- a/go.mod +++ b/go.mod @@ -76,13 +76,13 @@ require ( github.com/shopspring/decimal v1.4.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e github.com/smartcontractkit/chainlink-feeds v0.1.1 github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de diff --git a/go.sum b/go.sum index 36be5a0d25d..c927d19fcfb 100644 --- a/go.sum +++ b/go.sum @@ -1076,10 +1076,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 h1:BeLnOf2KKQpJj9nzfnE7QEg9ZqJ2jy/sbpNYVixVM2Y= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= @@ -1088,8 +1088,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 h1:12ijqMM9tvYVEm+nR826WsrNi6zCKpwBhuApq127wHs= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index eb549e9b271..1d5211adfe4 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -36,8 +36,8 @@ require ( github.com/slack-go/slack v0.15.0 github.com/smartcontractkit/chain-selectors v1.0.27 github.com/smartcontractkit/chainlink-automation v0.8.1 - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 @@ -45,7 +45,7 @@ require ( github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 - github.com/smartcontractkit/chainlink/v2 v2.0.0-00010101000000-000000000000 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 github.com/spf13/cobra v1.8.1 github.com/stretchr/testify v1.9.0 @@ -418,7 +418,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20241009055228-33d0c0bf38de // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index ee39a38ebe8..682f4bd70f8 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1403,10 +1403,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 h1:BeLnOf2KKQpJj9nzfnE7QEg9ZqJ2jy/sbpNYVixVM2Y= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= @@ -1417,8 +1417,8 @@ github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0 h1:1xTm8UGeD github.com/smartcontractkit/chainlink-protos/job-distributor v0.4.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE= diff --git a/integration-tests/load/go.mod b/integration-tests/load/go.mod index 4f4f315082b..780b2daf4a6 100644 --- a/integration-tests/load/go.mod +++ b/integration-tests/load/go.mod @@ -17,13 +17,13 @@ require ( github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/slack-go/slack v0.15.0 - github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 + github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 github.com/smartcontractkit/chainlink-testing-framework/lib v1.50.13 github.com/smartcontractkit/chainlink-testing-framework/seth v1.50.5 github.com/smartcontractkit/chainlink-testing-framework/wasp v1.50.2 github.com/smartcontractkit/chainlink/deployment v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink/integration-tests v0.0.0-20241030133659-9ec788e78b4f - github.com/smartcontractkit/chainlink/v2 v2.9.0-beta0.0.20240216210048-da02459ddad8 + github.com/smartcontractkit/chainlink/v2 v2.14.0-mercury-20240807.0.20241106193309-5560cd76211a github.com/smartcontractkit/tdh2/go/tdh2 v0.0.0-20241009055228-33d0c0bf38de github.com/stretchr/testify v1.9.0 github.com/wiremock/go-wiremock v1.9.0 @@ -65,7 +65,7 @@ require ( github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 // indirect + github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b // indirect github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f // indirect github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 // indirect github.com/smartcontractkit/grpc-proxy v0.0.0-20240830132753-a7e17fec5ab7 // indirect @@ -425,7 +425,7 @@ require ( github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e // indirect github.com/smartcontractkit/chainlink-feeds v0.1.1 // indirect github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 // indirect - github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 // indirect + github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 // indirect github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12 // indirect diff --git a/integration-tests/load/go.sum b/integration-tests/load/go.sum index a201343efbf..3d849414c2c 100644 --- a/integration-tests/load/go.sum +++ b/integration-tests/load/go.sum @@ -1392,10 +1392,10 @@ github.com/smartcontractkit/chain-selectors v1.0.27 h1:VE/ftX9Aae4gnw67yR1raKi+3 github.com/smartcontractkit/chain-selectors v1.0.27/go.mod h1:d4Hi+E1zqjy9HqMkjBE5q1vcG9VGgxf5VxiRHfzi2kE= github.com/smartcontractkit/chainlink-automation v0.8.1 h1:sTc9LKpBvcKPc1JDYAmgBc2xpDKBco/Q4h4ydl6+UUU= github.com/smartcontractkit/chainlink-automation v0.8.1/go.mod h1:Iij36PvWZ6blrdC5A/nrQUBuf3MH3JvsBB9sSyc9W08= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94 h1:BeLnOf2KKQpJj9nzfnE7QEg9ZqJ2jy/sbpNYVixVM2Y= -github.com/smartcontractkit/chainlink-ccip v0.0.0-20241111114733-aa3b2f8e9f94/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9 h1:xjrbuLW28nJ661Hu9dodcCQm7ElB5AWnZjmqGiGLNZg= -github.com/smartcontractkit/chainlink-common v0.3.1-0.20241111184621-c61aebee0af9/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b h1:4kmZtaQ4fXwduHnw9xk5VmiIOW4nHg/Mx6iidlZJt5o= +github.com/smartcontractkit/chainlink-ccip v0.0.0-20241112095015-3e85d9f1898b/go.mod h1:4adKaHNaxFsRvV/lYfqtbsWyyvIPUMLR0FdOJN/ljis= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6 h1:yJNBWCdNL/X8+wEs3TGTBe9gssMmw5FTFxxrlo+0mVo= +github.com/smartcontractkit/chainlink-common v0.3.1-0.20241112140826-0e2daed34ef6/go.mod h1:ny87uTW6hLjCTLiBqBRNFEhETSXhHWevYlPclT5lSco= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f h1:BwrIaQIx5Iy6eT+DfLhFfK2XqjxRm74mVdlX8gbu4dw= github.com/smartcontractkit/chainlink-cosmos v0.5.2-0.20241017133723-5277829bd53f/go.mod h1:wHtwSR3F1CQSJJZDQKuqaqFYnvkT+kMyget7dl8Clvo= github.com/smartcontractkit/chainlink-data-streams v0.1.1-0.20241018134907-a00ba3729b5e h1:JiETqdNM0bktAUGMc62COwXIaw3rR3M77Me6bBLG0Fg= @@ -1404,8 +1404,8 @@ github.com/smartcontractkit/chainlink-feeds v0.1.1 h1:JzvUOM/OgGQA1sOqTXXl52R6An github.com/smartcontractkit/chainlink-feeds v0.1.1/go.mod h1:55EZ94HlKCfAsUiKUTNI7QlE/3d3IwTlsU3YNa/nBb4= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0 h1:PBUaFfPLm+Efq7H9kdfGBivH+QhJ6vB5EZTR/sCZsxI= github.com/smartcontractkit/chainlink-protos/orchestrator v0.3.0/go.mod h1:m/A3lqD7ms/RsQ9BT5P2uceYY0QX5mIt4KQxT2G6qEo= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6 h1:YsE0uS6S10oAWnFbjNDc7tN9JrWYjvyqMnTSbTSgl00= -github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241104202120-39cabce465f6/go.mod h1:iZugccCLpPWtcGiR/8gurre2j3RtyKnqd1FcVR0NzQw= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930 h1:blu++xbH/NSb+ii5hI4jczwojZ7Hc1ERXjpt/krYy9c= +github.com/smartcontractkit/chainlink-solana v1.1.1-0.20241112145241-efd6780f6930/go.mod h1:mGmRvlk54ufCufV4EBWizOGtXoXfePoFAuYEVC8EwdY= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8 h1:B4DFdk6MGcQnoCjjMBCx7Z+GWQpxRWJ4O8W/dVJyWGA= github.com/smartcontractkit/chainlink-starknet/relayer v0.1.1-0.20241017135645-176a23722fd8/go.mod h1:WkBqgBo+g34Gm5vWkDDl8Fh3Mzd7bF5hXp7rryg0t5o= github.com/smartcontractkit/chainlink-testing-framework/havoc v1.50.2 h1:GDGrC5OGiV0RyM1znYWehSQXyZQWTOzrEeJRYmysPCE=