docs(gateway): gateway 剩余文件注释改中文(逐行 1:1,代码零字节改动)
主人 2026-10-03 拍板「注释一律中文」;gateway 至此整包注释中文化完成(本会话共 3 批: 已推库 16 个文件 + 本批剩余文件)。 校验:机械校验(非注释改动行)= 空;剥注释后代码文本逐行比对全等(不一致文件数 0); 全树 go test ./... 58 包 ok / 0 FAIL;交叉编译绿。
This commit is contained in:
1 parent
91e8d7a029
commit
074ffc4ebf
73 files changed
+2529
-2529
No files matched your search
@@ -7,7 +7,7 @@ import (
|
||||
capreg "git.yeij.top/AskaEth/Cyrene_v2/internal/capability/registry"
|
||||
)
|
||||
|
||||
// testChannel is a bare sdk.Channel used to exercise findChannel resolution.
|
||||
// testChannel 是一个裸 sdk.Channel,用于演练 findChannel 的解析。
|
||||
type testChannel struct{ name string }
|
||||
|
||||
func (t testChannel) Name() string { return t.name }
|
||||
@@ -18,7 +18,7 @@ func (t testChannel) Disconnect(context.Context) error { return nil }
|
||||
func (t testChannel) IsConnected() bool { return false }
|
||||
func (t testChannel) HealthCheck(context.Context) error { return nil }
|
||||
|
||||
// TestFindChannelExactMatch prefers an exact adapter name over a bare-name match.
|
||||
// TestFindChannelExactMatch 优先精确适配器名而非裸名匹配。
|
||||
func TestFindChannelExactMatch(t *testing.T) {
|
||||
reg := capreg.New()
|
||||
_ = reg.Register(capreg.Capability{Name: "kook:conf0", Kind: capreg.KindChannel, Value: testChannel{name: "kook:conf0"}})
|
||||
@@ -33,10 +33,10 @@ func TestFindChannelExactMatch(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestFindChannelBarePlatformResolvesToTokenAccount verifies a bare platform name
|
||||
// ("kook") that is not an exact adapter name resolves to that platform's first
|
||||
// registered account (the token-bearing one, since the empty-token bare account
|
||||
// is never registered).
|
||||
// TestFindChannelBarePlatformResolvesToTokenAccount 验证非精确适配器名的
|
||||
// 裸平台名("kook")会解析到该平台首个已注册账号
|
||||
// (即携带 token 的那个,因为空 token 的裸账号
|
||||
// 从不注册)。
|
||||
func TestFindChannelBarePlatformResolvesToTokenAccount(t *testing.T) {
|
||||
reg := capreg.New()
|
||||
_ = reg.Register(capreg.Capability{Name: "kook:3fc8", Kind: capreg.KindChannel, Value: testChannel{name: "kook:3fc8"}})
|
||||
@@ -46,7 +46,7 @@ func TestFindChannelBarePlatformResolvesToTokenAccount(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestFindChannelUnknownOrBlank rejects a name that matches no channel.
|
||||
// TestFindChannelUnknownOrBlank 拒绝不匹配任何渠道的名字。
|
||||
func TestFindChannelUnknownOrBlank(t *testing.T) {
|
||||
reg := capreg.New()
|
||||
_ = reg.Register(capreg.Capability{Name: "kook:conf0", Kind: capreg.KindChannel, Value: testChannel{name: "kook:conf0"}})
|
||||
@@ -56,7 +56,7 @@ func TestFindChannelUnknownOrBlank(t *testing.T) {
|
||||
if _, ok := findChannel(reg, ""); ok {
|
||||
t.Fatal("blank name should not be found")
|
||||
}
|
||||
// Skipped: non-channel capabilities must not match.
|
||||
// 已跳过:非渠道能力不得匹配。
|
||||
_ = reg.Register(capreg.Capability{Name: "some-tool", Kind: capreg.KindTool, Value: testChannel{name: "some-tool"}})
|
||||
if _, ok := findChannel(reg, "some-tool"); ok {
|
||||
t.Fatal("non-channel capability must not match findChannel")
|
||||
|
||||
Reference in new issue
Block a user