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
3db9c800
Commit
3db9c800
authored
10 years ago
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed mutan. Closes #183
parent
085f604b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
69 deletions
+11
-69
script_unix.go
ethutil/script_unix.go
+6
-36
script_windows.go
ethutil/script_windows.go
+1
-22
vm_test.go
vm/vm_test.go
+4
-11
No files found.
ethutil/script_unix.go
View file @
3db9c800
...
...
@@ -2,47 +2,17 @@
package
ethutil
import
(
"fmt"
"strings"
"github.com/ethereum/serpent-go"
"github.com/obscuren/mutan"
"github.com/obscuren/mutan/backends"
)
import
"github.com/ethereum/serpent-go"
// General compile function
func
Compile
(
script
string
,
silent
bool
)
(
ret
[]
byte
,
err
error
)
{
if
len
(
script
)
>
2
{
line
:=
strings
.
Split
(
script
,
"
\n
"
)[
0
]
if
len
(
line
)
>
1
&&
line
[
0
:
2
]
==
"#!"
{
switch
line
{
case
"#!serpent"
:
byteCode
,
err
:=
serpent
.
Compile
(
script
)
if
err
!=
nil
{
return
nil
,
err
}
return
byteCode
,
nil
}
}
else
{
compiler
:=
mutan
.
NewCompiler
(
backend
.
NewEthereumBackend
())
compiler
.
Silent
=
silent
byteCode
,
errors
:=
compiler
.
Compile
(
strings
.
NewReader
(
script
))
if
len
(
errors
)
>
0
{
var
errs
string
for
_
,
er
:=
range
errors
{
if
er
!=
nil
{
errs
+=
er
.
Error
()
}
}
return
nil
,
fmt
.
Errorf
(
"%v"
,
errs
)
}
return
byteCode
,
nil
byteCode
,
err
:=
serpent
.
Compile
(
script
)
if
err
!=
nil
{
return
nil
,
err
}
return
byteCode
,
nil
}
return
nil
,
nil
...
...
This diff is collapsed.
Click to expand it.
ethutil/script_windows.go
View file @
3db9c800
...
...
@@ -2,31 +2,10 @@
package
ethutil
import
(
"fmt"
"strings"
"github.com/obscuren/mutan"
"github.com/obscuren/mutan/backends"
)
// General compile function
func
Compile
(
script
string
,
silent
bool
)
(
ret
[]
byte
,
err
error
)
{
if
len
(
script
)
>
2
{
compiler
:=
mutan
.
NewCompiler
(
backend
.
NewEthereumBackend
())
compiler
.
Silent
=
silent
byteCode
,
errors
:=
compiler
.
Compile
(
strings
.
NewReader
(
script
))
if
len
(
errors
)
>
0
{
var
errs
string
for
_
,
er
:=
range
errors
{
if
er
!=
nil
{
errs
+=
er
.
Error
()
}
}
return
nil
,
fmt
.
Errorf
(
"%v"
,
errs
)
}
return
byteCode
,
nil
return
nil
,
nil
}
return
nil
,
nil
...
...
This diff is collapsed.
Click to expand it.
vm/vm_test.go
View file @
3db9c800
...
...
@@ -13,7 +13,6 @@ import (
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/trie"
checker
"gopkg.in/check.v1"
// "github.com/obscuren/mutan"
)
type
VmSuite
struct
{}
...
...
@@ -68,24 +67,18 @@ func setup(level logger.LogLevel, typ Type) (*Closure, VirtualMachine) {
}
func
(
s
*
VmSuite
)
TestDebugVm
(
c
*
checker
.
C
)
{
// if mutan.Version < "0.6" {
// t.Skip("skipping for mutan version", mutan.Version, " < 0.6")
// }
closure
,
vm
:=
setup
(
logger
.
DebugLevel
,
DebugVmTy
)
ret
,
_
,
e
:=
closure
.
Call
(
vm
,
nil
)
c
.
Assert
(
e
,
checker
.
NotNil
)
c
.
Skip
(
"Depends on mutan"
)
c
.
Skip
(
"Depends on mutan
. Requires serpent implementation
"
)
c
.
Assert
(
ret
,
checker
.
DeepEquals
,
big9
)
}
func
(
s
*
VmSuite
)
TestVm
(
c
*
checker
.
C
)
{
// if mutan.Version < "0.6" {
// t.Skip("skipping for mutan version", mutan.Version, " < 0.6")
// }
closure
,
vm
:=
setup
(
logger
.
DebugLevel
,
StandardVmTy
)
ret
,
_
,
e
:=
closure
.
Call
(
vm
,
nil
)
c
.
Assert
(
e
,
checker
.
NotNil
)
c
.
Skip
(
"Depends on mutan"
)
c
.
Skip
(
"Depends on mutan
. Requires serpent implementation
"
)
c
.
Assert
(
ret
,
checker
.
DeepEquals
,
big9
)
}
...
...
@@ -142,7 +135,7 @@ func (s *VmSuite) TestBuildInSha256(c *checker.C) {
`
,
DebugVmTy
)
exp
:=
crypto
.
Sha256
(
ethutil
.
LeftPadBytes
([]
byte
{
42
},
32
))
c
.
Skip
(
"Depends on mutan"
)
c
.
Skip
(
"Depends on mutan
. Requires serpent implementation
"
)
c
.
Assert
(
ret
,
checker
.
DeepEquals
,
exp
)
}
...
...
@@ -157,7 +150,7 @@ func (s *VmSuite) TestBuildInRipemd(c *checker.C) {
`
,
DebugVmTy
)
exp
:=
ethutil
.
RightPadBytes
(
crypto
.
Ripemd160
(
ethutil
.
LeftPadBytes
([]
byte
{
42
},
32
)),
32
)
c
.
Skip
(
"Depends on mutan"
)
c
.
Skip
(
"Depends on mutan
. Requires serpent implementation
"
)
c
.
Assert
(
ret
,
checker
.
DeepEquals
,
exp
)
}
...
...
This diff is collapsed.
Click to expand it.
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