Skip to content

Commit

Permalink
fix: replace L1 rpc url in error for getting l1 gas price (#1533)
Browse files Browse the repository at this point in the history
  • Loading branch information
MorettiGeorgiev authored Dec 3, 2024
1 parent 9be5df2 commit 54c6672
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions turbo/jsonrpc/eth_system_zk.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (
"fmt"
"math/big"
"strconv"
"strings"
"time"

"github.com/ledgerwatch/erigon-lib/common/hexutil"
"github.com/ledgerwatch/erigon/cmd/utils"
"github.com/ledgerwatch/erigon/ethclient"
"github.com/ledgerwatch/erigon/zkevm/encoding"
"github.com/ledgerwatch/erigon/zkevm/jsonrpc/client"
Expand Down Expand Up @@ -119,6 +121,10 @@ func (api *APIImpl) l1GasPrice() (*big.Int, error) {
}

if res.Error != nil {
if strings.Contains(res.Error.Message, api.L1RpcUrl) {
replacement := fmt.Sprintf("<%s>", utils.L1RpcUrlFlag.Name)
res.Error.Message = strings.ReplaceAll(res.Error.Message, api.L1RpcUrl, replacement)
}
return nil, fmt.Errorf("RPC error response: %s", res.Error.Message)
}

Expand Down

0 comments on commit 54c6672

Please sign in to comment.