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
05e4e972
Commit
05e4e972
authored
May 21, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Public block creation. Added block logging
parent
07fe00c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
pub.go
ethpub/pub.go
+1
-10
types.go
ethpub/types.go
+13
-3
No files found.
ethpub/pub.go
View file @
05e4e972
...
@@ -24,18 +24,9 @@ func NewPEthereum(manager ethchain.EthManager) *PEthereum {
...
@@ -24,18 +24,9 @@ func NewPEthereum(manager ethchain.EthManager) *PEthereum {
func
(
lib
*
PEthereum
)
GetBlock
(
hexHash
string
)
*
PBlock
{
func
(
lib
*
PEthereum
)
GetBlock
(
hexHash
string
)
*
PBlock
{
hash
:=
ethutil
.
FromHex
(
hexHash
)
hash
:=
ethutil
.
FromHex
(
hexHash
)
block
:=
lib
.
blockChain
.
GetBlock
(
hash
)
block
:=
lib
.
blockChain
.
GetBlock
(
hash
)
var
blockInfo
*
PBlock
return
NewPBlock
(
block
)
if
block
!=
nil
{
blockInfo
=
&
PBlock
{
Number
:
int
(
block
.
BlockInfo
()
.
Number
),
Hash
:
ethutil
.
Hex
(
block
.
Hash
())}
}
else
{
blockInfo
=
&
PBlock
{
Number
:
-
1
,
Hash
:
""
}
}
return
blockInfo
}
}
func
(
lib
*
PEthereum
)
GetKey
()
*
PKey
{
func
(
lib
*
PEthereum
)
GetKey
()
*
PKey
{
...
...
ethpub/types.go
View file @
05e4e972
...
@@ -8,16 +8,26 @@ import (
...
@@ -8,16 +8,26 @@ import (
// Block interface exposed to QML
// Block interface exposed to QML
type
PBlock
struct
{
type
PBlock
struct
{
ref
*
ethchain
.
Block
Number
int
`json:"number"`
Number
int
`json:"number"`
Hash
string
`json:"hash"`
Hash
string
`json:"hash"`
}
}
// Creates a new QML Block from a chain block
// Creates a new QML Block from a chain block
func
NewPBlock
(
block
*
ethchain
.
Block
)
*
PBlock
{
func
NewPBlock
(
block
*
ethchain
.
Block
)
*
PBlock
{
info
:=
block
.
BlockInfo
()
if
block
==
nil
{
hash
:=
hex
.
EncodeToString
(
block
.
Hash
())
return
nil
}
return
&
PBlock
{
ref
:
block
,
Number
:
int
(
block
.
Number
.
Uint64
()),
Hash
:
ethutil
.
Hex
(
block
.
Hash
())}
}
return
&
PBlock
{
Number
:
int
(
info
.
Number
),
Hash
:
hash
}
func
(
self
*
PBlock
)
ToString
()
string
{
if
self
.
ref
!=
nil
{
return
self
.
ref
.
String
()
}
return
""
}
}
type
PTx
struct
{
type
PTx
struct
{
...
...
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