Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TGlimmer/TG_walletbot
/ functions
Functions
2,200 in github.com/TGlimmer/TG_walletbot
⨍
Functions
2,200
◇
Types & classes
325
Function
TestCommonWeakSecrets_不区分大小写
TestCommonWeakSecrets_不区分大小写 验证弱密钥检测不区分大小写
internal/infrastructure/config/config_test.go:102
Function
TestConfigHandler_List_Empty
TestConfigHandler_List_Empty 测试空配置列表
internal/adapter/handler/admin_config_test.go:51
Function
TestConfigHandler_List_Error
TestConfigHandler_List_Error 测试获取配置失败
internal/adapter/handler/admin_config_test.go:69
Function
TestConfigHandler_List_Success
--- AdminConfigHandler 测试 --- TestConfigHandler_List_Success 测试获取配置列表成功
internal/adapter/handler/admin_config_test.go:20
Function
TestConfigHandler_Update_EmptyBody
TestConfigHandler_Update_EmptyBody 测试更新配置 - 空请求体
internal/adapter/handler/admin_config_test.go:145
Function
TestConfigHandler_Update_Error
TestConfigHandler_Update_Error 测试更新配置 - 内部错误
internal/adapter/handler/admin_config_test.go:160
Function
TestConfigHandler_Update_MissingKey
TestConfigHandler_Update_MissingKey 测试更新配置 - 缺少 key
internal/adapter/handler/admin_config_test.go:113
Function
TestConfigHandler_Update_MissingValue
TestConfigHandler_Update_MissingValue 测试更新配置 - 缺少 value
internal/adapter/handler/admin_config_test.go:129
Function
TestConfigHandler_Update_Success
TestConfigHandler_Update_Success 测试更新配置成功
internal/adapter/handler/admin_config_test.go:87
Function
TestConstants
---------- 常量值验证 ----------
pkg/pagination/pagination_test.go:278
Function
TestConvertBlock_nil和空区块
TestConvertBlock_nil和空区块 验证 nil/空区块的处理
internal/infrastructure/tron/grpc_client_test.go:255
Function
TestConvertBlock_交易无RawData
TestConvertBlock_交易无RawData 验证交易无 RawData 时不解析合约
internal/infrastructure/tron/grpc_client_test.go:497
Function
TestConvertBlock_包含TRC20触发
TestConvertBlock_包含TRC20触发 验证 TriggerSmartContract 的转换
internal/infrastructure/tron/grpc_client_test.go:343
Function
TestConvertBlock_包含TRX转账
TestConvertBlock_包含TRX转账 验证 TransferContract 的转换
internal/infrastructure/tron/grpc_client_test.go:279
Function
TestConvertBlock_跳过nil交易
TestConvertBlock_跳过nil交易 验证 nil TransactionExtention 被跳过
internal/infrastructure/tron/grpc_client_test.go:476
Function
TestConvertContract_忽略其他合约类型
TestConvertContract_忽略其他合约类型 验证非 Transfer/Trigger 类型返回 nil
internal/infrastructure/tron/grpc_client_test.go:405
Function
TestConvertContract_无效protobuf数据
TestConvertContract_无效protobuf数据 验证反序列化失败时返回 nil
internal/infrastructure/tron/grpc_client_test.go:446
Function
TestCreated
---------- Created 测试 ----------
pkg/response/response_test.go:85
Function
TestCryptoService_不同密钥解密失败
TestCryptoService_不同密钥解密失败 验证使用不同的加密密钥解密应报错
internal/infrastructure/tron/crypto_test.go:69
Function
TestCryptoService_加密解密往返
TestCryptoService_加密解密往返 验证 scrypt 加密后解密能正确返回原始私钥
internal/infrastructure/tron/crypto_test.go:18
Function
TestCryptoService_密文是ScryptBase64格式
TestCryptoService_密文是ScryptBase64格式 验证加密结果是 scrypt 前缀 + 有效的 base64 字符串
internal/infrastructure/tron/crypto_test.go:87
Function
TestCryptoService_截断密文解密失败
TestCryptoService_截断密文解密失败 验证被篡改或截断的密文解密失败
internal/infrastructure/tron/crypto_test.go:197
Function
TestCryptoService_损坏密文_scrypt格式
--- 补充测试: 空输入/损坏密文异常处理 --- TestCryptoService_损坏密文_scrypt格式 验证各种损坏的 scrypt 格式密文
internal/infrastructure/tron/crypto_test.go:388
Function
TestCryptoService_损坏密文_旧格式
TestCryptoService_损坏密文_旧格式 验证各种损坏的旧格式密文
internal/infrastructure/tron/crypto_test.go:457
Function
TestCryptoService_新旧格式互操作
TestCryptoService_新旧格式互操作 验证新加密的数据无法被旧方式解密(安全性提升)
internal/infrastructure/tron/crypto_test.go:172
Function
TestCryptoService_新格式_空私钥
TestCryptoService_新格式_空私钥 验证空私钥字符串的加密解密
internal/infrastructure/tron/crypto_test.go:283
Function
TestCryptoService_新格式加密解密_不同私钥长度
--- 补充测试: 新格式 scrypt 加密解密 --- TestCryptoService_新格式加密解密_不同私钥长度 验证各种长度私钥的加密解密
internal/infrastructure/tron/crypto_test.go:239
Function
TestCryptoService_新格式密文结构
TestCryptoService_新格式密文结构 验证 scrypt 密文的内部数据结构
internal/infrastructure/tron/crypto_test.go:538
Function
TestCryptoService_新格式错误密钥_微小差异
--- 补充测试: 错误密钥解密失败 --- TestCryptoService_新格式错误密钥_微小差异 验证加密密钥的敏感性 (微小差异即解密失败)
internal/infrastructure/tron/crypto_test.go:355
Function
TestCryptoService_旧格式不可被新密钥解密
TestCryptoService_旧格式不可被新密钥解密 验证旧格式密文的密钥绑定性
internal/infrastructure/tron/crypto_test.go:338
Function
TestCryptoService_旧格式兼容_多种密钥
--- 补充测试: 旧格式兼容性 --- TestCryptoService_旧格式兼容_多种密钥 验证各种加密密钥下旧格式均可解密
internal/infrastructure/tron/crypto_test.go:298
Function
TestCryptoService_旧格式兼容解密
TestCryptoService_旧格式兼容解密 验证能正确解密旧版 SHA256 格式的密文
internal/infrastructure/tron/crypto_test.go:137
Function
TestCryptoService_旧格式错误密钥失败
TestCryptoService_旧格式错误密钥失败 验证旧格式使用错误密钥解密失败
internal/infrastructure/tron/crypto_test.go:156
Function
TestCryptoService_格式路由正确
TestCryptoService_格式路由正确 验证 DecryptPrivateKey 根据前缀正确路由到 scrypt 或 legacy
internal/infrastructure/tron/crypto_test.go:513
Function
TestCryptoService_每次加密结果不同
TestCryptoService_每次加密结果不同 验证由于随机 salt+nonce,相同输入每次加密结果不同
internal/infrastructure/tron/crypto_test.go:109
Function
TestCurrencyConstants
(t *testing.T)
internal/domain/entity/entity_test.go:337
Function
TestDashboardHandler_New
--- DashboardHandler 测试 --- DashboardHandler.Stats 内部调用 AdminUseCase.GetDashboardStats, 该方法大量使用 uc.db 直接查询,在无真实 DB 的单元测试环境中会 panic。 因此 Dashboard 的完整测试
internal/adapter/handler/admin_dashboard_test.go:15
Function
TestDepositMonitor_AddAddress
--- AddAddress / addressCount / SetPollInterval 测试 --- TestDepositMonitor_AddAddress 验证动态添加监控地址
internal/infrastructure/tron/monitor_test.go:512
Function
TestDepositMonitor_AddAddress_并发安全
--- 并发安全测试 --- TestDepositMonitor_AddAddress_并发安全 验证并发添加地址
internal/infrastructure/tron/monitor_test.go:622
Function
TestDepositMonitor_SetPollInterval
TestDepositMonitor_SetPollInterval 验证轮询间隔设置
internal/infrastructure/tron/monitor_test.go:554
Function
TestDepositMonitor_addressCount
TestDepositMonitor_addressCount 验证 addressCount 正确计数
internal/infrastructure/tron/monitor_test.go:537
Function
TestDepositMonitor_并发读写安全
TestDepositMonitor_并发读写安全 验证并发读取和写入地址缓存
internal/infrastructure/tron/monitor_test.go:643
Function
TestDepositService_GetRequiredConfirmations_从配置读取
==================== GetRequiredConfirmations 测试 ====================
internal/domain/service/deposit_service_test.go:28
Function
TestDepositService_GetRequiredConfirmations_配置不存在使用默认
(t *testing.T)
internal/domain/service/deposit_service_test.go:39
Function
TestDepositService_GetRequiredConfirmations_配置值无效使用默认
(t *testing.T)
internal/domain/service/deposit_service_test.go:50
Function
TestDepositService_GetUserDepositAddress_成功
==================== GetUserDepositAddress 测试 ====================
internal/domain/service/deposit_service_test.go:228
Function
TestDepositService_GetUserDepositAddress_查询失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:352
Function
TestDepositService_GetUserDepositAddress_钱包不存在
(t *testing.T)
internal/domain/service/deposit_service_test.go:241
Function
TestDepositService_ListPendingDeposits_成功
==================== ListPendingDeposits 测试 ====================
internal/domain/service/deposit_service_test.go:256
Function
TestDepositService_ListPendingDeposits_空列表
(t *testing.T)
internal/domain/service/deposit_service_test.go:272
Function
TestDepositService_ProcessDeposit_入账后创建流水失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:332
Function
TestDepositService_ProcessDeposit_入账后更新余额失败
==================== 额外边界测试 ====================
internal/domain/service/deposit_service_test.go:312
Function
TestDepositService_ProcessDeposit_入账后更新状态为已到账失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:420
Function
TestDepositService_ProcessDeposit_创建记录失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:208
Function
TestDepositService_ProcessDeposit_新充值_确认数不足
==================== ProcessDeposit 测试 ====================
internal/domain/service/deposit_service_test.go:63
Function
TestDepositService_ProcessDeposit_新充值_确认数达标直接入账
(t *testing.T)
internal/domain/service/deposit_service_test.go:86
Function
TestDepositService_ProcessDeposit_未知充值地址
(t *testing.T)
internal/domain/service/deposit_service_test.go:179
Function
TestDepositService_ProcessDeposit_查询交易哈希失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:194
Function
TestDepositService_ProcessDeposit_重复交易_入账时查询钱包失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:442
Function
TestDepositService_ProcessDeposit_重复交易_更新状态失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:392
Function
TestDepositService_ProcessDeposit_重复交易_更新确认数失败
==================== updateConfirmations 边界测试 ====================
internal/domain/service/deposit_service_test.go:367
Function
TestDepositService_ProcessDeposit_重复交易_确认数未增加
(t *testing.T)
internal/domain/service/deposit_service_test.go:161
Function
TestDepositService_ProcessDeposit_重复交易哈希_已入账
(t *testing.T)
internal/domain/service/deposit_service_test.go:110
Function
TestDepositService_ProcessDeposit_重复交易哈希_更新确认数
(t *testing.T)
internal/domain/service/deposit_service_test.go:128
Function
TestDepositService_SetUserDepositAddress_成功
==================== SetUserDepositAddress 测试 ====================
internal/domain/service/deposit_service_test.go:286
Function
TestDepositService_SetUserDepositAddress_更新失败
(t *testing.T)
internal/domain/service/deposit_service_test.go:298
Function
TestDepositStatusConstants
(t *testing.T)
internal/domain/entity/entity_test.go:481
Function
TestDepositUseCase_GetDepositInfo_成功
==================== GetDepositInfo 测试 ====================
internal/app/deposit_usecase_test.go:34
Function
TestDepositUseCase_GetDepositInfo_无充值地址
(t *testing.T)
internal/app/deposit_usecase_test.go:49
Function
TestDepositUseCase_GetDepositInfo_查询失败
(t *testing.T)
internal/app/deposit_usecase_test.go:63
Function
TestDepositUseCase_ListPendingDeposits_成功
==================== ListPendingDeposits 测试 ====================
internal/app/deposit_usecase_test.go:178
Function
TestDepositUseCase_ProcessChainDeposit_入账后查询余额失败
(t *testing.T)
internal/app/deposit_usecase_test.go:153
Function
TestDepositUseCase_ProcessChainDeposit_入账成功发送通知
(t *testing.T)
internal/app/deposit_usecase_test.go:94
Function
TestDepositUseCase_ProcessChainDeposit_处理失败
(t *testing.T)
internal/app/deposit_usecase_test.go:123
Function
TestDepositUseCase_ProcessChainDeposit_已入账不通知
(t *testing.T)
internal/app/deposit_usecase_test.go:135
Function
TestDepositUseCase_ProcessChainDeposit_新充值待确认
==================== ProcessChainDeposit 测试 ====================
internal/app/deposit_usecase_test.go:77
Function
TestDeposit_IsCredited
(t *testing.T)
internal/domain/entity/entity_test.go:460
Function
TestDeposit_TableName
============================================================================= Deposit 实体测试 ===========================================================
internal/domain/entity/entity_test.go:453
Function
TestEncodeTRC20Transfer_大金额
TestEncodeTRC20Transfer_大金额 验证大金额的 uint256 编码
internal/infrastructure/tron/transaction_test.go:213
Function
TestEncodeTRC20Transfer_编码正确性
--- encodeTRC20Transfer 测试 --- TestEncodeTRC20Transfer_编码正确性 验证 ABI 编码参数格式
internal/infrastructure/tron/transaction_test.go:192
Function
TestError
---------- Error 测试 ----------
pkg/response/response_test.go:141
Function
TestErrorFromAppError
---------- ErrorFromAppError 测试 ----------
pkg/response/response_test.go:181
Function
TestErrorsAs_AppError
(t *testing.T)
pkg/errors/errors_test.go:162
Function
TestErrorsAs_NestedWrap
(t *testing.T)
pkg/errors/errors_test.go:173
Function
TestErrorsIs_DifferentSentinels
(t *testing.T)
pkg/errors/errors_test.go:156
Function
TestErrorsIs_SentinelDirect
(t *testing.T)
pkg/errors/errors_test.go:145
Function
TestErrorsIs_WithWrappedSentinel
---------- errors.Is / errors.As 兼容性测试 ----------
pkg/errors/errors_test.go:138
Function
TestExchangePair_结构完整性
==================== ExchangePair 结构验证 ====================
internal/domain/service/exchange_service_test.go:419
Function
TestExchangeRateHandler_List_Empty
TestExchangeRateHandler_List_Empty 测试空汇率列表
internal/adapter/handler/admin_exchange_rate_test.go:63
Function
TestExchangeRateHandler_List_Error
TestExchangeRateHandler_List_Error 测试获取汇率列表失败
internal/adapter/handler/admin_exchange_rate_test.go:83
Function
TestExchangeRateHandler_List_Success
--- AdminExchangeRateHandler 测试 --- TestExchangeRateHandler_List_Success 测试获取汇率列表成功
internal/adapter/handler/admin_exchange_rate_test.go:21
Function
TestExchangeRateHandler_Update_InternalError
TestExchangeRateHandler_Update_InternalError 测试更新汇率 - 内部错误
internal/adapter/handler/admin_exchange_rate_test.go:250
Function
TestExchangeRateHandler_Update_InvalidRate
TestExchangeRateHandler_Update_InvalidRate 测试更新汇率 - 无效汇率值
internal/adapter/handler/admin_exchange_rate_test.go:147
Function
TestExchangeRateHandler_Update_MissingFields
TestExchangeRateHandler_Update_MissingFields 测试更新汇率 - 缺少必填字段
internal/adapter/handler/admin_exchange_rate_test.go:131
Function
TestExchangeRateHandler_Update_NonNumericRate
TestExchangeRateHandler_Update_NonNumericRate 测试更新汇率 - 非数字汇率
internal/adapter/handler/admin_exchange_rate_test.go:187
Function
TestExchangeRateHandler_Update_Success
TestExchangeRateHandler_Update_Success 测试更新汇率成功
internal/adapter/handler/admin_exchange_rate_test.go:101
Function
TestExchangeRateHandler_Update_WithOptionalFields
TestExchangeRateHandler_Update_WithOptionalFields 测试更新汇率 - 携带可选字段
internal/adapter/handler/admin_exchange_rate_test.go:207
Function
TestExchangeRateHandler_Update_ZeroRate
TestExchangeRateHandler_Update_ZeroRate 测试更新汇率 - 零汇率
internal/adapter/handler/admin_exchange_rate_test.go:167
Function
TestExchangeRate_EffectiveRate
(t *testing.T)
internal/domain/entity/entity_test.go:642
Function
TestExchangeRate_TableName
============================================================================= ExchangeRate 实体测试 ======================================================
internal/domain/entity/entity_test.go:635
← previous
next →
1,401–1,500 of 2,200, ranked by callers