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
1118aaf8
Commit
1118aaf8
authored
Sep 24, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Temp work around
parent
544b7fba
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ethpipe/js_types.go
+0
-7
0 additions, 7 deletions
ethpipe/js_types.go
ethutil/list.go
+13
-6
13 additions, 6 deletions
ethutil/list.go
with
13 additions
and
13 deletions
ethpipe/js_types.go
+
0
−
7
View file @
1118aaf8
...
@@ -36,13 +36,6 @@ func NewJSBlock(block *ethchain.Block) *JSBlock {
...
@@ -36,13 +36,6 @@ func NewJSBlock(block *ethchain.Block) *JSBlock {
ptxs
=
append
(
ptxs
,
*
NewJSTx
(
tx
))
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
)
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
)}
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
)}
...
...
This diff is collapsed.
Click to expand it.
ethutil/list.go
+
13
−
6
View file @
1118aaf8
...
@@ -2,7 +2,6 @@ package ethutil
...
@@ -2,7 +2,6 @@ package ethutil
import
(
import
(
"encoding/json"
"encoding/json"
"fmt"
"reflect"
"reflect"
)
)
...
@@ -10,6 +9,7 @@ import (
...
@@ -10,6 +9,7 @@ import (
// for containing any slice type to use in an environment which
// for containing any slice type to use in an environment which
// does not support slice types (e.g., JavaScript, QML)
// does not support slice types (e.g., JavaScript, QML)
type
List
struct
{
type
List
struct
{
val
interface
{}
list
reflect
.
Value
list
reflect
.
Value
Length
int
Length
int
}
}
...
@@ -21,7 +21,7 @@ func NewList(t interface{}) *List {
...
@@ -21,7 +21,7 @@ func NewList(t interface{}) *List {
panic
(
"list container initialized with a non-slice type"
)
panic
(
"list container initialized with a non-slice type"
)
}
}
return
&
List
{
list
,
list
.
Len
()}
return
&
List
{
t
,
list
,
list
.
Len
()}
}
}
func
EmptyList
()
*
List
{
func
EmptyList
()
*
List
{
...
@@ -30,17 +30,24 @@ func EmptyList() *List {
...
@@ -30,17 +30,24 @@ func EmptyList() *List {
// Get N element from the embedded slice. Returns nil if OOB.
// Get N element from the embedded slice. Returns nil if OOB.
func
(
self
*
List
)
Get
(
i
int
)
interface
{}
{
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
{
if
self
.
list
.
Len
()
>
i
{
return
self
.
list
.
Index
(
i
)
.
Interface
()
i
:=
self
.
list
.
Index
(
i
)
.
Interface
()
return
i
}
}
return
nil
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
// Appends value at the end of the slice. Panics when incompatible value
// is given.
// is given.
func
(
self
*
List
)
Append
(
v
interface
{})
{
func
(
self
*
List
)
Append
(
v
interface
{})
{
...
...
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