Skip to content

Commit 755068b

Browse files
committed
multi: add accounts UpdateBalance endpoint
This commit introduces the structure for a new endpoint in the accounts subsystem, enabling balance adjustments by adding or deducting a specified amount. This contrasts with the existing `UpdateAccount` implementation, which directly sets the balance to a fixed value. For more details on the drawbacks of the current implementation, see [issue #648](#648). The actual implementation of the endpoint will be introduced in subsequent commits.
1 parent 8c24c1a commit 755068b

File tree

11 files changed

+762
-85
lines changed

11 files changed

+762
-85
lines changed

accounts/rpcserver.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@ func (s *RPCServer) UpdateAccount(ctx context.Context,
132132
return marshalAccount(account), nil
133133
}
134134

135+
// UpdateBalance adds or deducts an amount from an existing account in the
136+
// account database.
137+
func (s *RPCServer) UpdateBalance(ctx context.Context,
138+
req *litrpc.UpdateAccountBalanceRequest) (*litrpc.Account, error) {
139+
140+
return nil, fmt.Errorf("not implemented")
141+
}
142+
135143
// ListAccounts returns all accounts that are currently stored in the account
136144
// database.
137145
func (s *RPCServer) ListAccounts(ctx context.Context,

app/src/types/generated/lit-accounts_pb.d.ts

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/types/generated/lit-accounts_pb.js

Lines changed: 305 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)