good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
2da7af4b
Commit
2da7af4b
authored
Mar 11, 2015
by
Jeffrey Wilcke
Browse files
Options
Downloads
Plain Diff
Merge branch 'rpcfrontier' of github.com-obscure:ethereum/go-ethereum into rpcfrontier
parents
e8d1b622
90f34ed4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
rpc/api.go
+41
-6
41 additions, 6 deletions
rpc/api.go
rpc/args.go
+11
-6
11 additions, 6 deletions
rpc/args.go
rpc/args_test.go
+3
-3
3 additions, 3 deletions
rpc/args_test.go
rpc/responses.go
+1
-0
1 addition, 0 deletions
rpc/responses.go
with
56 additions
and
15 deletions
rpc/api.go
+
41
−
6
View file @
2da7af4b
...
...
@@ -394,7 +394,7 @@ func (self *EthereumApi) MessagesChanged(id int, reply *interface{}) error {
}
func
(
p
*
EthereumApi
)
WhisperPost
(
args
*
WhisperMessageArgs
,
reply
*
interface
{})
error
{
err
:=
p
.
xeth
()
.
Whisper
()
.
Post
(
args
.
Payload
,
args
.
To
,
args
.
From
,
args
.
Topic
,
args
.
Priority
,
args
.
Ttl
)
err
:=
p
.
xeth
()
.
Whisper
()
.
Post
(
args
.
Payload
,
args
.
To
,
args
.
From
,
args
.
Topic
s
,
args
.
Priority
,
args
.
Ttl
)
if
err
!=
nil
{
return
err
}
...
...
@@ -597,10 +597,10 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
if
err
!=
nil
{
return
err
}
if
args
.
Tx
Index
>
int64
(
len
(
v
.
Transactions
))
||
args
.
Tx
Index
<
0
{
if
args
.
Index
>
int64
(
len
(
v
.
Transactions
))
||
args
.
Index
<
0
{
return
NewErrorWithMessage
(
errDecodeArgs
,
"Transaction index does not exist"
)
}
*
reply
=
v
.
Transactions
[
args
.
Tx
Index
]
*
reply
=
v
.
Transactions
[
args
.
Index
]
case
"eth_getTransactionByBlockNumberAndIndex"
:
args
:=
new
(
BlockNumIndexArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
...
...
@@ -611,13 +611,48 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
if
err
!=
nil
{
return
err
}
if
args
.
Tx
Index
>
int64
(
len
(
v
.
Transactions
))
||
args
.
Tx
Index
<
0
{
if
args
.
Index
>
int64
(
len
(
v
.
Transactions
))
||
args
.
Index
<
0
{
return
NewErrorWithMessage
(
errDecodeArgs
,
"Transaction index does not exist"
)
}
*
reply
=
v
.
Transactions
[
args
.
Tx
Index
]
*
reply
=
v
.
Transactions
[
args
.
Index
]
case
"eth_getUncleByBlockHashAndIndex"
:
args
:=
new
(
HashIndexArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
return
err
}
v
,
err
:=
p
.
GetBlockByHash
(
args
.
BlockHash
,
false
)
if
err
!=
nil
{
return
err
}
if
args
.
Index
>
int64
(
len
(
v
.
Uncles
))
||
args
.
Index
<
0
{
return
NewErrorWithMessage
(
errDecodeArgs
,
"Uncle index does not exist"
)
}
uncle
,
err
:=
p
.
GetBlockByHash
(
toHex
(
v
.
Uncles
[
args
.
Index
]),
false
)
if
err
!=
nil
{
return
err
}
*
reply
=
uncle
case
"eth_getUncleByBlockNumberAndIndex"
:
return
errNotImplemented
args
:=
new
(
BlockNumIndexArgs
)
if
err
:=
json
.
Unmarshal
(
req
.
Params
,
&
args
);
err
!=
nil
{
return
err
}
v
,
err
:=
p
.
GetBlockByNumber
(
args
.
BlockNumber
,
true
)
if
err
!=
nil
{
return
err
}
if
args
.
Index
>
int64
(
len
(
v
.
Uncles
))
||
args
.
Index
<
0
{
return
NewErrorWithMessage
(
errDecodeArgs
,
"Uncle index does not exist"
)
}
uncle
,
err
:=
p
.
GetBlockByHash
(
toHex
(
v
.
Uncles
[
args
.
Index
]),
false
)
if
err
!=
nil
{
return
err
}
*
reply
=
uncle
case
"eth_getCompilers"
:
return
p
.
GetCompilers
(
reply
)
case
"eth_compileSolidity"
:
...
...
This diff is collapsed.
Click to expand it.
rpc/args.go
+
11
−
6
View file @
2da7af4b
...
...
@@ -40,7 +40,12 @@ func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) {
if
len
(
obj
)
<
1
{
return
errArguments
}
args
.
BlockHash
=
obj
[
0
]
.
(
string
)
argstr
,
ok
:=
obj
[
0
]
.
(
string
)
if
!
ok
{
return
errDecodeArgs
}
args
.
BlockHash
=
argstr
if
len
(
obj
)
>
1
{
args
.
Transactions
=
obj
[
1
]
.
(
bool
)
...
...
@@ -219,12 +224,12 @@ func (args *GetDataArgs) requirements() error {
type
BlockNumIndexArgs
struct
{
BlockNumber
int64
Tx
Index
int64
Index
int64
}
type
HashIndexArgs
struct
{
BlockHash
string
Tx
Index
int64
Index
int64
}
type
Sha3Args
struct
{
...
...
@@ -362,7 +367,7 @@ type WhisperMessageArgs struct {
Payload
string
To
string
From
string
Topic
[]
string
Topic
s
[]
string
Priority
uint32
Ttl
uint32
}
...
...
@@ -372,7 +377,7 @@ func (args *WhisperMessageArgs) UnmarshalJSON(b []byte) (err error) {
Payload
string
To
string
From
string
Topic
[]
string
Topic
s
[]
string
Priority
string
Ttl
string
}
...
...
@@ -387,7 +392,7 @@ func (args *WhisperMessageArgs) UnmarshalJSON(b []byte) (err error) {
args
.
Payload
=
obj
[
0
]
.
Payload
args
.
To
=
obj
[
0
]
.
To
args
.
From
=
obj
[
0
]
.
From
args
.
Topic
=
obj
[
0
]
.
Topic
args
.
Topic
s
=
obj
[
0
]
.
Topic
s
args
.
Priority
=
uint32
(
ethutil
.
Big
(
obj
[
0
]
.
Priority
)
.
Int64
())
args
.
Ttl
=
uint32
(
ethutil
.
Big
(
obj
[
0
]
.
Ttl
)
.
Int64
())
...
...
This diff is collapsed.
Click to expand it.
rpc/args_test.go
+
3
−
3
View file @
2da7af4b
...
...
@@ -270,7 +270,7 @@ func TestFilterOptions(t *testing.T) {
t
.
Errorf
(
"Address shoud be %#v but is %#v"
,
expected
.
Address
,
args
.
Address
)
}
// if expected.Topic != args.Topic {
// if expected.Topic
s
!= args.Topic
s
{
// t.Errorf("Topic shoud be %#v but is %#v", expected.Topic, args.Topic)
// }
}
...
...
@@ -316,7 +316,7 @@ func TestWhisperMessageArgs(t *testing.T) {
expected
.
Payload
=
"0x68656c6c6f20776f726c64"
expected
.
Priority
=
100
expected
.
Ttl
=
100
expected
.
Topic
=
[]
string
{
"0x68656c6c6f20776f726c64"
}
expected
.
Topic
s
=
[]
string
{
"0x68656c6c6f20776f726c64"
}
args
:=
new
(
WhisperMessageArgs
)
if
err
:=
json
.
Unmarshal
([]
byte
(
input
),
&
args
);
err
!=
nil
{
...
...
@@ -343,7 +343,7 @@ func TestWhisperMessageArgs(t *testing.T) {
t
.
Errorf
(
"Priority shoud be %#v but is %#v"
,
expected
.
Priority
,
args
.
Priority
)
}
// if expected.Topic != args.Topic {
// if expected.Topic
s
!= args.Topic
s
{
// t.Errorf("Topic shoud be %#v but is %#v", expected.Topic, args.Topic)
// }
}
...
...
This diff is collapsed.
Click to expand it.
rpc/responses.go
+
1
−
0
View file @
2da7af4b
...
...
@@ -2,6 +2,7 @@ package rpc
import
(
"encoding/json"
// "fmt"
"math/big"
"github.com/ethereum/go-ethereum/core/types"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment