Skip to content
8 changes: 8 additions & 0 deletions accounts/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ func (s *RPCServer) UpdateAccount(ctx context.Context,
return marshalAccount(account), nil
}

// UpdateBalance adds or deducts an amount from an existing account in the
Copy link
Member

@ellemouton ellemouton Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just an idea for standard PR flow: we always try to (as much as possible at least) to keep commits ordered such that things are working commit by commit. For 2 reasons: 1) reverting back to any single commit isnt a problem and 2) review story telling.

so the ideal flow for RPC additions is:

  1. add DB/Service functionality along with any tests for those (in small PR world, that could honestly be the whole PR - since that is like 1 unit of code that is easy to reason about and also lets us continue the on the accounts SQL PR while we iterate on the second unit here which is proto/CLI design).
  2. add proto definitions & call the new code from the rpc server code
  3. add CLI calling code

the high level pattern im describing here is:

  1. server implements new functionality but doesnt expose it yet
  2. server exposes new functionality
  3. client starts calling new functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the suggestion! I've tried to follow this with the introduction of the new #973 & #974 PRs.

// account database.
func (s *RPCServer) UpdateBalance(ctx context.Context,
req *litrpc.UpdateAccountBalanceRequest) (*litrpc.Account, error) {

return nil, fmt.Errorf("not implemented")
}

// ListAccounts returns all accounts that are currently stored in the account
// database.
func (s *RPCServer) ListAccounts(ctx context.Context,
Expand Down
43 changes: 43 additions & 0 deletions app/src/types/generated/lit-accounts_pb.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

305 changes: 305 additions & 0 deletions app/src/types/generated/lit-accounts_pb.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading