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
2106a63d
Commit
2106a63d
authored
Mar 24, 2015
by
Taylor Gerring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move Frontend interface to separate file
parent
65d553d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
27 deletions
+32
-27
frontend.go
xeth/frontend.go
+32
-0
xeth.go
xeth/xeth.go
+0
-27
No files found.
xeth/frontend.go
0 → 100644
View file @
2106a63d
package
xeth
import
(
"github.com/ethereum/go-ethereum/core/types"
)
// Frontend should be implemented by users of XEth. Its methods are
// called whenever XEth makes a decision that requires user input.
type
Frontend
interface
{
// UnlockAccount is called when a transaction needs to be signed
// but the key corresponding to the transaction's sender is
// locked.
//
// It should unlock the account with the given address and return
// true if unlocking succeeded.
UnlockAccount
(
address
[]
byte
)
bool
// This is called for all transactions inititated through
// Transact. It should prompt the user to confirm the transaction
// and return true if the transaction was acknowledged.
//
// ConfirmTransaction is not used for Call transactions
// because they cannot change any state.
ConfirmTransaction
(
tx
*
types
.
Transaction
)
bool
}
// dummyFrontend is a non-interactive frontend that allows all
// transactions but cannot not unlock any keys.
type
dummyFrontend
struct
{}
func
(
dummyFrontend
)
UnlockAccount
([]
byte
)
bool
{
return
false
}
func
(
dummyFrontend
)
ConfirmTransaction
(
*
types
.
Transaction
)
bool
{
return
true
}
xeth/xeth.go
View file @
2106a63d
...
...
@@ -28,33 +28,6 @@ var (
defaultGas
=
big
.
NewInt
(
90000
)
//500000
)
// Frontend should be implemented by users of XEth. Its methods are
// called whenever XEth makes a decision that requires user input.
type
Frontend
interface
{
// UnlockAccount is called when a transaction needs to be signed
// but the key corresponding to the transaction's sender is
// locked.
//
// It should unlock the account with the given address and return
// true if unlocking succeeded.
UnlockAccount
(
address
[]
byte
)
bool
// This is called for all transactions inititated through
// Transact. It should prompt the user to confirm the transaction
// and return true if the transaction was acknowledged.
//
// ConfirmTransaction is not used for Call transactions
// because they cannot change any state.
ConfirmTransaction
(
tx
*
types
.
Transaction
)
bool
}
// dummyFrontend is a non-interactive frontend that allows all
// transactions but cannot not unlock any keys.
type
dummyFrontend
struct
{}
func
(
dummyFrontend
)
UnlockAccount
([]
byte
)
bool
{
return
false
}
func
(
dummyFrontend
)
ConfirmTransaction
(
*
types
.
Transaction
)
bool
{
return
true
}
type
XEth
struct
{
backend
*
eth
.
Ethereum
state
*
State
...
...
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