Skip to content

Commit

Permalink
CCIP-4165 additional e2e integration tests (#15245)
Browse files Browse the repository at this point in the history
* additional e2e integration test first version

* attempt fix linter

* test cleanup and linting

* remove duplicate import

* remove additional message data from ccipSendRequest

* attempt lint fix and comment

* add new e2e messaging tests

* checkpoint work

* checkpointing

* test passing

* fix smoke tests after they broke in the last merge from develop

* message and programmable token transfer e2e tests

* bump smoke test timeout parameter

* bump time again

* fix flakey assertion

use the fee token paid from the event rather than the call before the
request is made

* refactor, use sim backend

* fix workflow

* fix lint

---------

Co-authored-by: Makram Kamaleddine <makramkd@users.noreply.github.com>
  • Loading branch information
jhweintraub and makramkd authored Nov 28, 2024
1 parent b70c932 commit 86f83f4
Show file tree
Hide file tree
Showing 6 changed files with 497 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ runner-test-matrix:
triggers:
- PR E2E Core Tests
- Nightly E2E Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_test.go -timeout 12m -test.parallel=2 -count=1 -json
test_cmd: cd integration-tests/smoke/ccip && go test ccip_test.go -timeout 25m -test.parallel=2 -count=1 -json
pyroscope_env: ci-smoke-ccipv1_6-evm-simulated
test_env_vars:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
Expand Down
8 changes: 8 additions & 0 deletions .github/integration-in-memory-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
runner-test-matrix:
# START: CCIPv1.6 tests

- id: smoke/ccip/ccip_fees_test.go:*
path: integration-tests/smoke/ccip/ccip_fees_test.go
test_env_type: in-memory
runs_on: ubuntu-latest
triggers:
- PR Integration CCIP Tests
test_cmd: cd integration-tests/smoke/ccip && go test ccip_fees_test.go -timeout 12m -test.parallel=2 -count=1 -json

- id: smoke/ccip/ccip_messaging_test.go:*
path: integration-tests/smoke/ccip/ccip_messaging_test.go
test_env_type: in-memory
Expand Down
1 change: 1 addition & 0 deletions deployment/address_book.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
Version1_1_0 = *semver.MustParse("1.1.0")
Version1_2_0 = *semver.MustParse("1.2.0")
Version1_5_0 = *semver.MustParse("1.5.0")
Version1_5_1 = *semver.MustParse("1.5.1")
Version1_6_0_dev = *semver.MustParse("1.6.0-dev")
)

Expand Down
40 changes: 39 additions & 1 deletion deployment/ccip/changeset/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package changeset
import (
"fmt"

burn_mint_token_pool "github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/burn_mint_token_pool_1_4_0"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/shared/generated/erc20"

"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_messenger"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/mock_usdc_token_transmitter"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/ccip/generated/usdc_token_pool"
Expand Down Expand Up @@ -75,7 +78,8 @@ type CCIPChainState struct {
// and the respective token contract
// This is more of an illustration of how we'll have tokens, and it might need some work later to work properly.
// Not all tokens will be burn and mint tokens.
BurnMintTokens677 map[TokenSymbol]*burn_mint_erc677.BurnMintERC677
BurnMintTokens677 map[TokenSymbol]*burn_mint_erc677.BurnMintERC677
BurnMintTokenPools map[TokenSymbol]*burn_mint_token_pool.BurnMintTokenPool
// Map between token Symbol (e.g. LinkSymbol, WethSymbol)
// and the respective aggregator USD feed contract
USDFeeds map[TokenSymbol]*aggregator_v3_interface.AggregatorV3Interface
Expand Down Expand Up @@ -438,6 +442,40 @@ func LoadChainState(chain deployment.Chain, addresses map[string]deployment.Type
return state, fmt.Errorf("unknown feed description %s", desc)
}
state.USDFeeds[key] = feed
case deployment.NewTypeAndVersion(BurnMintTokenPool, deployment.Version1_5_1).String():
pool, err := burn_mint_token_pool.NewBurnMintTokenPool(common.HexToAddress(address), chain.Client)
if err != nil {
return state, err
}
if state.BurnMintTokenPools == nil {
state.BurnMintTokenPools = make(map[TokenSymbol]*burn_mint_token_pool.BurnMintTokenPool)
}
tokAddress, err := pool.GetToken(nil)
if err != nil {
return state, err
}
tok, err := erc20.NewERC20(tokAddress, chain.Client)
if err != nil {
return state, err
}
symbol, err := tok.Symbol(nil)
if err != nil {
return state, err
}
state.BurnMintTokenPools[TokenSymbol(symbol)] = pool
case deployment.NewTypeAndVersion(BurnMintToken, deployment.Version1_0_0).String():
tok, err := burn_mint_erc677.NewBurnMintERC677(common.HexToAddress(address), chain.Client)
if err != nil {
return state, err
}
if state.BurnMintTokens677 == nil {
state.BurnMintTokens677 = make(map[TokenSymbol]*burn_mint_erc677.BurnMintERC677)
}
symbol, err := tok.Symbol(nil)
if err != nil {
return state, fmt.Errorf("failed to get token symbol of token at %s: %w", address, err)
}
state.BurnMintTokens677[TokenSymbol(symbol)] = tok
default:
return state, fmt.Errorf("unknown contract %s", tvStr)
}
Expand Down
2 changes: 1 addition & 1 deletion deployment/ccip/changeset/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ func deployTransferTokenOneEnd(
common.HexToAddress(routerAddress),
)
return deployment.ContractDeploy[*burn_mint_token_pool.BurnMintTokenPool]{
tokenPoolAddress, tokenPoolContract, tx, deployment.NewTypeAndVersion(BurnMintTokenPool, deployment.Version1_0_0), err2,
tokenPoolAddress, tokenPoolContract, tx, deployment.NewTypeAndVersion(BurnMintTokenPool, deployment.Version1_5_1), err2,
}
})
if err != nil {
Expand Down
Loading

0 comments on commit 86f83f4

Please sign in to comment.