dev-api-aliases #5

Merged
lash merged 6 commits from dev-api-aliases into master 2025-01-21 07:17:09 +01:00
Member

PR Change:

  • Persists account aliases for the local dev api.

  • Implements RequestAlias for the HTTPAccountService

PR Change: - Persists account aliases for the local dev api. - Implements RequestAlias for the HTTPAccountService
carlos added 2 commits 2025-01-20 15:39:35 +01:00
lash requested changes 2025-01-20 16:25:11 +01:00
dev/api.go Outdated
@ -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"
Owner

Export please

Export please
Author
Member
@lash Should be moved to: https://git.grassecon.net/grassrootseconomics/common?
Owner

no its fine here, it's for dev only anyway.

no its fine here, it's for dev only anyway.
@ -108,0 +105,4 @@
defaultAccount string
emitterFunc event.EmitterFunc
pfx []byte
// accountsSession map[string]string
Owner

remove commentedp lease

remove commentedp lease
dev/api.go Outdated
@ -329,0 +348,4 @@
if err != nil {
return err
}
das.db.SetSession("")
Owner

This is probably not correct? Alias is bound to a session, right?

This is probably not correct? Alias is bound to a session, right?
Author
Member

Yeah that's right.Resolved by: ed549cba70

Yeah that's right.Resolved by: ed549cba7046818638f28ce28fae15c3eb344bc8
dev/api.go Outdated
@ -408,1 +432,3 @@
Balance: strconv.Itoa(v),
TokenSymbol: voucher.Symbol,
TokenDecimals: strconv.Itoa(voucher.Decimals),
Balance: strconv.Itoa(500),
Owner

Why hardcoded number?

Why hardcoded number?
@ -19,1 +20,4 @@
var (
aliasRegex = regexp.MustCompile("^\\+?[a-zA-Z0-9\\-_]+$")
searchDomain = ".sarafu.eth"
Owner

THe searchdomain should not be necessary here

THe searchdomain should not be necessary here
@ -221,3 +227,4 @@
}
// TODO: Use actual custodial api to request available alias
func (as *HTTPAccountService) RequestAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) {
Owner

Can't we just point this to devapi.RequestAlias?

Can't we just point this to devapi.RequestAlias?
Author
Member

@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?
Owner

yes for sure, while we wait or the api implementation.

yes for sure, while we wait or the api implementation.
carlos added 2 commits 2025-01-20 18:13:12 +01:00
carlos added 1 commit 2025-01-20 20:28:38 +01:00
carlos added 1 commit 2025-01-21 06:45:20 +01:00
lash merged commit a4cc7d2a98 into master 2025-01-21 07:17:09 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: grassrootseconomics/sarafu-api#5
No description provided.