statemanager call function will return call information even if call errors

This commit is contained in:
Geoff Stuart 2022-10-31 13:23:11 +00:00
parent 2395de4bb3
commit ec5358773e

View File

@ -133,9 +133,7 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
// TODO: maybe just use the invoker directly? // TODO: maybe just use the invoker directly?
ret, err := vmi.ApplyImplicitMessage(ctx, msg) ret, err := vmi.ApplyImplicitMessage(ctx, msg)
if err != nil { // Don't check for error here, we want to bubble it up, but also return ret as an InvocResult
return nil, xerrors.Errorf("apply message failed: %w", err)
}
var errs string var errs string
if ret.ActorErr != nil { if ret.ActorErr != nil {
@ -150,8 +148,7 @@ func (sm *StateManager) Call(ctx context.Context, msg *types.Message, ts *types.
ExecutionTrace: ret.ExecutionTrace, ExecutionTrace: ret.ExecutionTrace,
Error: errs, Error: errs,
Duration: ret.Duration, Duration: ret.Duration,
}, nil }, err
} }
func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, priorMsgs []types.ChainMsg, ts *types.TipSet) (*api.InvocResult, error) { func (sm *StateManager) CallWithGas(ctx context.Context, msg *types.Message, priorMsgs []types.ChainMsg, ts *types.TipSet) (*api.InvocResult, error) {