Compare commits

..

No commits in common. "e8978413a5bfe294801108ba95a97054f4cb3311" and "e2d5546de1dae1e0e2c52b5a7a682dee2d53cc27" have entirely different histories.

16 changed files with 4 additions and 87 deletions

2
go.mod
View File

@ -10,7 +10,7 @@ require (
git.grassecon.net/grassrootseconomics/visedriver-africastalking v0.0.0-20250129070628-5a539172c694
github.com/alecthomas/assert/v2 v2.2.2
github.com/gofrs/uuid v4.4.0+incompatible
github.com/grassrootseconomics/ussd-data-service v1.4.0-beta
github.com/grassrootseconomics/ussd-data-service v1.2.0-beta
github.com/jackc/pgx/v5 v5.7.1
github.com/peteole/testdata-loader v0.3.0
github.com/stretchr/testify v1.9.0

2
go.sum
View File

@ -27,8 +27,6 @@ github.com/grassrootseconomics/eth-custodial v1.3.0-beta h1:twrMBhl89GqDUL9PlkzQ
github.com/grassrootseconomics/eth-custodial v1.3.0-beta/go.mod h1:7uhRcdnJplX4t6GKCEFkbeDhhjlcaGJeJqevbcvGLZo=
github.com/grassrootseconomics/ussd-data-service v1.2.0-beta h1:fn1gwbWIwHVEBtUC2zi5OqTlfI/5gU1SMk0fgGixIXk=
github.com/grassrootseconomics/ussd-data-service v1.2.0-beta/go.mod h1:omfI0QtUwIdpu9gMcUqLMCG8O1XWjqJGBx1qUMiGWC0=
github.com/grassrootseconomics/ussd-data-service v1.4.0-beta h1:4fMd/3h2ZIhRg4GdHQmRw5FfD3MpJvFNNJQo+Q27f5M=
github.com/grassrootseconomics/ussd-data-service v1.4.0-beta/go.mod h1:9sGnorpKaK76FmOGXoh/xv7x5siSFNYdXxQo9BKW4DI=
github.com/graygnuorg/go-gdbm v0.0.0-20220711140707-71387d66dce4 h1:U4kkNYryi/qfbBF8gh7Vsbuz+cVmhf5kt6pE9bYYyLo=
github.com/graygnuorg/go-gdbm v0.0.0-20220711140707-71387d66dce4/go.mod h1:zpZDgZFzeq9s0MIeB1P50NIEWDFFHSFBohI/NbaTD/Y=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=

View File

@ -124,9 +124,6 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService)
ls.DbRs.AddLocalFunc("set_back", appHandlers.SetBack)
ls.DbRs.AddLocalFunc("show_blocked_account", appHandlers.ShowBlockedAccount)
ls.DbRs.AddLocalFunc("clear_temporary_value", appHandlers.ClearTemporaryValue)
ls.DbRs.AddLocalFunc("get_pools", appHandlers.GetPools)
ls.DbRs.AddLocalFunc("swap_from_list", appHandlers.LoadSwapFromList)
ls.DbRs.AddLocalFunc("swap_to_list", appHandlers.LoadSwapToList)
ls.first = appHandlers.Init
return appHandlers, nil

View File

@ -9,15 +9,13 @@ RELOAD check_balance
CATCH api_failure flag_api_call_error 1
MAP check_balance
MOUT send 1
MOUT swap 2
MOUT vouchers 3
MOUT vouchers 2
MOUT account 3
MOUT help 4
MOUT quit 9
HALT
INCMP send 1
INCMP pool_swap 2
INCMP my_vouchers 3
INCMP my_vouchers 2
INCMP my_account 3
INCMP help 4
INCMP quit 9

View File

@ -1,2 +0,0 @@
Enter number or pool symbol to swap from:
{{.get_pools}}

View File

@ -1,8 +0,0 @@
LOAD get_pools 100
MAP get_pools
MOUT back 0
MOUT quit 99
HALT
INCMP _ 0
INCMP quit 99
INCMP swap_from_list *

View File

@ -1,2 +0,0 @@
Chagua bwawa la sarafu la kubadilishana:
{{.get_pools}}

View File

@ -29,4 +29,4 @@ flag,flag_location_set,35,this is set when the location of the profile is set
flag,flag_offerings_set,36,this is set when the offerings of the profile is set
flag,flag_back_set,37,this is set when it is a back navigation
flag,flag_account_blocked,38,this is set when an account has been blocked after the allowed incorrect PIN attempts have been exceeded
flag,flag_incorrect_pool,39,this is set when the user selects an invalid pool

1 flag flag_language_set 8 checks whether the user has set their prefered language
29 flag flag_offerings_set 36 this is set when the offerings of the profile is set
30 flag flag_back_set 37 this is set when it is a back navigation
31 flag flag_account_blocked 38 this is set when an account has been blocked after the allowed incorrect PIN attempts have been exceeded
32

View File

@ -1,2 +0,0 @@
Select number or symbol to swap FROM:
{{.swap_from_list}}

View File

@ -1,7 +0,0 @@
LOAD swap_from_list 0
CATCH _ flag_incorrect_pool 1
MAP swap_from_list
MOUT back 0
HALT
INCMP _ 0
INCMP swap_to_list *

View File

@ -1,2 +0,0 @@
Chagua nambari au ishara ya sarafu kubadilisha KUTOKA:
{{.swap_from_list}}

View File

@ -1,2 +0,0 @@
Select number or symbol to swap TO:
{{.swap_to_list}}

View File

@ -1,7 +0,0 @@
LOAD swap_to_list 0
CATCH _ flag_incorrect_voucher 1
MAP swap_to_list
MOUT back 0
HALT
INCMP _ 0
INCMP swap_limit *

View File

@ -1,2 +0,0 @@
Chagua nambari au ishara ya sarafu kubadilisha KWENDA:
{{.swap_to_list}}

View File

@ -101,15 +101,6 @@ const (
DATA_TRANSACTIONS = 1024 + iota
)
const (
// List of voucher symbols in the top pools context.
DATA_POOL_NAMES = 2048 + iota
// List of symbols in the top pools context.
DATA_POOL_SYMBOLS
// List of contact addresses in the top pools context
DATA_POOL_ADDRESSES
)
var (
logg = logging.NewVanilla().WithDomain("urdt-common")
)

View File

@ -1,33 +0,0 @@
package store
import (
"fmt"
"strings"
dataserviceapi "github.com/grassrootseconomics/ussd-data-service/pkg/api"
)
// PoolsMetadata helps organize data fields
type PoolsMetadata struct {
PoolNames string
PoolSymbols string
PoolContractAdrresses string
}
// ProcessPools converts pools into formatted strings
func ProcessPools(pools []dataserviceapi.PoolDetails) PoolsMetadata {
var data PoolsMetadata
var poolNames, poolSymbols, poolContractAdrresses []string
for i, p := range pools {
poolNames = append(poolNames, fmt.Sprintf("%d:%s", i+1, p.PoolName))
poolSymbols = append(poolSymbols, fmt.Sprintf("%d:%s", i+1, p.PoolSymbol))
poolContractAdrresses = append(poolContractAdrresses, fmt.Sprintf("%d:%s", i+1, p.PoolContractAdrress))
}
data.PoolNames = strings.Join(poolNames, "\n")
data.PoolSymbols = strings.Join(poolSymbols, "\n")
data.PoolContractAdrresses = strings.Join(poolContractAdrresses, "\n")
return data
}