-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7483173
commit 979f210
Showing
2 changed files
with
37 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package message | ||
|
||
import ( | ||
"math/big" | ||
"strings" | ||
|
||
"github.com/pkg/errors" | ||
) | ||
|
||
var ( | ||
//lint:ignore ST1005 allow `errMaxPriorityFeePerGasNotFound` to be capitalized. | ||
errMaxPriorityFeePerGasNotFound = errors.New( | ||
"Method eth_maxPriorityFeePerGas not found", | ||
) | ||
|
||
// FallbackGasTipCap is the default fallback gasTipCap used when we are | ||
// unable to query an L1 backend for a suggested gasTipCap. | ||
FallbackGasTipCap = big.NewInt(1500000000) | ||
) | ||
|
||
// IsMaxPriorityFeePerGasNotFoundError returns true if the provided error | ||
// signals that the backend does not support the eth_maxPrirorityFeePerGas | ||
// method. In this case, the caller should fallback to using the constant above. | ||
func IsMaxPriorityFeePerGasNotFoundError(err error) bool { | ||
return strings.Contains( | ||
err.Error(), errMaxPriorityFeePerGasNotFound.Error(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters