Skip to content

Commit

Permalink
building integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yashnevatia committed Dec 6, 2024
1 parent 9c4d285 commit ff6bdff
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
6 changes: 5 additions & 1 deletion deployment/ccip/changeset/cs_deploy_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,11 @@ func deployChainContracts(
rmnRemoteContract.Address(),
)
return deployment.ContractDeploy[*rmn_proxy_contract.RMNProxyContract]{
rmnProxyAddr, rmnProxy, tx.Hash(), deployment.NewTypeAndVersion(ARMProxy, deployment.Version1_6_0_dev), err2,
Address: rmnProxyAddr,
Contract: rmnProxy,
TxHash: tx.Hash(),
Tv: deployment.NewTypeAndVersion(ARMProxy, deployment.Version1_6_0_dev),
Err: err2,
}
})
if err != nil {
Expand Down
29 changes: 18 additions & 11 deletions integration-tests/ccip-tests/contracts/contract_deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,11 @@ func (e *CCIPContractsDeployer) DeployTokenMessenger(tokenTransmitter common.Add
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
address, tx, contract, err := mock_usdc_token_messenger.DeployMockE2EUSDCTokenMessenger(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), 0, tokenTransmitter)
address, _, contract, err := mock_usdc_token_messenger.DeployMockE2EUSDCTokenMessenger(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), 0, tokenTransmitter)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, contract, err
return address, nil, contract, err
})

return address, err
Expand Down Expand Up @@ -167,11 +167,11 @@ func (e *CCIPContractsDeployer) DeployTokenTransmitter(domain uint32, usdcToken
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
address, tx, contract, err := mock_usdc_token_transmitter.DeployMockE2EUSDCTransmitter(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), 0, domain, usdcToken)
address, _, contract, err := mock_usdc_token_transmitter.DeployMockE2EUSDCTransmitter(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), 0, domain, usdcToken)
if err != nil {
return common.Address{}, nil, nil, err
}
return address, tx, contract, err
return address, nil, contract, err
})

if err != nil {
Expand Down Expand Up @@ -210,7 +210,8 @@ func (e *CCIPContractsDeployer) DeployBurnMintERC677(ownerMintingAmount *big.Int
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return burn_mint_erc677.DeployBurnMintERC677(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), "Test Token ERC677", "TERC677", 6, new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e9)))
address, _, instance, err := burn_mint_erc677.DeployBurnMintERC677(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), "Test Token ERC677", "TERC677", 6, new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e9)))
return address, nil, instance, err
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -449,7 +450,7 @@ func (e *CCIPContractsDeployer) DeployUSDCTokenPoolContract(tokenAddr string, to
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return usdc_token_pool.DeployUSDCTokenPool(
address, _, instance, err := usdc_token_pool.DeployUSDCTokenPool(
auth,
wrappers.MustNewWrappedContractBackend(e.evmClient, nil),
tokenMessenger,
Expand All @@ -458,6 +459,7 @@ func (e *CCIPContractsDeployer) DeployUSDCTokenPoolContract(tokenAddr string, to
rmnProxy,
router,
)
return address, nil, instance, err
})

if err != nil {
Expand Down Expand Up @@ -502,7 +504,7 @@ func (e *CCIPContractsDeployer) DeployLockReleaseTokenPoolContract(tokenAddr str
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return lock_release_token_pool.DeployLockReleaseTokenPool(
address, _, _, err := lock_release_token_pool.DeployLockReleaseTokenPool(
auth,
wrappers.MustNewWrappedContractBackend(e.evmClient, nil),
token,
Expand All @@ -512,6 +514,7 @@ func (e *CCIPContractsDeployer) DeployLockReleaseTokenPoolContract(tokenAddr str
true,
router,
)
return address, nil, nil, err
})

if err != nil {
Expand Down Expand Up @@ -690,7 +693,8 @@ func (e *CCIPContractsDeployer) DeployReceiverDapp(revert bool) (
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), revert)
address, _, _, err := maybe_revert_message_receiver.DeployMaybeRevertMessageReceiver(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), revert)
return address, nil, nil, err
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -730,7 +734,8 @@ func (e *CCIPContractsDeployer) DeployRouter(wrappedNative common.Address, armAd
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return router.DeployRouter(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), wrappedNative, armAddress)
address, _, _, err := router.DeployRouter(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), wrappedNative, armAddress)
return address, nil, nil, err
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -857,7 +862,8 @@ func (e *CCIPContractsDeployer) DeployTokenAdminRegistry() (*TokenAdminRegistry,
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return token_admin_registry.DeployTokenAdminRegistry(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil))
address, _, _, err := token_admin_registry.DeployTokenAdminRegistry(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil))
return address, nil, nil, err
})
if err != nil {
return nil, err
Expand Down Expand Up @@ -1227,7 +1233,8 @@ func (e *CCIPContractsDeployer) DeployMockAggregator(decimals uint8, initialAns
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return mock_v3_aggregator_contract.DeployMockV3Aggregator(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), decimals, initialAns)
address, _, _, err := mock_v3_aggregator_contract.DeployMockV3Aggregator(auth, wrappers.MustNewWrappedContractBackend(e.evmClient, nil), decimals, initialAns)
return address, nil, nil, err
})
if err != nil {
return nil, fmt.Errorf("deploying mock aggregator: %w", err)
Expand Down
3 changes: 2 additions & 1 deletion integration-tests/ccip-tests/contracts/lm_contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ func (e *CCIPContractsDeployer) DeployArmProxy(arm common.Address) (*ArmProxy, e
auth *bind.TransactOpts,
_ bind.ContractBackend,
) (common.Address, *types.Transaction, interface{}, error) {
return rmn_proxy_contract.DeployRMNProxyContract(
address, _, instance, err := rmn_proxy_contract.DeployRMNProxyContract(
auth,
wrappers.MustNewWrappedContractBackend(e.evmClient, nil),
arm,
)
return address, nil, instance, err
})
if err != nil {
return nil, err
Expand Down

0 comments on commit ff6bdff

Please sign in to comment.