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
547788b1
Commit
547788b1
authored
Feb 17, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added optional address slice. Closes #326
parent
2c454863
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
args.go
rpc/args.go
+16
-2
No files found.
rpc/args.go
View file @
547788b1
package
rpc
import
"encoding/json"
import
"github.com/ethereum/go-ethereum/core"
type
GetBlockArgs
struct
{
...
...
@@ -203,7 +204,7 @@ func (obj *Sha3Args) UnmarshalJSON(b []byte) (err error) {
type
FilterOptions
struct
{
Earliest
int64
Latest
int64
Address
string
Address
interface
{}
Topic
[]
string
Skip
int
Max
int
...
...
@@ -211,9 +212,22 @@ type FilterOptions struct {
func
toFilterOptions
(
options
*
FilterOptions
)
core
.
FilterOptions
{
var
opts
core
.
FilterOptions
// Convert optional address slice/string to byte slice
if
str
,
ok
:=
options
.
Address
.
(
string
);
ok
{
opts
.
Address
=
[][]
byte
{
fromHex
(
str
)}
}
else
if
slice
,
ok
:=
options
.
Address
.
([]
interface
{});
ok
{
bslice
:=
make
([][]
byte
,
len
(
slice
))
for
i
,
addr
:=
range
slice
{
if
saddr
,
ok
:=
addr
.
(
string
);
ok
{
bslice
[
i
]
=
fromHex
(
saddr
)
}
}
opts
.
Address
=
bslice
}
opts
.
Earliest
=
options
.
Earliest
opts
.
Latest
=
options
.
Latest
opts
.
Address
=
fromHex
(
options
.
Address
)
opts
.
Topics
=
make
([][]
byte
,
len
(
options
.
Topic
))
for
i
,
topic
:=
range
options
.
Topic
{
opts
.
Topics
[
i
]
=
fromHex
(
topic
)
...
...
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