Skip to content

Commit

Permalink
Fix log spam. (#1929)
Browse files Browse the repository at this point in the history
* Fix log spam.

* Proper fix.

---------

Co-authored-by: StefanIliev545 <[email protected]>
  • Loading branch information
StefanIliev545 and StefanIliev545 authored May 22, 2024
1 parent 762dfef commit f8b86b5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
13 changes: 12 additions & 1 deletion integration/simulation/p2p/in_mem_obscuro_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 4 additions & 0 deletions integration/simulation/transaction_injector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f8b86b5

Please sign in to comment.