Skip to content

Commit

Permalink
add transfer for MTR movement from validator benefit to eMTRG map
Browse files Browse the repository at this point in the history
  • Loading branch information
simonzg committed Jul 10, 2023
1 parent c8510a2 commit 8ead35d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,14 @@ func (rt *Runtime) EnforceTeslaFork10_Corrections(stateDB *statedb.StateDB, bloc
log.Info("Before moving MTR", "validatorBenefit", rt.state.GetEnergy(meter.ValidatorBenefitAddr), "toAddr", rt.state.GetEnergy(toAddr))
rt.state.SetEnergy(meter.ValidatorBenefitAddr, reserve)
rt.state.SetEnergy(toAddr, new(big.Int).Add(toEnergy, moved))

stateDB.AddTransfer(&tx.Transfer{
Sender: meter.Address(meter.ValidatorBenefitAddr),
Recipient: meter.Address(toAddr),
Amount: moved,
Token: 0,
})

log.Info("After moving MTR", "validatorBenefit", rt.state.GetEnergy(meter.ValidatorBenefitAddr), "toAddr", rt.state.GetEnergy(toAddr))
}

Expand Down

0 comments on commit 8ead35d

Please sign in to comment.