BRG4-10: preserve returned error via wrapping

This commit is contained in:
Cal Bera 2025-08-15 09:35:56 -07:00
parent 87efec359f
commit ac06e7095c

View file

@ -228,7 +228,7 @@ func ApplyPoLMessage(msg *Message, evm *vm.EVM) *ExecutionResult {
result := &ExecutionResult{} result := &ExecutionResult{}
ret, leftOverGas, err := evm.Call(msg.From, *msg.To, msg.Data, msg.GasLimit, common.U2560) ret, leftOverGas, err := evm.Call(msg.From, *msg.To, msg.Data, msg.GasLimit, common.U2560)
if err != nil { if err != nil {
result.Err = fmt.Errorf("PoL tx failed to execute: %v", err) result.Err = fmt.Errorf("PoL tx failed to execute: %w", err)
} }
result.ReturnData = ret result.ReturnData = ret
result.MaxUsedGas = msg.GasLimit - leftOverGas // To inform how much gas was needed to run the msg. result.MaxUsedGas = msg.GasLimit - leftOverGas // To inform how much gas was needed to run the msg.