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
605dd3a9
Commit
605dd3a9
authored
Feb 19, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add serpent compilation to RPC
parent
dba4f312
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
message.go
rpc/message.go
+15
-0
packages.go
rpc/packages.go
+23
-0
No files found.
rpc/message.go
View file @
605dd3a9
...
@@ -201,6 +201,21 @@ func (req *RpcRequest) ToGetCodeAtArgs() (*GetCodeAtArgs, error) {
...
@@ -201,6 +201,21 @@ func (req *RpcRequest) ToGetCodeAtArgs() (*GetCodeAtArgs, error) {
return
args
,
nil
return
args
,
nil
}
}
func
(
req
*
RpcRequest
)
ToCompileArgs
()
(
string
,
error
)
{
if
len
(
req
.
Params
)
<
1
{
return
""
,
NewErrorResponse
(
ErrorArguments
)
}
var
args
string
err
:=
json
.
Unmarshal
(
req
.
Params
[
0
],
&
args
)
if
err
!=
nil
{
return
""
,
NewErrorResponse
(
ErrorDecodeArgs
)
}
rpclogger
.
DebugDetailf
(
"%T %v"
,
args
,
args
)
return
args
,
nil
}
func
(
req
*
RpcRequest
)
ToFilterArgs
()
(
*
FilterOptions
,
error
)
{
func
(
req
*
RpcRequest
)
ToFilterArgs
()
(
*
FilterOptions
,
error
)
{
if
len
(
req
.
Params
)
<
1
{
if
len
(
req
.
Params
)
<
1
{
return
nil
,
NewErrorResponse
(
ErrorArguments
)
return
nil
,
NewErrorResponse
(
ErrorArguments
)
...
...
rpc/packages.go
View file @
605dd3a9
...
@@ -300,6 +300,21 @@ func (p *EthereumApi) GetCodeAt(args *GetCodeAtArgs, reply *interface{}) error {
...
@@ -300,6 +300,21 @@ func (p *EthereumApi) GetCodeAt(args *GetCodeAtArgs, reply *interface{}) error {
return
nil
return
nil
}
}
func
(
p
*
EthereumApi
)
GetCompilers
(
reply
*
interface
{})
error
{
c
:=
[]
string
{
"serpent"
}
*
reply
=
c
return
nil
}
func
(
p
*
EthereumApi
)
CompileSerpent
(
script
string
,
reply
*
interface
{})
error
{
res
,
err
:=
ethutil
.
Compile
(
script
,
false
)
if
err
!=
nil
{
return
err
}
*
reply
=
res
return
nil
}
func
(
p
*
EthereumApi
)
Sha3
(
args
*
Sha3Args
,
reply
*
interface
{})
error
{
func
(
p
*
EthereumApi
)
Sha3
(
args
*
Sha3Args
,
reply
*
interface
{})
error
{
*
reply
=
toHex
(
crypto
.
Sha3
(
fromHex
(
args
.
Data
)))
*
reply
=
toHex
(
crypto
.
Sha3
(
fromHex
(
args
.
Data
)))
return
nil
return
nil
...
@@ -490,6 +505,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
...
@@ -490,6 +505,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return
err
return
err
}
}
return
p
.
WatchTx
(
args
,
reply
)
return
p
.
WatchTx
(
args
,
reply
)
case
"eth_compilers"
:
return
p
.
GetCompilers
(
reply
)
case
"eth_serpent"
:
args
,
err
:=
req
.
ToCompileArgs
()
if
err
!=
nil
{
return
err
}
return
p
.
CompileSerpent
(
args
,
reply
)
case
"web3_sha3"
:
case
"web3_sha3"
:
args
,
err
:=
req
.
ToSha3Args
()
args
,
err
:=
req
.
ToSha3Args
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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