-
Notifications
You must be signed in to change notification settings - Fork 53
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
base: ccip-develop
Are you sure you want to change the base?
Conversation
The TokenPool contract constructor works when you set the decimal arg to 18 instead of 6
89faf57
to
4081a34
Compare
@@ -989,6 +1004,32 @@ func (ccipModule *CCIPCommon) DeployContracts( | |||
} | |||
|
|||
ccipModule.BridgeTokenPools = append(ccipModule.BridgeTokenPools, usdcPool) | |||
} else if ccipModule.IsLBTCDeployment() && i == 0 { | |||
ccipModule.Logger.Warn().Msg("Right before lbtcPool") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove these debug comments
} else if ccipModule.IsLBTCDeployment() && i == 0 { | ||
ccipModule.Logger.Warn().Msg("Right before lbtcPool") | ||
rmnContract := *ccipModule.RMNContract | ||
ccipModule.Logger.Warn().Msg(fmt.Sprintf("token addr: %v, RMN contract %v, router addr: %v", token.Address(), rmnContract, ccipModule.Router.Instance.Address())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
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) |
There was a problem hiding this comment.
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))) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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