fix: EthGetBalance: lookup balance at correct state
This commit is contained in:
@@ -636,7 +636,12 @@ func (a *EthModule) EthGetBalance(ctx context.Context, address ethtypes.EthAddre
|
||||
return ethtypes.EthBigInt{}, xerrors.Errorf("cannot parse block param: %s", blkParam)
|
||||
}
|
||||
|
||||
actor, err := a.StateGetActor(ctx, filAddr, ts.Key())
|
||||
st, _, err := a.StateManager.TipSetState(ctx, ts)
|
||||
if err != nil {
|
||||
return ethtypes.EthBigInt{}, xerrors.Errorf("failed to compute tipset state: %w", err)
|
||||
}
|
||||
|
||||
actor, err := a.StateManager.LoadActorRaw(ctx, filAddr, st)
|
||||
if xerrors.Is(err, types.ErrActorNotFound) {
|
||||
return ethtypes.EthBigIntZero, nil
|
||||
} else if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user