From 960a3d90757b7ff54e0218cd99d1982687f57939 Mon Sep 17 00:00:00 2001 From: lash Date: Tue, 14 Jan 2025 14:27:28 +0000 Subject: [PATCH] Implement alias dev api --- cmd/main.go | 4 +++- go.mod | 2 +- go.sum | 4 ++-- handlers/application/menuhandler.go | 2 ++ handlers/application/menuhandler_test.go | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index dbe1508..c40c337 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -156,7 +156,9 @@ func main() { } if fakeDir != "" { - svc := devremote.NewDevAccountService(ctx, fakeDir).WithAutoVoucher(ctx, "FOO", 42) + svc := devremote.NewDevAccountService() + svc = svc.WithFs(ctx, fakeDir) + svc = svc.WithAutoVoucher(ctx, "FOO", 42) eu := event.NewEventsUpdater(svc, menuStorageService) emitter := &devEmitter{ h: eu.ToEventsHandler(), diff --git a/go.mod b/go.mod index d595c5f..c00160d 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.23.4 require ( git.defalsify.org/vise.git v0.2.3-0.20250103172917-3e190a44568d git.grassecon.net/grassrootseconomics/common v0.0.0-20250113174703-6afccefd1f05 - git.grassecon.net/grassrootseconomics/sarafu-api v0.0.0-20250113213645-7c697394b5e7 + git.grassecon.net/grassrootseconomics/sarafu-api v0.0.0-20250114142051-9645a2af7bef git.grassecon.net/grassrootseconomics/visedriver v0.8.0-beta.10.0.20250113213325-5228aef0889b git.grassecon.net/grassrootseconomics/visedriver-africastalking v0.0.0-20250113103030-f0b2056fd87d github.com/alecthomas/assert/v2 v2.2.2 diff --git a/go.sum b/go.sum index d36f320..b4bb1f9 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ git.defalsify.org/vise.git v0.2.3-0.20250103172917-3e190a44568d h1:bPAOVZOX4frSG git.defalsify.org/vise.git v0.2.3-0.20250103172917-3e190a44568d/go.mod h1:jyBMe1qTYUz3mmuoC9JQ/TvFeW0vTanCUcPu3H8p4Ck= git.grassecon.net/grassrootseconomics/common v0.0.0-20250113174703-6afccefd1f05 h1:BenzGx6aDHKDwE23/mWIFD2InYIXyzHroZWV3MF5WUk= git.grassecon.net/grassrootseconomics/common v0.0.0-20250113174703-6afccefd1f05/go.mod h1:wgQJZGIS6QuNLHqDhcsvehsbn5PvgV7aziRebMnJi60= -git.grassecon.net/grassrootseconomics/sarafu-api v0.0.0-20250113213645-7c697394b5e7 h1:P+Bi5jcQbnCrLnKNC5k8XDTBsocyZTVifqDyZY6d0w8= -git.grassecon.net/grassrootseconomics/sarafu-api v0.0.0-20250113213645-7c697394b5e7/go.mod h1:X9aQF93xw3vcW2QftJfzLewvbotRM0U00DRtdmFw294= +git.grassecon.net/grassrootseconomics/sarafu-api v0.0.0-20250114142051-9645a2af7bef h1:ukxNTuI+MF6ic2SkRlc8ZjlnsTR8g6owuHkAvnQNY8A= +git.grassecon.net/grassrootseconomics/sarafu-api v0.0.0-20250114142051-9645a2af7bef/go.mod h1:BRIbXv0aulFWqR2XV87haWB4oNRlVEu8KyldLQsAroQ= git.grassecon.net/grassrootseconomics/visedriver v0.8.0-beta.10.0.20250113213325-5228aef0889b h1:6SieNUSEKbkjzquuwazs/lVG56zdEWF10zQQEMRJfMs= git.grassecon.net/grassrootseconomics/visedriver v0.8.0-beta.10.0.20250113213325-5228aef0889b/go.mod h1:E6W7ZOa7ZvVr0Bc5ot0LNSwpSPYq4hXlAIvEPy3AJ7U= git.grassecon.net/grassrootseconomics/visedriver-africastalking v0.0.0-20250113103030-f0b2056fd87d h1:q/NO1rEgK3pia32D/tCq5hXfEuJp84COZRwceFvy/MM= diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index c9a1103..d82a417 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -1076,6 +1076,8 @@ func (h *MenuHandlers) ValidateBlockedNumber(ctx context.Context, sym string, in } // ValidateRecipient validates that the given input is valid. +// +// TODO: split up functino func (h *MenuHandlers) ValidateRecipient(ctx context.Context, sym string, input []byte) (resource.Result, error) { var res resource.Result store := h.userdataStore diff --git a/handlers/application/menuhandler_test.go b/handlers/application/menuhandler_test.go index eda04d6..cf5b4a5 100644 --- a/handlers/application/menuhandler_test.go +++ b/handlers/application/menuhandler_test.go @@ -1698,7 +1698,7 @@ func TestValidateRecipient(t *testing.T) { accountService: mockAccountService, } - aliasResponse := &dataserviceapi.AliasAddress{ + aliasResponse := &models.AliasAddress{ Address: "0xd4c288865Ce0985a481Eef3be02443dF5E2e4Ea9", }