mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-18 23:00:12 +00:00
Fix test break
This commit is contained in:
1 parent
075753c030
commit
b40be74b86
15 files changed
+50
-48
No files matched your search
@@ -1,21 +1,21 @@
|
||||
package mocks
|
||||
|
||||
import (
|
||||
"github.com/v2ray/v2ray-core/proxy/vmess/protocol"
|
||||
"github.com/v2ray/v2ray-core/proxy/vmess/protocol/user"
|
||||
)
|
||||
|
||||
type MockUserSet struct {
|
||||
UserIds []protocol.ID
|
||||
UserIds []user.ID
|
||||
UserHashes map[string]int
|
||||
Timestamps map[string]int64
|
||||
}
|
||||
|
||||
func (us *MockUserSet) AddUser(user protocol.User) error {
|
||||
func (us *MockUserSet) AddUser(user user.User) error {
|
||||
us.UserIds = append(us.UserIds, user.Id)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (us *MockUserSet) GetUser(userhash []byte) (*protocol.ID, int64, bool) {
|
||||
func (us *MockUserSet) GetUser(userhash []byte) (*user.ID, int64, bool) {
|
||||
idx, found := us.UserHashes[string(userhash)]
|
||||
if found {
|
||||
return &us.UserIds[idx], us.Timestamps[string(userhash)], true
|
||||
|
||||
Reference in new issue
Block a user