Fix lint warnings
Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
parent
e6b3ba0178
commit
a5334eb2b3
@ -872,18 +872,3 @@ func (mp *MessagePool) loadLocal() error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
const MinGasPrice = 0
|
||||
|
||||
//TODO: remove replaced by Gas module
|
||||
func (mp *MessagePool) EstimateGasPrice(ctx context.Context, nblocksincl uint64, sender address.Address, gaslimit int64, tsk types.TipSetKey) (types.BigInt, error) {
|
||||
// TODO: something smarter obviously
|
||||
switch nblocksincl {
|
||||
case 0:
|
||||
return types.NewInt(MinGasPrice + 2), nil
|
||||
case 1:
|
||||
return types.NewInt(MinGasPrice + 1), nil
|
||||
default:
|
||||
return types.NewInt(MinGasPrice), nil
|
||||
}
|
||||
}
|
||||
|
@ -107,7 +107,12 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, ts
|
||||
}
|
||||
|
||||
fromKey, err := sm.ResolveToKeyAddress(ctx, msg.From, ts)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("could not resolve key: %w", err)
|
||||
}
|
||||
|
||||
var msgApply types.ChainMsg
|
||||
|
||||
switch fromKey.Protocol() {
|
||||
case address.BLS:
|
||||
msgApply = msg
|
||||
|
@ -38,7 +38,7 @@ func (a *GasAPI) GasEstimateGasPrice(ctx context.Context, nblocksincl uint64,
|
||||
func (a *GasAPI) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message,
|
||||
tsk types.TipSetKey) (int64, error) {
|
||||
|
||||
msg := &(*msgIn)
|
||||
msg := *msgIn
|
||||
msg.GasLimit = build.BlockGasLimit
|
||||
msg.GasPrice = types.NewInt(1)
|
||||
|
||||
@ -47,7 +47,7 @@ func (a *GasAPI) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message,
|
||||
return -1, xerrors.Errorf("could not get tipset: %w", err)
|
||||
}
|
||||
|
||||
res, err := a.Stmgr.CallWithGas(ctx, msg, ts)
|
||||
res, err := a.Stmgr.CallWithGas(ctx, &msg, ts)
|
||||
if err != nil {
|
||||
return -1, xerrors.Errorf("CallWithGas failed: %w", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user