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
ecdda018
Commit
ecdda018
authored
Sep 24, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/0.6.6' into develop
parents
544b7fba
1118aaf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
js_types.go
ethpipe/js_types.go
+0
-7
list.go
ethutil/list.go
+13
-6
No files found.
ethpipe/js_types.go
View file @
ecdda018
...
...
@@ -36,13 +36,6 @@ func NewJSBlock(block *ethchain.Block) *JSBlock {
ptxs
=
append
(
ptxs
,
*
NewJSTx
(
tx
))
}
/*
txJson, err := json.Marshal(ptxs)
if err != nil {
return nil
}
return &JSBlock{ref: block, Size: block.Size().String(), Number: int(block.Number.Uint64()), GasUsed: block.GasUsed.String(), GasLimit: block.GasLimit.String(), Hash: ethutil.Bytes2Hex(block.Hash()), Transactions: string(txJson), Time: block.Time, Coinbase: ethutil.Bytes2Hex(block.Coinbase)}
*/
list
:=
ethutil
.
NewList
(
ptxs
)
return
&
JSBlock
{
ref
:
block
,
Size
:
block
.
Size
()
.
String
(),
Number
:
int
(
block
.
Number
.
Uint64
()),
GasUsed
:
block
.
GasUsed
.
String
(),
GasLimit
:
block
.
GasLimit
.
String
(),
Hash
:
ethutil
.
Bytes2Hex
(
block
.
Hash
()),
Transactions
:
list
,
Time
:
block
.
Time
,
Coinbase
:
ethutil
.
Bytes2Hex
(
block
.
Coinbase
)}
...
...
ethutil/list.go
View file @
ecdda018
...
...
@@ -2,7 +2,6 @@ package ethutil
import
(
"encoding/json"
"fmt"
"reflect"
)
...
...
@@ -10,6 +9,7 @@ import (
// for containing any slice type to use in an environment which
// does not support slice types (e.g., JavaScript, QML)
type
List
struct
{
val
interface
{}
list
reflect
.
Value
Length
int
}
...
...
@@ -21,7 +21,7 @@ func NewList(t interface{}) *List {
panic
(
"list container initialized with a non-slice type"
)
}
return
&
List
{
list
,
list
.
Len
()}
return
&
List
{
t
,
list
,
list
.
Len
()}
}
func
EmptyList
()
*
List
{
...
...
@@ -30,17 +30,24 @@ func EmptyList() *List {
// Get N element from the embedded slice. Returns nil if OOB.
func
(
self
*
List
)
Get
(
i
int
)
interface
{}
{
if
self
.
list
.
Len
()
==
3
{
fmt
.
Println
(
"get"
,
i
,
self
.
list
.
Index
(
i
)
.
Interface
())
}
if
self
.
list
.
Len
()
>
i
{
return
self
.
list
.
Index
(
i
)
.
Interface
()
i
:=
self
.
list
.
Index
(
i
)
.
Interface
()
return
i
}
return
nil
}
func
(
self
*
List
)
GetAsJson
(
i
int
)
interface
{}
{
e
:=
self
.
Get
(
i
)
r
,
_
:=
json
.
Marshal
(
e
)
return
string
(
r
)
}
// Appends value at the end of the slice. Panics when incompatible value
// is given.
func
(
self
*
List
)
Append
(
v
interface
{})
{
...
...
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