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

Fix log spam. #1929

Merged
merged 2 commits into from
May 22, 2024
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
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() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment please

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
Loading