@lash Nice catch.Actually that brings up an idea,could we use the same implementation of the devapi to resolve the alias' address given that the api always returns the same address?
@lash Nice catch.Actually that brings up an idea,could we use the same implementation of the devapi to resolve the alias' address given that the api always returns the same address?
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
PR Change:
Persists account aliases for the local dev api.
Implements RequestAlias for the HTTPAccountService
@@ -26,2 +26,3 @@logg = logging.NewVanilla().WithDomain("sarafu-api.devapi")logg = logging.NewVanilla().WithDomain("sarafu-api.devapi")aliasRegex = regexp.MustCompile("^\\+?[a-zA-Z0-9\\-_]+$")searchDomain = ".sarafu.local"Export please
@lash Should be moved to: https://git.grassecon.net/grassrootseconomics/common?
no its fine here, it's for dev only anyway.
@@ -108,0 +105,4 @@defaultAccount stringemitterFunc event.EmitterFuncpfx []byte// accountsSession map[string]stringremove commentedp lease
@@ -329,0 +348,4 @@if err != nil {return err}das.db.SetSession("")This is probably not correct? Alias is bound to a session, right?
Yeah that's right.Resolved by:
ed549cba70@@ -408,1 +432,3 @@Balance: strconv.Itoa(v),TokenSymbol: voucher.Symbol,TokenDecimals: strconv.Itoa(voucher.Decimals),Balance: strconv.Itoa(500),Why hardcoded number?
@@ -19,1 +20,4 @@var (aliasRegex = regexp.MustCompile("^\\+?[a-zA-Z0-9\\-_]+$")searchDomain = ".sarafu.eth"THe searchdomain should not be necessary here
@@ -221,3 +227,4 @@}// TODO: Use actual custodial api to request available aliasfunc (as *HTTPAccountService) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) {Can't we just point this to devapi.RequestAlias?
@lash Nice catch.Actually that brings up an idea,could we use the same implementation of the devapi to resolve the alias' address given that the api always returns the same address?
yes for sure, while we wait or the api implementation.