Use big.Int#Set instead of big.Int#SetBytes when possible (#896)

There is no reason to make the bytes transformation and back to big int to assign a big int to another one.

The `Set` method should be used instead.
This commit is contained in:
Matthieu Vachon 2023-06-13 02:32:57 -04:00 committed by GitHub
parent 4d23e6de33
commit 891ec7fef6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -381,8 +381,8 @@ func (st *StateTransition) TransitionDb(interruptCtx context.Context) (*Executio
if !st.noFeeBurnAndTip {
st.state.AddBalance(st.evm.Context.Coinbase, amount)
output1 := new(big.Int).SetBytes(input1.Bytes())
output2 := new(big.Int).SetBytes(input2.Bytes())
output1 := new(big.Int).Set(input1)
output2 := new(big.Int).Set(input2)
// Deprecating transfer log and will be removed in future fork. PLEASE DO NOT USE this transfer log going forward. Parameters won't get updated as expected going forward with EIP1559
// add transfer log