From f8b86b5270ee29446af57e2a6f1f44058081cb35 Mon Sep 17 00:00:00 2001 From: Stefan Iliev <46542846+StefanIliev545@users.noreply.github.com> Date: Wed, 22 May 2024 14:15:26 +0300 Subject: [PATCH] Fix log spam. (#1929) * Fix log spam. * Proper fix. --------- Co-authored-by: StefanIliev545 --- integration/simulation/p2p/in_mem_obscuro_client.go | 13 ++++++++++++- integration/simulation/transaction_injector.go | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) 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 9fdcd87fea..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)