forked from urdt/ussd
Use the balance as the max_amount
This commit is contained in:
parent
8d9aaeedbc
commit
2b10f6023f
@ -499,8 +499,17 @@ func (h *Handlers) ResetTransactionAmount(ctx context.Context, sym string, input
|
|||||||
func (h *Handlers) MaxAmount(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *Handlers) MaxAmount(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
res := resource.Result{}
|
res := resource.Result{}
|
||||||
|
|
||||||
// mimic a max amount
|
accountData, err := h.accountFileHandler.ReadAccountData()
|
||||||
res.Content = "10.00"
|
if err != nil {
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
|
|
||||||
|
balance, err := server.CheckBalance(accountData["PublicKey"])
|
||||||
|
if err != nil {
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
res.Content = balance
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user