Fix lint warnings

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-07-20 21:41:05 +02:00
parent e6b3ba0178
commit a5334eb2b3
No known key found for this signature in database
GPG Key ID: 9A9AF56F8B3879BA
3 changed files with 7 additions and 17 deletions

View File

@ -872,18 +872,3 @@ func (mp *MessagePool) loadLocal() error {
return nil 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
}
}

View File

@ -107,7 +107,12 @@ func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, ts
} }
fromKey, err := sm.ResolveToKeyAddress(ctx, msg.From, 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 var msgApply types.ChainMsg
switch fromKey.Protocol() { switch fromKey.Protocol() {
case address.BLS: case address.BLS:
msgApply = msg msgApply = msg

View File

@ -38,7 +38,7 @@ func (a *GasAPI) GasEstimateGasPrice(ctx context.Context, nblocksincl uint64,
func (a *GasAPI) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message, func (a *GasAPI) GasEstimateGasLimit(ctx context.Context, msgIn *types.Message,
tsk types.TipSetKey) (int64, error) { tsk types.TipSetKey) (int64, error) {
msg := &(*msgIn) msg := *msgIn
msg.GasLimit = build.BlockGasLimit msg.GasLimit = build.BlockGasLimit
msg.GasPrice = types.NewInt(1) 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) 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 { if err != nil {
return -1, xerrors.Errorf("CallWithGas failed: %w", err) return -1, xerrors.Errorf("CallWithGas failed: %w", err)
} }