go-ethereum/common/math/uint.go
marcello33 3ed22568fd
Hotfixes and deps bump (#776)
* dev: chg: bump deps

* internal/cli/server, rpc: lower down http readtimeout to 10s

* dev: chg: get p2p adapter

* dev: chg: lower down jsonrpc readtimeout to 10s

* cherry-pick txpool optimisation changes

* add check for empty lists in txpool (#704)

* add check

* linters

* core, miner: add empty instrumentation name for tracing

---------

Co-authored-by: Raneet Debnath <raneetdebnath10@gmail.com>
Co-authored-by: SHIVAM SHARMA <shivam691999@gmail.com>
Co-authored-by: Evgeny Danilenko <6655321@bk.ru>
Co-authored-by: Manav Darji <manavdarji.india@gmail.com>
2023-03-14 12:40:23 +01:00

23 lines
308 B
Go

package math
import (
"math/big"
"github.com/holiman/uint256"
)
var (
U0 = uint256.NewInt(0)
U1 = uint256.NewInt(1)
U100 = uint256.NewInt(100)
)
func U256LTE(a, b *uint256.Int) bool {
return a.Lt(b) || a.Eq(b)
}
func FromBig(v *big.Int) *uint256.Int {
u, _ := uint256.FromBig(v)
return u
}