-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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-4308 Test logic optimizations for docker node tests #15392
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b408fbd
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG f7b8792
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG bc2933c
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG a8c273a
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 1b58f80
Merge branch 'develop' of github.com:smartcontractkit/chainlink into …
AnieeG 722c620
funding optimizations
AnieeG 00c27b0
test optimizations
AnieeG 2e03de8
merge with dev
AnieeG d9b62c0
revert
AnieeG 6e25589
fix lint
AnieeG 9c02beb
more fix
AnieeG 26d46f8
revert
AnieeG 9f04a73
add replay
AnieeG File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ import ( | |
"github.com/pkg/errors" | ||
"github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" | ||
"github.com/smartcontractkit/chainlink-ccip/pluginconfig" | ||
"golang.org/x/sync/errgroup" | ||
|
||
commonconfig "github.com/smartcontractkit/chainlink-common/pkg/config" | ||
|
||
|
@@ -84,10 +85,11 @@ func Context(tb testing.TB) context.Context { | |
} | ||
|
||
type DeployedEnv struct { | ||
Env deployment.Environment | ||
HomeChainSel uint64 | ||
FeedChainSel uint64 | ||
ReplayBlocks map[uint64]uint64 | ||
Env deployment.Environment | ||
HomeChainSel uint64 | ||
FeedChainSel uint64 | ||
ReplayBlocks map[uint64]uint64 | ||
SenderAccounts map[uint64]*bind.TransactOpts | ||
} | ||
|
||
func (e *DeployedEnv) SetupJobs(t *testing.T) { | ||
|
@@ -708,40 +710,65 @@ func DeployTransferableToken( | |
addresses deployment.AddressBook, | ||
token string, | ||
) (*burn_mint_erc677.BurnMintERC677, *burn_mint_token_pool.BurnMintTokenPool, *burn_mint_erc677.BurnMintERC677, *burn_mint_token_pool.BurnMintTokenPool, error) { | ||
deployGrp := errgroup.Group{} | ||
// Deploy token and pools | ||
srcToken, srcPool, err := deployTransferTokenOneEnd(lggr, chains[src], addresses, token) | ||
if err != nil { | ||
return nil, nil, nil, nil, err | ||
} | ||
dstToken, dstPool, err := deployTransferTokenOneEnd(lggr, chains[dst], addresses, token) | ||
if err != nil { | ||
return nil, nil, nil, nil, err | ||
} | ||
|
||
// Attach token pools to registry | ||
if err := attachTokenToTheRegistry(chains[src], state.Chains[src], chains[src].DeployerKey, srcToken.Address(), srcPool.Address()); err != nil { | ||
return nil, nil, nil, nil, err | ||
} | ||
|
||
if err := attachTokenToTheRegistry(chains[dst], state.Chains[dst], chains[dst].DeployerKey, dstToken.Address(), dstPool.Address()); err != nil { | ||
return nil, nil, nil, nil, err | ||
} | ||
|
||
// Connect pool to each other | ||
if err := setTokenPoolCounterPart(chains[src], srcPool, dst, dstToken.Address(), dstPool.Address()); err != nil { | ||
return nil, nil, nil, nil, err | ||
} | ||
var srcToken *burn_mint_erc677.BurnMintERC677 | ||
var srcPool *burn_mint_token_pool.BurnMintTokenPool | ||
var dstToken *burn_mint_erc677.BurnMintERC677 | ||
var dstPool *burn_mint_token_pool.BurnMintTokenPool | ||
Comment on lines
+715
to
+718
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit/ can combine into one var decl |
||
deployGrp.Go(func() error { | ||
var err error | ||
srcToken, srcPool, err = deployTransferTokenOneEnd(lggr, chains[src], addresses, token) | ||
if err != nil { | ||
return err | ||
} | ||
// Attach token pools to registry | ||
if err := attachTokenToTheRegistry(chains[src], state.Chains[src], chains[src].DeployerKey, srcToken.Address(), srcPool.Address()); err != nil { | ||
return err | ||
} | ||
return nil | ||
}) | ||
deployGrp.Go(func() error { | ||
var err error | ||
dstToken, dstPool, err = deployTransferTokenOneEnd(lggr, chains[dst], addresses, token) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if err := setTokenPoolCounterPart(chains[dst], dstPool, src, srcToken.Address(), srcPool.Address()); err != nil { | ||
if err := attachTokenToTheRegistry(chains[dst], state.Chains[dst], chains[dst].DeployerKey, dstToken.Address(), dstPool.Address()); err != nil { | ||
return err | ||
} | ||
return nil | ||
}) | ||
if err := deployGrp.Wait(); err != nil { | ||
return nil, nil, nil, nil, err | ||
} | ||
|
||
// Add burn/mint permissions | ||
if err := grantMintBurnPermissions(lggr, chains[src], srcToken, srcPool.Address()); err != nil { | ||
return nil, nil, nil, nil, err | ||
if srcToken == nil || srcPool == nil || dstToken == nil || dstPool == nil { | ||
return nil, nil, nil, nil, fmt.Errorf("failed to deploy token and pool") | ||
} | ||
|
||
if err := grantMintBurnPermissions(lggr, chains[dst], dstToken, dstPool.Address()); err != nil { | ||
configurePoolGrp := errgroup.Group{} | ||
configurePoolGrp.Go(func() error { | ||
err := setTokenPoolCounterPart(chains[src], srcPool, dst, dstToken.Address(), dstPool.Address()) | ||
if err != nil { | ||
return fmt.Errorf("failed to set token pool counter part chain %d: %w", src, err) | ||
} | ||
err = grantMintBurnPermissions(lggr, chains[src], srcToken, srcPool.Address()) | ||
if err != nil { | ||
return fmt.Errorf("failed to grant mint burn permissions chain %d: %w", src, err) | ||
} | ||
return nil | ||
}) | ||
configurePoolGrp.Go(func() error { | ||
err := setTokenPoolCounterPart(chains[dst], dstPool, src, srcToken.Address(), srcPool.Address()) | ||
if err != nil { | ||
return fmt.Errorf("failed to set token pool counter part chain %d: %w", dst, err) | ||
} | ||
if err := grantMintBurnPermissions(lggr, chains[dst], dstToken, dstPool.Address()); err != nil { | ||
return fmt.Errorf("failed to grant mint burn permissions chain %d: %w", dst, err) | ||
} | ||
return nil | ||
}) | ||
if err := configurePoolGrp.Wait(); err != nil { | ||
return nil, nil, nil, nil, err | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🙌