Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
17daf48d
Commit
17daf48d
authored
Jan 13, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
0983b672
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
go/neo/neonet/connection_test.go
go/neo/neonet/connection_test.go
+8
-10
No files found.
go/neo/neonet/connection_test.go
View file @
17daf48d
...
...
@@ -51,16 +51,6 @@ type T struct {
enc
proto
.
Encoding
// encoding to use for messages exchange
}
// bin returns payload for raw binary data as it would-be encoded by t.enc .
// XXX place
func
(
t
*
T
)
bin
(
data
string
)
[]
byte
{
switch
t
.
enc
{
case
'N'
:
return
[]
byte
(
data
)
case
'M'
:
return
msgp
.
AppendBytes
(
nil
,
[]
byte
(
data
))
default
:
panic
(
"bug"
)
}
}
// Verify tests f for all possible environments.
func
Verify
(
t
*
testing
.
T
,
f
func
(
*
T
))
{
// for each encoding
...
...
@@ -71,6 +61,14 @@ func Verify(t *testing.T, f func(*T)) {
}
}
// bin returns payload for raw binary data as it would-be encoded by t.enc .
func
(
t
*
T
)
bin
(
data
string
)
[]
byte
{
switch
t
.
enc
{
case
'N'
:
return
[]
byte
(
data
)
case
'M'
:
return
msgp
.
AppendBytes
(
nil
,
[]
byte
(
data
))
default
:
panic
(
"bug"
)
}
}
func
xclose
(
c
io
.
Closer
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment