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
b4060da9
Commit
b4060da9
authored
Mar 16, 2015
by
zelig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ethutil -> common
parent
5e7702fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
jsre.go
jsre/jsre.go
+2
-2
jsre_test.go
jsre/jsre_test.go
+3
-3
No files found.
jsre/jsre.go
View file @
b4060da9
...
...
@@ -5,7 +5,7 @@ import (
"github.com/obscuren/otto"
"io/ioutil"
"github.com/ethereum/go-ethereum/
ethutil
"
"github.com/ethereum/go-ethereum/
common
"
)
/*
...
...
@@ -37,7 +37,7 @@ func New(assetPath string) *JSRE {
// Exec(file) loads and runs the contents of a file
// if a relative path is given, the jsre's assetPath is used
func
(
self
*
JSRE
)
Exec
(
file
string
)
error
{
return
self
.
exec
(
ethutil
.
AbsolutePath
(
self
.
assetPath
,
file
))
return
self
.
exec
(
common
.
AbsolutePath
(
self
.
assetPath
,
file
))
}
func
(
self
*
JSRE
)
exec
(
path
string
)
error
{
...
...
jsre/jsre_test.go
View file @
b4060da9
...
...
@@ -4,7 +4,7 @@ import (
"github.com/obscuren/otto"
"testing"
"github.com/ethereum/go-ethereum/
ethutil
"
"github.com/ethereum/go-ethereum/
common
"
)
type
testNativeObjectBinding
struct
{
...
...
@@ -26,7 +26,7 @@ func (no *testNativeObjectBinding) TestMethod(call otto.FunctionCall) otto.Value
func
TestExec
(
t
*
testing
.
T
)
{
jsre
:=
New
(
"/tmp"
)
ethutil
.
WriteFile
(
"/tmp/test.js"
,
[]
byte
(
`msg = "testMsg"`
))
common
.
WriteFile
(
"/tmp/test.js"
,
[]
byte
(
`msg = "testMsg"`
))
err
:=
jsre
.
Exec
(
"test.js"
)
if
err
!=
nil
{
t
.
Errorf
(
"expected no error, got %v"
,
err
)
...
...
@@ -64,7 +64,7 @@ func TestBind(t *testing.T) {
func
TestLoadScript
(
t
*
testing
.
T
)
{
jsre
:=
New
(
"/tmp"
)
ethutil
.
WriteFile
(
"/tmp/test.js"
,
[]
byte
(
`msg = "testMsg"`
))
common
.
WriteFile
(
"/tmp/test.js"
,
[]
byte
(
`msg = "testMsg"`
))
_
,
err
:=
jsre
.
Run
(
`loadScript("test.js")`
)
if
err
!=
nil
{
t
.
Errorf
(
"expected no error, got %v"
,
err
)
...
...
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