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
738d6e20
Commit
738d6e20
authored
Mar 9, 2015
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Added ui.Interface to xeth
parent
21fd722a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ui/frontend.go
+4
-14
4 additions, 14 deletions
ui/frontend.go
xeth/xeth.go
+14
-1
14 additions, 1 deletion
xeth/xeth.go
with
18 additions
and
15 deletions
ui/frontend.go
+
4
−
14
View file @
738d6e20
package
ui
package
ui
// ReturnInterface is returned by the Intercom interface when a method is called
import
"github.com/ethereum/go-ethereum/core/types"
type
ReturnInterface
interface
{
Get
(
i
int
)
(
interface
{},
error
)
Size
()
int
}
// Frontend is the basic interface for calling arbitrary methods on something that
type
Interface
interface
{
// implements a front end (GUI, CLI, etc)
UnlockAccount
(
address
[]
byte
)
bool
type
Frontend
interface
{
ConfirmTransaction
(
tx
*
types
.
Transaction
)
bool
// Checks whether a specific method is implemented
Supports
(
method
string
)
bool
// Call calls the given method on interface it implements. This will return
// an error with errNotImplemented if the method hasn't been implemented
// and will return a ReturnInterface if it does.
Call
(
method
string
)
(
ReturnInterface
,
error
)
}
}
This diff is collapsed.
Click to expand it.
xeth/xeth.go
+
14
−
1
View file @
738d6e20
...
@@ -18,6 +18,7 @@ import (
...
@@ -18,6 +18,7 @@ import (
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/miner"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/ui"
"github.com/ethereum/go-ethereum/whisper"
"github.com/ethereum/go-ethereum/whisper"
)
)
...
@@ -46,9 +47,16 @@ type XEth struct {
...
@@ -46,9 +47,16 @@ type XEth struct {
state
*
State
state
*
State
whisper
*
Whisper
whisper
*
Whisper
miner
*
miner
.
Miner
miner
*
miner
.
Miner
frontend
ui
.
Interface
}
}
func
New
(
eth
Backend
)
*
XEth
{
type
TmpFrontend
struct
{}
func
(
TmpFrontend
)
UnlockAccount
([]
byte
)
bool
{
panic
(
"UNLOCK ACCOUNT"
)
}
func
(
TmpFrontend
)
ConfirmTransaction
(
*
types
.
Transaction
)
bool
{
panic
(
"CONFIRM TRANSACTION"
)
}
func
New
(
eth
Backend
,
frontend
ui
.
Interface
)
*
XEth
{
xeth
:=
&
XEth
{
xeth
:=
&
XEth
{
eth
:
eth
,
eth
:
eth
,
blockProcessor
:
eth
.
BlockProcessor
(),
blockProcessor
:
eth
.
BlockProcessor
(),
...
@@ -56,6 +64,11 @@ func New(eth Backend) *XEth {
...
@@ -56,6 +64,11 @@ func New(eth Backend) *XEth {
whisper
:
NewWhisper
(
eth
.
Whisper
()),
whisper
:
NewWhisper
(
eth
.
Whisper
()),
miner
:
eth
.
Miner
(),
miner
:
eth
.
Miner
(),
}
}
if
frontend
==
nil
{
xeth
.
frontend
=
TmpFrontend
{}
}
xeth
.
state
=
NewState
(
xeth
,
xeth
.
chainManager
.
TransState
())
xeth
.
state
=
NewState
(
xeth
,
xeth
.
chainManager
.
TransState
())
return
xeth
return
xeth
...
...
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