Compare commits
No commits in common. "7aea2af9a1baca5ca5b9ef3ac38ef74f6b1b08d3" and "f38ea59569404c8fa967f6d78279a2227f421a16" have entirely different histories.
7aea2af9a1
...
f38ea59569
@ -32,8 +32,8 @@ import (
|
||||
var (
|
||||
logg = logging.NewVanilla()
|
||||
scriptDir = path.Join("services", "registration")
|
||||
|
||||
build = "dev"
|
||||
menuSeparator = ": "
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -128,14 +128,13 @@ func main() {
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, "Database", database)
|
||||
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
|
||||
pfp := path.Join(scriptDir, "pp.csv")
|
||||
|
||||
cfg := engine.Config{
|
||||
Root: "root",
|
||||
OutputSize: uint32(size),
|
||||
FlagCount: uint32(128),
|
||||
MenuSeparator: menuSeparator,
|
||||
MenuSeparator: ": ",
|
||||
}
|
||||
|
||||
if engineDebug {
|
||||
|
||||
@ -23,7 +23,6 @@ import (
|
||||
var (
|
||||
logg = logging.NewVanilla()
|
||||
scriptDir = path.Join("services", "registration")
|
||||
menuSeparator = ": "
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -68,14 +67,13 @@ func main() {
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, "Database", database)
|
||||
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
|
||||
pfp := path.Join(scriptDir, "pp.csv")
|
||||
|
||||
cfg := engine.Config{
|
||||
Root: "root",
|
||||
OutputSize: uint32(size),
|
||||
FlagCount: uint32(128),
|
||||
MenuSeparator: menuSeparator,
|
||||
MenuSeparator: ": ",
|
||||
}
|
||||
|
||||
if engineDebug {
|
||||
|
||||
@ -26,7 +26,6 @@ import (
|
||||
var (
|
||||
logg = logging.NewVanilla()
|
||||
scriptDir = path.Join("services", "registration")
|
||||
menuSeparator = ": "
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -56,14 +55,13 @@ func main() {
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, "Database", database)
|
||||
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
|
||||
pfp := path.Join(scriptDir, "pp.csv")
|
||||
|
||||
cfg := engine.Config{
|
||||
Root: "root",
|
||||
OutputSize: uint32(size),
|
||||
FlagCount: uint32(128),
|
||||
MenuSeparator: menuSeparator,
|
||||
MenuSeparator: ": ",
|
||||
}
|
||||
|
||||
if engineDebug {
|
||||
|
||||
@ -20,7 +20,6 @@ import (
|
||||
var (
|
||||
logg = logging.NewVanilla()
|
||||
scriptDir = path.Join("services", "registration")
|
||||
menuSeparator = ": "
|
||||
)
|
||||
|
||||
func init() {
|
||||
@ -47,7 +46,6 @@ func main() {
|
||||
ctx := context.Background()
|
||||
ctx = context.WithValue(ctx, "SessionId", sessionId)
|
||||
ctx = context.WithValue(ctx, "Database", database)
|
||||
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
|
||||
pfp := path.Join(scriptDir, "pp.csv")
|
||||
|
||||
cfg := engine.Config{
|
||||
@ -55,7 +53,7 @@ func main() {
|
||||
SessionId: sessionId,
|
||||
OutputSize: uint32(size),
|
||||
FlagCount: uint32(128),
|
||||
MenuSeparator: menuSeparator,
|
||||
MenuSeparator: ": ",
|
||||
}
|
||||
|
||||
resourceDir := scriptDir
|
||||
|
||||
@ -1676,11 +1676,6 @@ func (h *Handlers) CheckVouchers(ctx context.Context, sym string, input []byte)
|
||||
func (h *Handlers) GetVoucherList(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||
var res resource.Result
|
||||
|
||||
menuSeparator, ok := ctx.Value("MenuSeparator").(string)
|
||||
if !ok {
|
||||
return res, fmt.Errorf("missing menu Separator")
|
||||
}
|
||||
|
||||
// Read vouchers from the store
|
||||
voucherData, err := h.prefixDb.Get(ctx, common.ToBytes(common.DATA_VOUCHER_SYMBOLS))
|
||||
if err != nil {
|
||||
@ -1688,9 +1683,7 @@ func (h *Handlers) GetVoucherList(ctx context.Context, sym string, input []byte)
|
||||
return res, err
|
||||
}
|
||||
|
||||
formattedData := strings.ReplaceAll(string(voucherData), ":", menuSeparator)
|
||||
|
||||
res.Content = string(formattedData)
|
||||
res.Content = string(voucherData)
|
||||
|
||||
return res, nil
|
||||
}
|
||||
@ -1860,12 +1853,6 @@ func (h *Handlers) GetTransactionsList(ctx context.Context, sym string, input []
|
||||
if !ok {
|
||||
return res, fmt.Errorf("missing session")
|
||||
}
|
||||
|
||||
menuSeparator, ok := ctx.Value("MenuSeparator").(string)
|
||||
if !ok {
|
||||
return res, fmt.Errorf("missing menu Separator")
|
||||
}
|
||||
|
||||
store := h.userdataStore
|
||||
publicKey, err := store.ReadEntry(ctx, sessionId, common.DATA_PUBLIC_KEY)
|
||||
if err != nil {
|
||||
@ -1913,7 +1900,7 @@ func (h *Handlers) GetTransactionsList(ctx context.Context, sym string, input []
|
||||
status = "Sent"
|
||||
}
|
||||
|
||||
formattedTransactions = append(formattedTransactions, fmt.Sprintf("%d%s%s %s %s %s", i+1, menuSeparator, status, value, sym, date))
|
||||
formattedTransactions = append(formattedTransactions, fmt.Sprintf("%d: %s %s %s %s", i+1, status, value, sym, date))
|
||||
}
|
||||
|
||||
res.Content = strings.Join(formattedTransactions, "\n")
|
||||
|
||||
@ -1982,11 +1982,7 @@ func TestCheckVouchers(t *testing.T) {
|
||||
|
||||
func TestGetVoucherList(t *testing.T) {
|
||||
sessionId := "session123"
|
||||
menuSeparator := ":"
|
||||
|
||||
ctx := context.WithValue(context.Background(), "SessionId", sessionId)
|
||||
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
|
||||
|
||||
|
||||
spdb := InitializeTestSubPrefixDb(t, ctx)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user