package service import ( "testing" "github.com/mhsanaei/3x-ui/v3/internal/database" "github.com/mhsanaei/3x-ui/v3/internal/database/model" "github.com/mhsanaei/3x-ui/v3/internal/xray" ) // Shared helpers for the surviving MTProto/AmneziaWG pure-logic tests. // They used to live in mtproto_fake_test.go alongside the fake mtg child // machinery; the fake went away with the local-core runtime tests in // P9(4b), these seeders are still used by other tests. const ( mtprotoTestSecretA = "ee00112233445566778899aabbccddeeff6578616d706c652e636f6d" mtprotoTestSecretB = "ee101112131415161718191a1b1c1d1e1f6578616d706c652e636f6d" mtprotoTestSecretC = "ee202122232425262728292a2b2c2d2e2f6578616d706c652e636f6d" mtprotoTestSecretD = "ee303132333435363738393a3b3c3d3e3f6578616d706c652e636f6d" ) func seedClientTraffic(t *testing.T, inboundId int, email string, enable bool) { t.Helper() row := xray.ClientTraffic{InboundId: inboundId, Email: email, Enable: enable} if err := database.GetDB().Create(&row).Error; err != nil { t.Fatalf("seed traffic %s: %v", email, err) } } func loadInboundByTag(t *testing.T, tag string) *model.Inbound { t.Helper() var ib model.Inbound if err := database.GetDB().Where("tag = ?", tag).First(&ib).Error; err != nil { t.Fatalf("load inbound %s: %v", tag, err) } return &ib }