From 012ab55245e8d394d0911ccd379f1969bcf267d9 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Wed, 22 May 2024 13:20:46 +0300 Subject: [PATCH 1/2] Fix log spam. --- integration/simulation/transaction_injector.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/integration/simulation/transaction_injector.go b/integration/simulation/transaction_injector.go index 9fdcd87fea..6cfa2188c4 100644 --- a/integration/simulation/transaction_injector.go +++ b/integration/simulation/transaction_injector.go @@ -445,6 +445,10 @@ func (ti *TransactionInjector) issueRandomWithdrawals() { // todo (@stefan) - rework this when old contract deployer is phased out? msgBusAddr := gethcommon.HexToAddress("0x526c84529B2b8c11F57D93d3f5537aCA3AeCEf9B") + if ti.mgmtContractLib.IsMock() { + return + } + for txCounter := 0; ti.shouldKeepIssuing(txCounter); txCounter++ { fromWallet := ti.rndObsWallet() client := ti.rpcHandles.ObscuroWalletRndClient(fromWallet) From d1347c68601fe5ecd989084faa2fca7a7c918076 Mon Sep 17 00:00:00 2001 From: StefanIliev545 Date: Wed, 22 May 2024 13:54:27 +0300 Subject: [PATCH 2/2] Proper fix. --- integration/simulation/p2p/in_mem_obscuro_client.go | 13 ++++++++++++- integration/simulation/transaction_injector.go | 8 ++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/integration/simulation/p2p/in_mem_obscuro_client.go b/integration/simulation/p2p/in_mem_obscuro_client.go index 6db8332e1c..0c4f51be6e 100644 --- a/integration/simulation/p2p/in_mem_obscuro_client.go +++ b/integration/simulation/p2p/in_mem_obscuro_client.go @@ -111,7 +111,8 @@ func (c *inMemObscuroClient) Call(result interface{}, method string, args ...int case rpc.GetPublicTransactionData: return c.getPublicTransactionData(result, args) - + case rpc.GasPrice: + return c.getGasPrice(result) default: return fmt.Errorf("RPC method %s is unknown", method) } @@ -372,6 +373,16 @@ func (c *inMemObscuroClient) getRollupListing(result interface{}, args []interfa return nil } +func (c *inMemObscuroClient) getGasPrice(result interface{}) error { + gasPrice, err := c.ethAPI.GasPrice(context.Background()) + if err != nil { + return fmt.Errorf("`%s` call failed. Cause: %w", rpc.GasPrice, err) + } + + *result.(*hexutil.Big) = *gasPrice + return nil +} + func (c *inMemObscuroClient) getPublicTransactionData(result interface{}, args []interface{}) error { if len(args) != 1 { return fmt.Errorf("expected 1 arg to %s, got %d", rpc.GetPublicTransactionData, len(args)) diff --git a/integration/simulation/transaction_injector.go b/integration/simulation/transaction_injector.go index 6cfa2188c4..511572c0b9 100644 --- a/integration/simulation/transaction_injector.go +++ b/integration/simulation/transaction_injector.go @@ -323,6 +323,10 @@ func (ti *TransactionInjector) issueRandomDeposits() { } func (ti *TransactionInjector) awaitAndFinalizeWithdrawal(tx *types.Transaction, fromWallet wallet.Wallet) { + if ti.mgmtContractLib.IsMock() { + return + } + err := testcommon.AwaitReceipt(ti.ctx, ti.rpcHandles.ObscuroWalletRndClient(fromWallet), tx.Hash(), 30*time.Second) if err != nil { ti.logger.Error("Failed to await receipt for withdrawal transaction", log.ErrKey, err) @@ -445,10 +449,6 @@ func (ti *TransactionInjector) issueRandomWithdrawals() { // todo (@stefan) - rework this when old contract deployer is phased out? msgBusAddr := gethcommon.HexToAddress("0x526c84529B2b8c11F57D93d3f5537aCA3AeCEf9B") - if ti.mgmtContractLib.IsMock() { - return - } - for txCounter := 0; ti.shouldKeepIssuing(txCounter); txCounter++ { fromWallet := ti.rndObsWallet() client := ti.rpcHandles.ObscuroWalletRndClient(fromWallet)