From 643c47bf5e4b701b767e197bfffc0a446c3a12c1 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Fri, 24 Nov 2023 15:07:05 +0200 Subject: [PATCH] waiting for receipt for initialization. --- integration/simulation/network/geth_utils.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/integration/simulation/network/geth_utils.go b/integration/simulation/network/geth_utils.go index 5696dec834..42030e02f2 100644 --- a/integration/simulation/network/geth_utils.go +++ b/integration/simulation/network/geth_utils.go @@ -1,6 +1,7 @@ package network import ( + "context" "errors" "fmt" "math/big" @@ -14,6 +15,7 @@ import ( "github.com/ten-protocol/go-ten/go/ethadapter" "github.com/ten-protocol/go-ten/go/wallet" "github.com/ten-protocol/go-ten/integration" + integrationCommon "github.com/ten-protocol/go-ten/integration/common" "github.com/ten-protocol/go-ten/integration/common/testlog" "github.com/ten-protocol/go-ten/integration/erc20contract" "github.com/ten-protocol/go-ten/integration/eth2network" @@ -113,11 +115,16 @@ func DeployObscuroNetworkContracts(client ethadapter.EthClient, wallets *params. return nil, fmt.Errorf("unable to create a keyed transactor for initializing the management contract. Cause: %w", err) } - _, err = managementContract.Initialize(opts) + tx, err := managementContract.Initialize(opts) if err != nil { return nil, fmt.Errorf("unable to initialize management contract. Cause: %w", err) } + _, err = integrationCommon.AwaitReceiptEth(context.Background(), client.EthClient(), tx.Hash(), 25*time.Second) + if err != nil { + return nil, fmt.Errorf("no receipt for management contract initialization") + } + l1BusAddress, err := managementContract.MessageBus(&bind.CallOpts{}) if err != nil { return nil, fmt.Errorf("failed to fetch MessageBus address. Cause: %w", err)