Merge pull request #3456 from filecoin-project/misc/account-for-premium
Account for GasPremium in GasEstimateFeeCap
This commit is contained in:
commit
5aeabe39b5
@ -59,6 +59,10 @@ func (a *GasAPI) GasEstimateFeeCap(ctx context.Context, msg *types.Message, maxq
|
|||||||
out = types.BigDiv(maxAccepted, gasLimitBig)
|
out = types.BigDiv(maxAccepted, gasLimitBig)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if msg.GasPremium != types.EmptyInt {
|
||||||
|
out = types.BigAdd(out, msg.GasPremium)
|
||||||
|
}
|
||||||
|
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +218,7 @@ func (a *GasAPI) GasEstimateMessageGas(ctx context.Context, msg *types.Message,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, xerrors.Errorf("estimating fee cap: %w", err)
|
return nil, xerrors.Errorf("estimating fee cap: %w", err)
|
||||||
}
|
}
|
||||||
msg.GasFeeCap = big.Add(feeCap, msg.GasPremium)
|
msg.GasFeeCap = feeCap
|
||||||
}
|
}
|
||||||
|
|
||||||
capGasFee(msg, spec.Get().MaxFee)
|
capGasFee(msg, spec.Get().MaxFee)
|
||||||
|
Loading…
Reference in New Issue
Block a user