Skip to content

Commit

Permalink
Use big.Int#Set instead of big.Int#SetBytes when possible (ethere…
Browse files Browse the repository at this point in the history
…um#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.
  • Loading branch information
maoueh committed Jun 13, 2023
1 parent 4d23e6d commit 891ec7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/state_transition.go
Expand Up @@ -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
Expand Down

0 comments on commit 891ec7f

Please sign in to comment.