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

tests(e2e:timelock): execution for different chains in 1 proposal #282

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions e2e/config.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[evm_config]
[evm_config_a]
chain_id = "1337"
image = "f4hrenh9it/foundry:latest"
port = "8545"
type = "anvil"

[evm_config.out]
[evm_config_a.out]
family = "evm"


Expand All @@ -17,14 +17,22 @@ private_keys = [
"0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a"
]

[evm_config_b]
chain_id = "2337"
image = "f4hrenh9it/foundry:latest"
port = "8546"
type = "anvil"

[evm_config_b.out]
family = "evm"


[solana_config]
chain_id = "EtWTRABZaYq6iMfeYKouRu166VU2xqa1wcaWoxPkrZBG" # devnet chain id; fixme: figure out how to use local solana-test-validator
port = "8999"
type = "solana"
public_key ="9n1pyVGGo6V4mpiSDMVay5As9NurEkY283wwRk1Kto2C"

[solana_config.out]
family = "solana"

[solana_config.solana_programs]
mcm = "6UmMZr5MEqiKWD5jqTJd1WCR5kT8oZuFYBLJFi1o6GQX"
Expand Down
12 changes: 6 additions & 6 deletions e2e/ledger/ledger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ func (s *ManualLedgerSigningTestSuite) deployMCMContractEVM(ctx context.Context)

// Deploy MCMS contract
s.Require().True(ok, "Failed to parse chain ID")
mcmsAddress, tx, instance, err := bindings.DeployManyChainMultiSig(s.authEVM, s.Client)
mcmsAddress, tx, instance, err := bindings.DeployManyChainMultiSig(s.authEVM, s.ClientA)
s.Require().NoError(err, "Failed to deploy contract")

// Wait for the transaction to be mined
receipt, err := bind.WaitMined(ctx, s.Client, tx)
receipt, err := bind.WaitMined(ctx, s.ClientA, tx)
s.Require().NoError(err, "Failed to mine deployment transaction")
s.Require().Equal(gethTypes.ReceiptStatusSuccessful, receipt.Status)

Expand Down Expand Up @@ -100,10 +100,10 @@ func (s *ManualLedgerSigningTestSuite) setRootEVM(
mcmConfig := types.Config{Quorum: 1, Signers: []common.Address{ledgerAccount}}

// set config
configurer := evm.NewConfigurer(s.Client, s.authEVM)
configurer := evm.NewConfigurer(s.ClientA, s.authEVM)
tx, err := configurer.SetConfig(ctx, instance.Address().Hex(), &mcmConfig, true)
s.Require().NoError(err, "Failed to set contract configuration")
_, err = bind.WaitMined(ctx, s.Client, tx.RawTransaction.(*gethTypes.Transaction))
_, err = bind.WaitMined(ctx, s.ClientA, tx.RawTransaction.(*gethTypes.Transaction))
s.Require().NoError(err, "Failed to mine set config transaction")

// set root
Expand Down Expand Up @@ -219,7 +219,7 @@ func (s *ManualLedgerSigningTestSuite) TestManualLedgerSigning() {
// Step 4: Create a Signable instance
s.T().Log("Creating Signable instance...")
inspectors := map[types.ChainSelector]sdk.Inspector{
s.chainSelectorEVM: evm.NewInspector(s.Client),
s.chainSelectorEVM: evm.NewInspector(s.ClientA),
s.chainSelectorSolana: solanamcms.NewInspector(s.SolanaClient),
}
encoders, err := proposal.GetEncoders()
Expand All @@ -229,7 +229,7 @@ func (s *ManualLedgerSigningTestSuite) TestManualLedgerSigning() {
s.authSolana = authSolana
encoderEVM := encoders[s.chainSelectorEVM].(*evm.Encoder)
encoderSolana := encoders[s.chainSelectorSolana].(*solanamcms.Encoder)
executorEVM := evm.NewExecutor(encoderEVM, s.Client, s.authEVM)
executorEVM := evm.NewExecutor(encoderEVM, s.ClientA, s.authEVM)
executorSolana := solanamcms.NewExecutor(encoderSolana, s.SolanaClient, authSolana)
executorsMap := map[types.ChainSelector]sdk.Executor{
s.chainSelectorEVM: executorEVM,
Expand Down
Loading
Loading