add UpdateAlias to the DevAccountService and mocks

This commit is contained in:
Alfred Kamanda 2025-06-26 09:54:19 +03:00
parent 49a8184d02
commit 57ee409f96
Signed by: Alfred-mk
GPG Key ID: 7EA3D01708908703
4 changed files with 20 additions and 0 deletions

View File

@ -806,6 +806,13 @@ func (das *DevAccountService) RequestAlias(ctx context.Context, publicKey string
}, nil
}
func (das *DevAccountService) UpdateAlias(ctx context.Context, publicKey string, name string) (*models.RequestAliasResult, error) {
logg.DebugCtxf(ctx, "Updated the alias", "address", publicKey, "name", name)
return &models.RequestAliasResult{
Alias: name,
}, nil
}
func (das *DevAccountService) SendUpsellSMS(ctx context.Context, inviterPhone, inviteePhone string) (*models.SendSMSResponse, error) {
logg.DebugCtxf(ctx, "sent an SMS", "inviterPhone", inviterPhone, "inviteePhone", inviteePhone)
return &models.SendSMSResponse{

View File

@ -58,6 +58,10 @@ func (m MockApi) RequestAlias(ctx context.Context, publicKey string, hint string
return nil, nil
}
func (m MockApi) UpdateAlias(ctx context.Context, publicKey string, name string) (*models.RequestAliasResult, error) {
return nil, nil
}
func (m MockApi) TokenTransfer(ctx context.Context, amount, from, to, tokenAddress string) (*models.TokenTransferResponse, error) {
return nil, nil
}

View File

@ -58,6 +58,11 @@ func (m *MockAccountService) RequestAlias(ctx context.Context, publicKey string,
return args.Get(0).(*models.RequestAliasResult), args.Error(1)
}
func (m *MockAccountService) UpdateAlias(ctx context.Context, publicKey string, name string) (*models.RequestAliasResult, error) {
args := m.Called(publicKey, name)
return args.Get(0).(*models.RequestAliasResult), args.Error(1)
}
func (m *MockAccountService) SendUpsellSMS(ctx context.Context, inviterPhone, inviteePhone string) (*models.SendSMSResponse, error) {
args := m.Called(inviterPhone, inviteePhone)
return args.Get(0).(*models.SendSMSResponse), args.Error(1)

View File

@ -69,6 +69,10 @@ func (m *TestAccountService) RequestAlias(ctx context.Context, publicKey string,
return &models.RequestAliasResult{}, nil
}
func (m *TestAccountService) UpdateAlias(ctx context.Context, publicKey string, hint string) (*models.RequestAliasResult, error) {
return &models.RequestAliasResult{}, nil
}
func (m *TestAccountService) SendUpsellSMS(ctx context.Context, inviterPhone, inviteePhone string) (*models.SendSMSResponse, error) {
return &models.SendSMSResponse{}, nil
}