2024-10-21 15:47:00 +02:00
|
|
|
package testservice
|
|
|
|
|
|
|
|
import (
|
2024-10-25 08:36:43 +02:00
|
|
|
"context"
|
2024-10-21 15:47:00 +02:00
|
|
|
"encoding/json"
|
|
|
|
|
2024-11-03 02:44:57 +01:00
|
|
|
"git.grassecon.net/urdt/ussd/models"
|
2024-10-30 16:30:55 +01:00
|
|
|
dataserviceapi "github.com/grassrootseconomics/ussd-data-service/pkg/api"
|
2024-10-21 15:47:00 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
type TestAccountService struct {
|
|
|
|
}
|
|
|
|
|
2024-10-31 02:28:37 +01:00
|
|
|
func (tas *TestAccountService) CreateAccount(ctx context.Context) (*models.AccountResult, error) {
|
2024-11-14 18:02:48 +01:00
|
|
|
return &models.AccountResult{
|
2024-10-31 02:28:37 +01:00
|
|
|
TrackingId: "075ccc86-f6ef-4d33-97d5-e91cfb37aa0d",
|
2024-11-14 18:02:48 +01:00
|
|
|
PublicKey: "0x623EFAFa8868df4B934dd12a8B26CB3Dd75A7AdD",
|
2024-10-21 15:47:00 +02:00
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
2024-10-31 02:28:37 +01:00
|
|
|
func (tas *TestAccountService) CheckBalance(ctx context.Context, publicKey string) (*models.BalanceResult, error) {
|
2024-11-14 18:02:48 +01:00
|
|
|
balanceResponse := &models.BalanceResult{
|
2024-10-31 02:28:37 +01:00
|
|
|
Balance: "0.003 CELO",
|
|
|
|
Nonce: json.Number("0"),
|
2024-10-21 15:47:00 +02:00
|
|
|
}
|
|
|
|
return balanceResponse, nil
|
|
|
|
}
|
|
|
|
|
2024-10-31 13:15:07 +01:00
|
|
|
func (tas *TestAccountService) TrackAccountStatus(ctx context.Context, publicKey string) (*models.TrackStatusResult, error) {
|
2024-11-14 18:02:48 +01:00
|
|
|
return &models.TrackStatusResult{
|
2024-10-31 12:43:27 +01:00
|
|
|
Active: true,
|
2024-10-31 02:28:37 +01:00
|
|
|
}, nil
|
2024-10-21 15:47:00 +02:00
|
|
|
}
|
2024-10-25 08:36:43 +02:00
|
|
|
|
2024-10-31 02:28:37 +01:00
|
|
|
func (tas *TestAccountService) FetchVouchers(ctx context.Context, publicKey string) ([]dataserviceapi.TokenHoldings, error) {
|
2024-11-20 16:34:48 +01:00
|
|
|
return []dataserviceapi.TokenHoldings{
|
|
|
|
dataserviceapi.TokenHoldings{
|
2024-10-31 02:28:37 +01:00
|
|
|
ContractAddress: "0x6CC75A06ac72eB4Db2eE22F781F5D100d8ec03ee",
|
|
|
|
TokenSymbol: "SRF",
|
|
|
|
TokenDecimals: "6",
|
|
|
|
Balance: "2745987",
|
2024-10-25 17:01:52 +02:00
|
|
|
},
|
2024-11-14 18:02:48 +01:00
|
|
|
}, nil
|
2024-10-25 17:01:52 +02:00
|
|
|
}
|
2024-11-02 17:42:50 +01:00
|
|
|
|
|
|
|
func (tas *TestAccountService) FetchTransactions(ctx context.Context, publicKey string) ([]dataserviceapi.Last10TxResponse, error) {
|
|
|
|
return []dataserviceapi.Last10TxResponse{}, nil
|
|
|
|
}
|
2024-11-04 03:23:30 +01:00
|
|
|
|
2024-11-14 18:02:48 +01:00
|
|
|
func (m TestAccountService) VoucherData(ctx context.Context, address string) (*models.VoucherDataResult, error) {
|
2024-11-04 03:23:30 +01:00
|
|
|
return &models.VoucherDataResult{}, nil
|
|
|
|
}
|
2024-11-14 18:02:48 +01:00
|
|
|
|
|
|
|
func (tas *TestAccountService) TokenTransfer(ctx context.Context, amount, from, to, tokenAddress string) (*models.TokenTransferResponse, error) {
|
|
|
|
return &models.TokenTransferResponse{
|
|
|
|
TrackingId: "e034d147-747d-42ea-928d-b5a7cb3426af",
|
|
|
|
}, nil
|
|
|
|
}
|
2024-11-20 16:34:48 +01:00
|
|
|
|
|
|
|
func (m TestAccountService) CheckAliasAddress(ctx context.Context, alias string) (*dataserviceapi.AliasAddress, error) {
|
|
|
|
return &dataserviceapi.AliasAddress{}, nil
|
|
|
|
}
|