mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
common/math: add BigIntToUint256Int method back
This commit is contained in:
parent
8bb1e67330
commit
4a4ba278dc
1 changed files with 8 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ package math
|
|||
import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
|
||||
"github.com/holiman/uint256"
|
||||
)
|
||||
|
||||
// Various big integer limit values.
|
||||
|
|
@ -194,3 +196,9 @@ func U256(x *big.Int) *big.Int {
|
|||
func U256Bytes(n *big.Int) []byte {
|
||||
return PaddedBigBytes(U256(n), 32)
|
||||
}
|
||||
|
||||
// BigIntToUint256Int converts big Int to uint256 Int by setting bytes representing
|
||||
// big-endian unsigned integer.
|
||||
func BigIntToUint256Int(x *big.Int) *uint256.Int {
|
||||
return new(uint256.Int).SetBytes(x.Bytes())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue