fix(rpc): sync verification icon envelope coverage

Follow up gramsrv#27 with the remaining peer-bearing messages.Messages boundaries and route-level wire regression coverage from the telesrv canonical implementation.

Origin-PR: gramsrv#27
Origin-Head: f0bd6c9699
Origin-Merge: 7713847b2a
Canonical: f1ba406015a2d5e37802b963757a5cac8ee3eb0e

Co-authored-by: epilepticseizureee <business.egor.sg@gmail.com>
This commit is contained in:
iamxvbaba 2026-07-30 14:06:39 +08:00
parent 7713847b2a
commit 3fa0c6f1e4
12 changed files with 156 additions and 16 deletions

View file

@ -835,9 +835,11 @@ func TestChannelsSearchPostsReturnsPublicPostsWithSeekPaging(t *testing.T) {
viewer, _ := userStore.Create(ctx, domain.User{AccessHash: 91002, Phone: "15550091002", FirstName: "Viewer"})
channelStore := memory.NewChannelStore()
channelService := appchannels.NewService(channelStore)
verify := newFakeBotVerifications()
r := New(Config{}, Deps{
Users: appusers.NewService(userStore),
Channels: channelService,
Users: appusers.NewService(userStore),
Channels: channelService,
BotVerifications: verify,
}, zaptest.NewLogger(t), clock.System)
public, err := channelService.CreateChannel(ctx, owner.ID, domain.CreateChannelRequest{
Title: "Public Search",
@ -847,6 +849,14 @@ func TestChannelsSearchPostsReturnsPublicPostsWithSeekPaging(t *testing.T) {
if err != nil {
t.Fatalf("create public channel: %v", err)
}
const searchPostsIcon = int64(8800021)
searchPostsPeer := domain.Peer{Type: domain.PeerTypeChannel, ID: public.Channel.ID}
verify.marks[searchPostsPeer] = domain.CustomVerification{
VerifierBotID: 777000123,
Peer: searchPostsPeer,
IconDocumentID: searchPostsIcon,
Description: "Verified search result",
}
if _, err := channelService.UpdateUsername(ctx, owner.ID, domain.UpdateChannelUsernameRequest{
UserID: owner.ID,
ChannelID: public.Channel.ID,
@ -920,6 +930,7 @@ func TestChannelsSearchPostsReturnsPublicPostsWithSeekPaging(t *testing.T) {
if peer, ok := first.PeerID.(*tg.PeerChannel); !ok || peer.ChannelID != public.Channel.ID {
t.Fatalf("first result peer = %#v, want public channel %d", first.PeerID, public.Channel.ID)
}
assertMessagesEnvelopeBotVerificationIcon(t, got, searchPostsPeer, searchPostsIcon)
page2 := &tg.ChannelsSearchPostsRequest{
OffsetRate: slice.NextRate,