Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCIP-4408: E2E test for LBTC #1563

Merged
merged 27 commits into from
Dec 13, 2024
Merged

CCIP-4408: E2E test for LBTC #1563

merged 27 commits into from
Dec 13, 2024

Conversation

b-gopalswami
Copy link
Collaborator

@b-gopalswami b-gopalswami commented Dec 6, 2024

Motivation

Adding two E2E test to validate Lombard integration.

Test-1: Make sure the destination payload data from mock token pool is sent as 32 bytes and that triggers call attestation API enabled flow. Mock attestation API provides the required attestation and token transfer should be successful.

Test-2: Send non 32 bytes destination payload data form mock token pool and that should trigger attestation disabled flow and the token transfer should be successful.

Solution

@b-gopalswami b-gopalswami marked this pull request as ready for review December 9, 2024 20:40
rmnContract := *ccipModule.RMNContract
destPoolData, err := hex.DecodeString(LBTCValidDestPoolData) // valid 32 bytes should call attestation api
if err != nil {
return fmt.Errorf("decoding dest pool data shouldn't fail %w", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that errors.Wrapf would be much more useful as it would also give you the whole stacktrace. That function comes from "github.com/pkg/errors"

@@ -925,6 +932,16 @@ func (ccipModule *CCIPCommon) DeployContracts(
if err != nil {
return fmt.Errorf("granting minter role to token transmitter shouldn't fail %w", err)
}
} else if ccipModule.IsLBTCDeployment() && i == 0 {
// if it's LBTC deployment, we deploy the burn mint token 677 with decimal 8 and cast it to ERC20Token
lbtcToken, err := ccipModule.tokenDeployer.DeployCustomBurnMintERC677Token("Lombard LBTC", "LBTC", uint8(8), new(big.Int).Mul(big.NewInt(1e6), big.NewInt(1e18)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to specify this in deployment/ccip/changeset/token_info.go

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in CCIP repo and I don't find that path. We have that in Chainlink repo but not in CCIP.

@@ -962,6 +962,32 @@ runner-test-matrix:
E2E_TEST_SELECTED_NETWORK: SIMULATED_1,SIMULATED_2
test_config_override_path: integration-tests/ccip-tests/testconfig/tomls/usdc_mock_deployment.toml

- id: ccip-smoke-lbtc-32bytes-destination-pool-data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need two entire smoke tests for the minor difference in tx types? Can't we just use one test and send both txs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test TestSmokeCCIPForBidirectionalLane which is used here is common one and this LBTC functionality is driven by config values in that test. This approach avoids adding new set of test and also running it using separate runner parallelize it.

@b-gopalswami b-gopalswami enabled auto-merge (squash) December 13, 2024 16:26
@b-gopalswami b-gopalswami merged commit a7871ef into ccip-develop Dec 13, 2024
152 of 153 checks passed
@b-gopalswami b-gopalswami deleted the ccip-4408 branch December 13, 2024 16:40
bukata-sa pushed a commit that referenced this pull request Dec 13, 2024
## Motivation
Adding two E2E test to validate Lombard integration.

Test-1: Make sure the destination payload data from mock token pool is
sent as 32 bytes and that triggers call attestation API enabled flow.
Mock attestation API provides the required attestation and token
transfer should be successful.

Test-2: Send non 32 bytes destination payload data form mock token pool
and that should trigger attestation disabled flow and the token transfer
should be successful.

## Solution

---------

Co-authored-by: Ryan Stout <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants