mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-22 03:30:35 +00:00
go.mod: upgrade to github.com/holiman/uint256 v1.2.0 (#22745)
This commit is contained in:
parent
f19a679b09
commit
ae5fcdc67f
@ -52,8 +52,7 @@ func CalcDifficultyFrontierU256(time uint64, parent *types.Header) *big.Int {
|
||||
- num = block.number
|
||||
*/
|
||||
|
||||
pDiff := uint256.NewInt()
|
||||
pDiff.SetFromBig(parent.Difficulty) // pDiff: pdiff
|
||||
pDiff, _ := uint256.FromBig(parent.Difficulty) // pDiff: pdiff
|
||||
adjust := pDiff.Clone()
|
||||
adjust.Rsh(adjust, difficultyBoundDivisor) // adjust: pDiff / 2048
|
||||
|
||||
@ -96,8 +95,7 @@ func CalcDifficultyHomesteadU256(time uint64, parent *types.Header) *big.Int {
|
||||
- num = block.number
|
||||
*/
|
||||
|
||||
pDiff := uint256.NewInt()
|
||||
pDiff.SetFromBig(parent.Difficulty) // pDiff: pdiff
|
||||
pDiff, _ := uint256.FromBig(parent.Difficulty) // pDiff: pdiff
|
||||
adjust := pDiff.Clone()
|
||||
adjust.Rsh(adjust, difficultyBoundDivisor) // adjust: pDiff / 2048
|
||||
|
||||
|
@ -568,11 +568,11 @@ func BenchmarkOpSHA3(bench *testing.B) {
|
||||
env.interpreter = evmInterpreter
|
||||
mem.Resize(32)
|
||||
pc := uint64(0)
|
||||
start := uint256.NewInt()
|
||||
start := new(uint256.Int)
|
||||
|
||||
bench.ResetTimer()
|
||||
for i := 0; i < bench.N; i++ {
|
||||
stack.pushN(*uint256.NewInt().SetUint64(32), *start)
|
||||
stack.pushN(*uint256.NewInt(32), *start)
|
||||
opSha3(&pc, evmInterpreter, &ScopeContext{mem, stack, nil})
|
||||
}
|
||||
}
|
||||
|
@ -60,8 +60,8 @@ func TestStoreCapture(t *testing.T) {
|
||||
Contract: contract,
|
||||
}
|
||||
)
|
||||
scope.Stack.push(uint256.NewInt().SetUint64(1))
|
||||
scope.Stack.push(uint256.NewInt())
|
||||
scope.Stack.push(uint256.NewInt(1))
|
||||
scope.Stack.push(new(uint256.Int))
|
||||
var index common.Hash
|
||||
logger.CaptureState(env, 0, SSTORE, 0, 0, scope, nil, 0, nil)
|
||||
if len(logger.storage[contract.Address()]) == 0 {
|
||||
|
2
go.mod
2
go.mod
@ -36,7 +36,7 @@ require (
|
||||
github.com/graph-gophers/graphql-go v0.0.0-20201113091052-beb923fada29
|
||||
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
|
||||
github.com/holiman/bloomfilter/v2 v2.0.3
|
||||
github.com/holiman/uint256 v1.1.1
|
||||
github.com/holiman/uint256 v1.2.0
|
||||
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88
|
||||
github.com/influxdata/influxdb v1.8.3
|
||||
github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458
|
||||
|
2
go.sum
2
go.sum
@ -212,6 +212,8 @@ github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZ
|
||||
github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA=
|
||||
github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw=
|
||||
github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
|
||||
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
|
||||
github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
|
||||
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88 h1:bcAj8KroPf552TScjFPIakjH2/tdIrIH8F+cc4v4SRo=
|
||||
github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo=
|
||||
|
Loading…
Reference in New Issue
Block a user