diff --git a/chain/messagepool/messagepool.go b/chain/messagepool/messagepool.go index 633b3b351..c12359482 100644 --- a/chain/messagepool/messagepool.go +++ b/chain/messagepool/messagepool.go @@ -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 - } -} diff --git a/chain/stmgr/call.go b/chain/stmgr/call.go index f48e0d707..893db33a8 100644 --- a/chain/stmgr/call.go +++ b/chain/stmgr/call.go @@ -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 diff --git a/node/impl/full/gas.go b/node/impl/full/gas.go index d6e2caf2d..1d09e5844 100644 --- a/node/impl/full/gas.go +++ b/node/impl/full/gas.go @@ -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) }