nit: actually, don't use blocks

This commit is contained in:
Steven Allen 2023-02-17 11:18:51 -08:00
parent 49cd428c43
commit 6c0f4cbd74

View File

@ -369,16 +369,12 @@ func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender ethtypes.
} }
// First, handle the case where the "sender" is an EVM actor. // First, handle the case where the "sender" is an EVM actor.
{ if actor, err := a.StateManager.LoadActor(ctx, addr, ts); err != nil {
actor, err := a.StateManager.LoadActor(ctx, addr, ts)
if err != nil {
if xerrors.Is(err, types.ErrActorNotFound) { if xerrors.Is(err, types.ErrActorNotFound) {
return 0, nil return 0, nil
} }
return 0, xerrors.Errorf("failed to lookup contract %s: %w", sender, err) return 0, xerrors.Errorf("failed to lookup contract %s: %w", sender, err)
} } else if builtinactors.IsEvmActor(actor.Code) {
if builtinactors.IsEvmActor(actor.Code) {
evmState, err := builtinevm.Load(a.Chain.ActorStore(ctx), actor) evmState, err := builtinevm.Load(a.Chain.ActorStore(ctx), actor)
if err != nil { if err != nil {
return 0, xerrors.Errorf("failed to load evm state: %w", err) return 0, xerrors.Errorf("failed to load evm state: %w", err)
@ -391,7 +387,6 @@ func (a *EthModule) EthGetTransactionCount(ctx context.Context, sender ethtypes.
nonce, err := evmState.Nonce() nonce, err := evmState.Nonce()
return ethtypes.EthUint64(nonce), err return ethtypes.EthUint64(nonce), err
} }
}
nonce, err := a.Mpool.GetNonce(ctx, addr, ts.Key()) nonce, err := a.Mpool.GetNonce(ctx, addr, ts.Key())
if err != nil { if err != nil {