优化
This commit is contained in:
@@ -24,7 +24,7 @@ func (h *Handler) Balance(c *gin.Context) {
|
||||
response.Unauthorized(c, "缺少用户上下文")
|
||||
return
|
||||
}
|
||||
account, err := h.service.Account(userID)
|
||||
account, err := h.service.Account(c.Request.Context(), userID)
|
||||
if err != nil {
|
||||
writeWalletError(c, err)
|
||||
return
|
||||
@@ -54,7 +54,7 @@ func (h *Handler) Ledger(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
page, pageSize := parsePagination(c)
|
||||
result, err := h.service.Ledger(userID, page, pageSize)
|
||||
result, err := h.service.Ledger(c.Request.Context(), userID, page, pageSize)
|
||||
if err != nil {
|
||||
writeWalletError(c, err)
|
||||
return
|
||||
@@ -73,7 +73,7 @@ func (h *Handler) Recharge(c *gin.Context) {
|
||||
response.BadRequest(c, "充值金额不正确")
|
||||
return
|
||||
}
|
||||
account, err := h.service.Recharge(userID, req)
|
||||
account, err := h.service.Recharge(c.Request.Context(), userID, req)
|
||||
if err != nil {
|
||||
writeWalletError(c, err)
|
||||
return
|
||||
@@ -92,7 +92,7 @@ func (h *Handler) Withdraw(c *gin.Context) {
|
||||
response.BadRequest(c, "提现金额不正确")
|
||||
return
|
||||
}
|
||||
account, err := h.service.Withdraw(userID, req)
|
||||
account, err := h.service.Withdraw(c.Request.Context(), userID, req)
|
||||
if err != nil {
|
||||
writeWalletError(c, err)
|
||||
return
|
||||
@@ -105,7 +105,7 @@ func (h *Handler) AdminLedger(c *gin.Context) {
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
result, err := h.service.AdminLedger(query)
|
||||
result, err := h.service.AdminLedger(c.Request.Context(), query)
|
||||
if err != nil {
|
||||
writeWalletError(c, err)
|
||||
return
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package wallet
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"time"
|
||||
@@ -32,9 +33,9 @@ func NewRepository(db *gorm.DB) *Repository {
|
||||
return &Repository{db: db}
|
||||
}
|
||||
|
||||
func (r *Repository) Account(userID uint64) (*AccountDTO, error) {
|
||||
func (r *Repository) Account(ctx context.Context, userID uint64) (*AccountDTO, error) {
|
||||
var account model.WalletAccount
|
||||
err := r.db.Transaction(func(tx *gorm.DB) error {
|
||||
err := r.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
if err := ensureAccount(tx, userID); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -46,14 +47,14 @@ func (r *Repository) Account(userID uint64) (*AccountDTO, error) {
|
||||
return toAccountDTO(account), nil
|
||||
}
|
||||
|
||||
func (r *Repository) Ledger(userID uint64, page, pageSize int) (*PaginatedResult, error) {
|
||||
func (r *Repository) Ledger(ctx context.Context, userID uint64, page, pageSize int) (*PaginatedResult, error) {
|
||||
var total int64
|
||||
if err := r.db.Model(&model.WalletLedger{}).Where("user_id = ?", userID).Count(&total).Error; err != nil {
|
||||
if err := r.db.WithContext(ctx).Model(&model.WalletLedger{}).Where("user_id = ?", userID).Count(&total).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
offset := (page - 1) * pageSize
|
||||
var rows []model.WalletLedger
|
||||
if err := r.db.Where("user_id = ?", userID).Order("id DESC").Offset(offset).Limit(pageSize).Find(&rows).Error; err != nil {
|
||||
if err := r.db.WithContext(ctx).Where("user_id = ?", userID).Order("id DESC").Offset(offset).Limit(pageSize).Find(&rows).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
items := make([]LedgerDTO, 0, len(rows))
|
||||
@@ -63,8 +64,8 @@ func (r *Repository) Ledger(userID uint64, page, pageSize int) (*PaginatedResult
|
||||
return &PaginatedResult{Items: items, Total: total, Page: page, PageSize: pageSize}, nil
|
||||
}
|
||||
|
||||
func (r *Repository) Recharge(userID uint64, amountCent int64) (*AccountDTO, error) {
|
||||
err := r.db.Transaction(func(tx *gorm.DB) error {
|
||||
func (r *Repository) Recharge(ctx context.Context, userID uint64, amountCent int64) (*AccountDTO, error) {
|
||||
err := r.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
return AppendEntries(tx, Entry{
|
||||
UserID: userID,
|
||||
Direction: "in",
|
||||
@@ -78,14 +79,14 @@ func (r *Repository) Recharge(userID uint64, amountCent int64) (*AccountDTO, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return r.Account(userID)
|
||||
return r.Account(ctx, userID)
|
||||
}
|
||||
|
||||
func (r *Repository) ConfirmRechargeFromChannel(userID uint64, bizNo string, amountCent int64) error {
|
||||
func (r *Repository) ConfirmRechargeFromChannel(ctx context.Context, userID uint64, bizNo string, amountCent int64) error {
|
||||
if userID == 0 || amountCent <= 0 || bizNo == "" {
|
||||
return ErrInvalidAmount
|
||||
}
|
||||
return r.db.Transaction(func(tx *gorm.DB) error {
|
||||
return r.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
if err := ensureAccount(tx, userID); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -117,11 +118,11 @@ func (r *Repository) ConfirmRechargeFromChannel(userID uint64, bizNo string, amo
|
||||
}
|
||||
|
||||
// Withdraw 保留仓库能力;当前公开提现入口在 service 层标记为待开发,不会调用到这里。
|
||||
func (r *Repository) Withdraw(userID uint64, amountCent int64) (*AccountDTO, error) {
|
||||
func (r *Repository) Withdraw(ctx context.Context, userID uint64, amountCent int64) (*AccountDTO, error) {
|
||||
if userID == 0 || amountCent <= 0 {
|
||||
return nil, ErrInvalidAmount
|
||||
}
|
||||
err := r.db.Transaction(func(tx *gorm.DB) error {
|
||||
err := r.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||
return AppendEntries(tx, Entry{
|
||||
UserID: userID,
|
||||
Direction: "out",
|
||||
@@ -135,11 +136,11 @@ func (r *Repository) Withdraw(userID uint64, amountCent int64) (*AccountDTO, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return r.Account(userID)
|
||||
return r.Account(ctx, userID)
|
||||
}
|
||||
|
||||
func (r *Repository) AdminLedger(query AdminLedgerQuery) (*PaginatedResult, error) {
|
||||
db := r.db.Table("wallet_ledger AS wl").
|
||||
func (r *Repository) AdminLedger(ctx context.Context, query AdminLedgerQuery) (*PaginatedResult, error) {
|
||||
db := r.db.WithContext(ctx).Table("wallet_ledger AS wl").
|
||||
Select(`wl.id, wl.ledger_no, wl.user_id, COALESCE(u.phone, '') AS user_phone,
|
||||
COALESCE(u.nickname, '') AS user_nickname, wl.order_id, COALESCE(ro.order_no, '') AS order_no,
|
||||
wl.direction, wl.amount_cent, wl.balance_after_cent, wl.balance_type, wl.biz_type, wl.biz_no,
|
||||
@@ -147,7 +148,7 @@ func (r *Repository) AdminLedger(query AdminLedgerQuery) (*PaginatedResult, erro
|
||||
Joins("LEFT JOIN users AS u ON u.id = wl.user_id").
|
||||
Joins("LEFT JOIN rental_orders AS ro ON ro.id = wl.order_id")
|
||||
|
||||
countDB := r.db.Model(&model.WalletLedger{})
|
||||
countDB := r.db.WithContext(ctx).Model(&model.WalletLedger{})
|
||||
if query.UserID > 0 {
|
||||
db = db.Where("wl.user_id = ?", query.UserID)
|
||||
countDB = countDB.Where("user_id = ?", query.UserID)
|
||||
@@ -249,12 +250,12 @@ func applyEntry(account *model.WalletAccount, entry Entry) (int64, error) {
|
||||
}
|
||||
return account.FrozenBalanceCent, nil
|
||||
default:
|
||||
return 0, fmt.Errorf("unsupported balance type: %s", entry.BalanceType)
|
||||
return 0, fmt.Errorf("unknown balance type: %s", entry.BalanceType)
|
||||
}
|
||||
}
|
||||
|
||||
func roundWalletMoney(value float64) float64 {
|
||||
return money.Round(value)
|
||||
func roundWalletMoney(yuan float64) float64 {
|
||||
return money.Round(yuan)
|
||||
}
|
||||
|
||||
func toAccountDTO(account model.WalletAccount) *AccountDTO {
|
||||
@@ -266,31 +267,30 @@ func toAccountDTO(account model.WalletAccount) *AccountDTO {
|
||||
}
|
||||
}
|
||||
|
||||
func toLedgerDTO(row model.WalletLedger) LedgerDTO {
|
||||
func toLedgerDTO(ledger model.WalletLedger) LedgerDTO {
|
||||
return LedgerDTO{
|
||||
ID: row.ID,
|
||||
LedgerNo: row.LedgerNo,
|
||||
UserID: row.UserID,
|
||||
OrderID: row.OrderID,
|
||||
Direction: row.Direction,
|
||||
AmountCent: row.AmountCent,
|
||||
BalanceAfterCent: row.BalanceAfterCent,
|
||||
BalanceType: row.BalanceType,
|
||||
BizType: row.BizType,
|
||||
BizNo: row.BizNo,
|
||||
Remark: row.Remark,
|
||||
CreatedAt: row.CreatedAt,
|
||||
ID: ledger.ID,
|
||||
LedgerNo: ledger.LedgerNo,
|
||||
UserID: ledger.UserID,
|
||||
OrderID: ledger.OrderID,
|
||||
Direction: ledger.Direction,
|
||||
AmountCent: ledger.AmountCent,
|
||||
BalanceAfterCent: ledger.BalanceAfterCent,
|
||||
BalanceType: ledger.BalanceType,
|
||||
BizType: ledger.BizType,
|
||||
BizNo: ledger.BizNo,
|
||||
Remark: ledger.Remark,
|
||||
CreatedAt: ledger.CreatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
func newLedgerNo() (string, error) {
|
||||
// 生成格式:WL + YYYYMMDDHHMMSS + 毫秒 + 4位随机数
|
||||
// 例如:WL202606051234561230456,便于用户和客服识别。
|
||||
now := timeutil.ShanghaiNow()
|
||||
buf := make([]byte, 2)
|
||||
if _, err := rand.Read(buf); err != nil {
|
||||
prefix := "WL" + now.Format("20060102150405")
|
||||
randomBytes := make([]byte, 4)
|
||||
if _, err := rand.Read(randomBytes); err != nil {
|
||||
return "", err
|
||||
}
|
||||
randomNum := (int(buf[0])<<8 | int(buf[1])) % 10000
|
||||
return fmt.Sprintf("WL%s%03d%04d", now.Format("20060102150405"), now.Nanosecond()/1_000_000, randomNum), nil
|
||||
suffix := fmt.Sprintf("%08d", uint32(randomBytes[0])<<24|uint32(randomBytes[1])<<16|uint32(randomBytes[2])<<8|uint32(randomBytes[3]))
|
||||
return prefix + suffix[:7], nil
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package wallet
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"hfb_sys/backend/internal/model"
|
||||
@@ -41,9 +42,10 @@ func TestRepositoryAccountCreatesAccountIfNotExists(t *testing.T) {
|
||||
defer cleanupTestDB(t, db)
|
||||
|
||||
repo := NewRepository(db)
|
||||
ctx := context.Background()
|
||||
userID := uint64(1001)
|
||||
|
||||
account, err := repo.Account(userID)
|
||||
account, err := repo.Account(ctx, userID)
|
||||
if err != nil {
|
||||
t.Fatalf("Account() error = %v", err)
|
||||
}
|
||||
@@ -68,10 +70,11 @@ func TestRepositoryRechargeIncreasesAvailableBalance(t *testing.T) {
|
||||
defer cleanupTestDB(t, db)
|
||||
|
||||
repo := NewRepository(db)
|
||||
ctx := context.Background()
|
||||
userID := uint64(1002)
|
||||
|
||||
// 第一次充值
|
||||
account, err := repo.Recharge(userID, 10000)
|
||||
account, err := repo.Recharge(ctx, userID, 10000)
|
||||
if err != nil {
|
||||
t.Fatalf("Recharge() error = %v", err)
|
||||
}
|
||||
@@ -80,7 +83,7 @@ func TestRepositoryRechargeIncreasesAvailableBalance(t *testing.T) {
|
||||
}
|
||||
|
||||
// 第二次充值
|
||||
account, err = repo.Recharge(userID, 5000)
|
||||
account, err = repo.Recharge(ctx, userID, 5000)
|
||||
if err != nil {
|
||||
t.Fatalf("Recharge() error = %v", err)
|
||||
}
|
||||
@@ -89,7 +92,7 @@ func TestRepositoryRechargeIncreasesAvailableBalance(t *testing.T) {
|
||||
}
|
||||
|
||||
// 验证账本记录
|
||||
ledger, err := repo.Ledger(userID, 1, 10)
|
||||
ledger, err := repo.Ledger(ctx, userID, 1, 10)
|
||||
if err != nil {
|
||||
t.Fatalf("Ledger() error = %v", err)
|
||||
}
|
||||
@@ -104,34 +107,35 @@ func TestRepositoryConfirmRechargeFromChannelIsIdempotent(t *testing.T) {
|
||||
defer cleanupTestDB(t, db)
|
||||
|
||||
repo := NewRepository(db)
|
||||
ctx := context.Background()
|
||||
userID := uint64(1003)
|
||||
bizNo := "PAY123456"
|
||||
amount := int64(10000)
|
||||
|
||||
// 第一次确认充值
|
||||
err := repo.ConfirmRechargeFromChannel(userID, bizNo, amount)
|
||||
err := repo.ConfirmRechargeFromChannel(ctx, userID, bizNo, amount)
|
||||
if err != nil {
|
||||
t.Fatalf("第一次 ConfirmRechargeFromChannel() error = %v", err)
|
||||
}
|
||||
|
||||
account, _ := repo.Account(userID)
|
||||
account, _ := repo.Account(ctx, userID)
|
||||
if account.AvailableBalanceCent != amount {
|
||||
t.Fatalf("第一次充值后余额 = %d, want %d", account.AvailableBalanceCent, amount)
|
||||
}
|
||||
|
||||
// 第二次确认充值(相同 bizNo)应该幂等,不重复入账
|
||||
err = repo.ConfirmRechargeFromChannel(userID, bizNo, amount)
|
||||
err = repo.ConfirmRechargeFromChannel(ctx, userID, bizNo, amount)
|
||||
if err != nil {
|
||||
t.Fatalf("第二次 ConfirmRechargeFromChannel() error = %v", err)
|
||||
}
|
||||
|
||||
account, _ = repo.Account(userID)
|
||||
account, _ = repo.Account(ctx, userID)
|
||||
if account.AvailableBalanceCent != amount {
|
||||
t.Fatalf("第二次充值后余额 = %d, want %d(应保持不变)", account.AvailableBalanceCent, amount)
|
||||
}
|
||||
|
||||
// 验证只有一条账本记录
|
||||
ledger, _ := repo.Ledger(userID, 1, 10)
|
||||
ledger, _ := repo.Ledger(ctx, userID, 1, 10)
|
||||
if ledger.Total != 1 {
|
||||
t.Fatalf("账本记录数 = %d, want 1(幂等)", ledger.Total)
|
||||
}
|
||||
@@ -159,7 +163,7 @@ func TestRepositoryConfirmRechargeFromChannelRejectsInvalidParams(t *testing.T)
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
err := repo.ConfirmRechargeFromChannel(tc.userID, tc.bizNo, tc.amount)
|
||||
err := repo.ConfirmRechargeFromChannel(context.Background(), tc.userID, tc.bizNo, tc.amount)
|
||||
if err != tc.wantError {
|
||||
t.Fatalf("error = %v, want %v", err, tc.wantError)
|
||||
}
|
||||
@@ -311,6 +315,7 @@ func TestRepositoryLedgerPagination(t *testing.T) {
|
||||
defer cleanupTestDB(t, db)
|
||||
|
||||
repo := NewRepository(db)
|
||||
ctx := context.Background()
|
||||
userID := uint64(1008)
|
||||
|
||||
// 创建 25 条记录
|
||||
@@ -330,7 +335,7 @@ func TestRepositoryLedgerPagination(t *testing.T) {
|
||||
})
|
||||
|
||||
// 测试第一页
|
||||
page1, err := repo.Ledger(userID, 1, 10)
|
||||
page1, err := repo.Ledger(ctx, userID, 1, 10)
|
||||
if err != nil {
|
||||
t.Fatalf("Ledger() page 1 error = %v", err)
|
||||
}
|
||||
@@ -348,7 +353,7 @@ func TestRepositoryLedgerPagination(t *testing.T) {
|
||||
}
|
||||
|
||||
// 测试第三页
|
||||
page3, err := repo.Ledger(userID, 3, 10)
|
||||
page3, err := repo.Ledger(ctx, userID, 3, 10)
|
||||
if err != nil {
|
||||
t.Fatalf("Ledger() page 3 error = %v", err)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package wallet
|
||||
|
||||
import "errors"
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrDependencyUnavailable = errors.New("dependency unavailable")
|
||||
@@ -21,28 +24,28 @@ func NewService(repo *Repository) *Service {
|
||||
return &Service{repo: repo}
|
||||
}
|
||||
|
||||
func (s *Service) Account(userID uint64) (*AccountDTO, error) {
|
||||
func (s *Service) Account(ctx context.Context, userID uint64) (*AccountDTO, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
return s.repo.Account(userID)
|
||||
return s.repo.Account(ctx, userID)
|
||||
}
|
||||
|
||||
func (s *Service) Ledger(userID uint64, page, pageSize int) (*PaginatedResult, error) {
|
||||
func (s *Service) Ledger(ctx context.Context, userID uint64, page, pageSize int) (*PaginatedResult, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
return s.repo.Ledger(userID, page, pageSize)
|
||||
return s.repo.Ledger(ctx, userID, page, pageSize)
|
||||
}
|
||||
|
||||
func (s *Service) Recharge(userID uint64, req RechargeRequest) (*AccountDTO, error) {
|
||||
func (s *Service) Recharge(ctx context.Context, userID uint64, req RechargeRequest) (*AccountDTO, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
return nil, ErrRechargeDisabled
|
||||
}
|
||||
|
||||
func (s *Service) Withdraw(userID uint64, req WithdrawRequest) (*AccountDTO, error) {
|
||||
func (s *Service) Withdraw(ctx context.Context, userID uint64, req WithdrawRequest) (*AccountDTO, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
@@ -51,9 +54,9 @@ func (s *Service) Withdraw(userID uint64, req WithdrawRequest) (*AccountDTO, err
|
||||
return nil, ErrFeaturePending
|
||||
}
|
||||
|
||||
func (s *Service) AdminLedger(query AdminLedgerQuery) (*PaginatedResult, error) {
|
||||
func (s *Service) AdminLedger(ctx context.Context, query AdminLedgerQuery) (*PaginatedResult, error) {
|
||||
if s.repo == nil {
|
||||
return nil, ErrDependencyUnavailable
|
||||
}
|
||||
return s.repo.AdminLedger(query)
|
||||
return s.repo.AdminLedger(ctx, query)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package wallet
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
@@ -8,7 +9,8 @@ import (
|
||||
// TestServiceAccountWithNilRepo 测试依赖检查
|
||||
func TestServiceAccountWithNilRepo(t *testing.T) {
|
||||
svc := &Service{repo: nil}
|
||||
_, err := svc.Account(1)
|
||||
ctx := context.Background()
|
||||
_, err := svc.Account(ctx, 1)
|
||||
if !errors.Is(err, ErrDependencyUnavailable) {
|
||||
t.Fatalf("Account() error = %v, want ErrDependencyUnavailable", err)
|
||||
}
|
||||
@@ -16,7 +18,8 @@ func TestServiceAccountWithNilRepo(t *testing.T) {
|
||||
|
||||
func TestServiceLedgerWithNilRepo(t *testing.T) {
|
||||
svc := &Service{repo: nil}
|
||||
_, err := svc.Ledger(1, 1, 10)
|
||||
ctx := context.Background()
|
||||
_, err := svc.Ledger(ctx, 1, 1, 10)
|
||||
if !errors.Is(err, ErrDependencyUnavailable) {
|
||||
t.Fatalf("Ledger() error = %v, want ErrDependencyUnavailable", err)
|
||||
}
|
||||
@@ -24,7 +27,8 @@ func TestServiceLedgerWithNilRepo(t *testing.T) {
|
||||
|
||||
func TestServiceRechargeIsDisabled(t *testing.T) {
|
||||
svc := &Service{repo: &Repository{}}
|
||||
_, err := svc.Recharge(1, RechargeRequest{AmountCent: 100})
|
||||
ctx := context.Background()
|
||||
_, err := svc.Recharge(ctx, 1, RechargeRequest{AmountCent: 100})
|
||||
if !errors.Is(err, ErrRechargeDisabled) {
|
||||
t.Fatalf("Recharge() error = %v, want ErrRechargeDisabled", err)
|
||||
}
|
||||
@@ -32,7 +36,8 @@ func TestServiceRechargeIsDisabled(t *testing.T) {
|
||||
|
||||
func TestServiceWithdrawIsPending(t *testing.T) {
|
||||
svc := &Service{repo: &Repository{}}
|
||||
_, err := svc.Withdraw(1, WithdrawRequest{AmountCent: 100})
|
||||
ctx := context.Background()
|
||||
_, err := svc.Withdraw(ctx, 1, WithdrawRequest{AmountCent: 100})
|
||||
if !errors.Is(err, ErrFeaturePending) {
|
||||
t.Fatalf("Withdraw() error = %v, want ErrFeaturePending", err)
|
||||
}
|
||||
@@ -40,7 +45,8 @@ func TestServiceWithdrawIsPending(t *testing.T) {
|
||||
|
||||
func TestServiceAdminLedgerWithNilRepo(t *testing.T) {
|
||||
svc := &Service{repo: nil}
|
||||
_, err := svc.AdminLedger(AdminLedgerQuery{Page: 1, PageSize: 10})
|
||||
ctx := context.Background()
|
||||
_, err := svc.AdminLedger(ctx, AdminLedgerQuery{Page: 1, PageSize: 10})
|
||||
if !errors.Is(err, ErrDependencyUnavailable) {
|
||||
t.Fatalf("AdminLedger() error = %v, want ErrDependencyUnavailable", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user