Compare commits
No commits in common. "69eb57f7940f0e8f73453cc330dd5402cf0dd12c" and "b41e52af63c845386946845238e99548b78bc0bc" have entirely different histories.
69eb57f794
...
b41e52af63
@ -650,10 +650,6 @@ func (h *Handlers) CheckBalance(ctx context.Context, sym string, input []byte) (
|
|||||||
return res, fmt.Errorf("missing session")
|
return res, fmt.Errorf("missing session")
|
||||||
}
|
}
|
||||||
|
|
||||||
code := codeFromCtx(ctx)
|
|
||||||
l := gotext.NewLocale(translationDir, code)
|
|
||||||
l.AddDomain("default")
|
|
||||||
|
|
||||||
store := h.userdataStore
|
store := h.userdataStore
|
||||||
publicKey, err := store.ReadEntry(ctx, sessionId, utils.DATA_PUBLIC_KEY)
|
publicKey, err := store.ReadEntry(ctx, sessionId, utils.DATA_PUBLIC_KEY)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -670,8 +666,7 @@ func (h *Handlers) CheckBalance(ctx context.Context, sym string, input []byte) (
|
|||||||
}
|
}
|
||||||
res.FlagReset = append(res.FlagReset, flag_api_error)
|
res.FlagReset = append(res.FlagReset, flag_api_error)
|
||||||
balance := balanceResponse.Result.Balance
|
balance := balanceResponse.Result.Balance
|
||||||
|
res.Content = balance
|
||||||
res.Content = l.Get("Balance: %s\n", balance)
|
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
@ -1625,6 +1625,7 @@ func TestValidateRecipient(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCheckBalance(t *testing.T) {
|
func TestCheckBalance(t *testing.T) {
|
||||||
|
|
||||||
sessionId := "session123"
|
sessionId := "session123"
|
||||||
publicKey := "0X13242618721"
|
publicKey := "0X13242618721"
|
||||||
fm, _ := NewFlagManager(flagsPath)
|
fm, _ := NewFlagManager(flagsPath)
|
||||||
@ -1654,7 +1655,7 @@ func TestCheckBalance(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Test when checking a balance is a success",
|
name: "Test when checking a balance is a success",
|
||||||
balanceResonse: &models.BalanceResponse{
|
balanceResonse: &models.BalanceResponse{
|
||||||
Ok: true,
|
Ok: true,
|
||||||
Result: struct {
|
Result: struct {
|
||||||
@ -1666,7 +1667,7 @@ func TestCheckBalance(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
expectedResult: resource.Result{
|
expectedResult: resource.Result{
|
||||||
Content: "Balance: 0.003 CELO\n",
|
Content: "0.003 CELO",
|
||||||
FlagReset: []uint32{flag_api_error},
|
FlagReset: []uint32{flag_api_error},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1699,8 +1700,10 @@ func TestCheckBalance(t *testing.T) {
|
|||||||
|
|
||||||
//Assert that the result set to content is what was expected
|
//Assert that the result set to content is what was expected
|
||||||
assert.Equal(t, res, tt.expectedResult, "Result should contain flags set according to user input")
|
assert.Equal(t, res, tt.expectedResult, "Result should contain flags set according to user input")
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetProfile(t *testing.T) {
|
func TestGetProfile(t *testing.T) {
|
||||||
|
@ -7,8 +7,6 @@ msgstr "Ombi lako limetumwa. %s atapokea %s kutoka kwa %s."
|
|||||||
msgid "Thank you for using Sarafu. Goodbye!"
|
msgid "Thank you for using Sarafu. Goodbye!"
|
||||||
msgstr "Asante kwa kutumia huduma ya Sarafu. Kwaheri!"
|
msgstr "Asante kwa kutumia huduma ya Sarafu. Kwaheri!"
|
||||||
|
|
||||||
|
|
||||||
msgid "For more help,please call: 0757628885"
|
msgid "For more help,please call: 0757628885"
|
||||||
msgstr "Kwa usaidizi zaidi,piga: 0757628885"
|
msgstr "Kwa usaidizi zaidi,piga: 0757628885"
|
||||||
|
|
||||||
msgid "Balance: %s\n"
|
|
||||||
msgstr "Salio: %s\n"
|
|
||||||
|
@ -1 +1 @@
|
|||||||
{{.check_balance}}
|
Balance: {{.check_balance}}
|
||||||
|
@ -1 +1 @@
|
|||||||
{{.check_balance}}
|
Salio: {{.check_balance}}
|
||||||
|
Loading…
Reference in New Issue
Block a user