Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
d2e75cc9
Commit
d2e75cc9
authored
Mar 15, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning up unused code
parent
c87cc59b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
108 deletions
+0
-108
rand.go
ethutil/rand.go
+0
-24
rand_test.go
ethutil/rand_test.go
+0
-17
script_unix.go
ethutil/script_unix.go
+0
-19
script_windows.go
ethutil/script_windows.go
+0
-12
set.go
ethutil/set.go
+0
-36
No files found.
ethutil/rand.go
deleted
100644 → 0
View file @
c87cc59b
package
ethutil
import
(
"crypto/rand"
"encoding/binary"
"io"
)
func
randomUint64
(
r
io
.
Reader
)
(
uint64
,
error
)
{
b
:=
make
([]
byte
,
8
)
n
,
err
:=
r
.
Read
(
b
)
if
n
!=
len
(
b
)
{
return
0
,
io
.
ErrShortBuffer
}
if
err
!=
nil
{
return
0
,
err
}
return
binary
.
BigEndian
.
Uint64
(
b
),
nil
}
// RandomUint64 returns a cryptographically random uint64 value.
func
RandomUint64
()
(
uint64
,
error
)
{
return
randomUint64
(
rand
.
Reader
)
}
ethutil/rand_test.go
deleted
100644 → 0
View file @
c87cc59b
package
ethutil
import
(
checker
"gopkg.in/check.v1"
)
type
RandomSuite
struct
{}
var
_
=
checker
.
Suite
(
&
RandomSuite
{})
func
(
s
*
RandomSuite
)
TestRandomUint64
(
c
*
checker
.
C
)
{
res1
,
_
:=
RandomUint64
()
res2
,
_
:=
RandomUint64
()
c
.
Assert
(
res1
,
checker
.
NotNil
)
c
.
Assert
(
res2
,
checker
.
NotNil
)
c
.
Assert
(
res1
,
checker
.
Not
(
checker
.
Equals
),
res2
)
}
ethutil/script_unix.go
deleted
100644 → 0
View file @
c87cc59b
// +build !windows
package
ethutil
import
"github.com/ethereum/serpent-go"
// General compile function
func
Compile
(
script
string
,
silent
bool
)
(
ret
[]
byte
,
err
error
)
{
if
len
(
script
)
>
2
{
byteCode
,
err
:=
serpent
.
Compile
(
script
)
if
err
!=
nil
{
return
nil
,
err
}
return
byteCode
,
nil
}
return
nil
,
nil
}
ethutil/script_windows.go
deleted
100644 → 0
View file @
c87cc59b
// +build windows
package
ethutil
// General compile function
func
Compile
(
script
string
,
silent
bool
)
(
ret
[]
byte
,
err
error
)
{
if
len
(
script
)
>
2
{
return
nil
,
nil
}
return
nil
,
nil
}
ethutil/set.go
deleted
100644 → 0
View file @
c87cc59b
package
ethutil
type
Settable
interface
{
AsSet
()
UniqueSet
}
type
Stringable
interface
{
String
()
string
}
type
UniqueSet
map
[
string
]
struct
{}
func
NewSet
(
v
...
Stringable
)
UniqueSet
{
set
:=
make
(
UniqueSet
)
for
_
,
val
:=
range
v
{
set
.
Insert
(
val
)
}
return
set
}
func
(
self
UniqueSet
)
Insert
(
k
Stringable
)
UniqueSet
{
self
[
k
.
String
()]
=
struct
{}{}
return
self
}
func
(
self
UniqueSet
)
Include
(
k
Stringable
)
bool
{
_
,
ok
:=
self
[
k
.
String
()]
return
ok
}
func
Set
(
s
Settable
)
UniqueSet
{
return
s
.
AsSet
()
}
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