core/vm: optimize opRandom using uint256.Int.SetBytes32

This commit is contained in:
cuiweixie 2025-10-19 00:32:45 +08:00
parent 0ec63272bf
commit 58efdaf5cc
No known key found for this signature in database
GPG key ID: 16DF64EE15E495A3

View file

@ -475,7 +475,7 @@ func opDifficulty(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) {
} }
func opRandom(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) { func opRandom(pc *uint64, evm *EVM, scope *ScopeContext) ([]byte, error) {
v := new(uint256.Int).SetBytes(evm.Context.Random.Bytes()) v := new(uint256.Int).SetBytes32(evm.Context.Random.Bytes())
scope.Stack.push(v) scope.Stack.push(v)
return nil, nil return nil, nil
} }