Skip to content

Commit

Permalink
Update state.go
Browse files Browse the repository at this point in the history
  • Loading branch information
crStiv authored Jan 8, 2025
1 parent b70ca45 commit af4f343
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package state

import (
"context"
"fmt"
"math/big"
"sync"

Expand Down Expand Up @@ -102,7 +103,11 @@ func (s *State) GetBalance(ctx context.Context, address common.Address, root com
if s.tree == nil {
return nil, ErrStateTreeNil
}
return s.tree.GetBalance(ctx, address, root.Bytes())
balance, err := s.tree.GetBalance(ctx, address, root.Bytes())
if err != nil {
return nil, fmt.Errorf("failed to get balance from state tree: %w", err)
}
return balance, nil
}

// GetCode from a given address
Expand Down Expand Up @@ -182,7 +187,7 @@ func (s *State) GetStoredFlushID(ctx context.Context) (uint64, string, error) {
}
res, err := s.executorClient.GetFlushStatus(ctx, &emptypb.Empty{})
if err != nil {
return 0, "", err
return 0, "", fmt.Errorf("failed to get flush status from executor: %w", err)
}

return res.StoredFlushId, res.ProverId, nil
Expand Down

0 comments on commit af4f343

Please sign in to comment.