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
feb40e3a
Unverified
Commit
feb40e3a
authored
Jul 10, 2020
by
gary rong
Committed by
GitHub
Jul 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounts/external: remove dependency on internal/ethapi (#21319)
Fixes #20535 Co-authored-by:
Felix Lange
<
fjl@twurst.com
>
parent
beabf95a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
backend.go
accounts/external/backend.go
+7
-2
No files found.
accounts/external/backend.go
View file @
feb40e3a
...
@@ -27,7 +27,6 @@ import (
...
@@ -27,7 +27,6 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/rpc"
"github.com/ethereum/go-ethereum/signer/core"
"github.com/ethereum/go-ethereum/signer/core"
...
@@ -191,8 +190,13 @@ func (api *ExternalSigner) SignText(account accounts.Account, text []byte) ([]by
...
@@ -191,8 +190,13 @@ func (api *ExternalSigner) SignText(account accounts.Account, text []byte) ([]by
return
signature
,
nil
return
signature
,
nil
}
}
// signTransactionResult represents the signinig result returned by clef.
type
signTransactionResult
struct
{
Raw
hexutil
.
Bytes
`json:"raw"`
Tx
*
types
.
Transaction
`json:"tx"`
}
func
(
api
*
ExternalSigner
)
SignTx
(
account
accounts
.
Account
,
tx
*
types
.
Transaction
,
chainID
*
big
.
Int
)
(
*
types
.
Transaction
,
error
)
{
func
(
api
*
ExternalSigner
)
SignTx
(
account
accounts
.
Account
,
tx
*
types
.
Transaction
,
chainID
*
big
.
Int
)
(
*
types
.
Transaction
,
error
)
{
res
:=
ethapi
.
SignTransactionResult
{}
data
:=
hexutil
.
Bytes
(
tx
.
Data
())
data
:=
hexutil
.
Bytes
(
tx
.
Data
())
var
to
*
common
.
MixedcaseAddress
var
to
*
common
.
MixedcaseAddress
if
tx
.
To
()
!=
nil
{
if
tx
.
To
()
!=
nil
{
...
@@ -208,6 +212,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
...
@@ -208,6 +212,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
To
:
to
,
To
:
to
,
From
:
common
.
NewMixedcaseAddress
(
account
.
Address
),
From
:
common
.
NewMixedcaseAddress
(
account
.
Address
),
}
}
var
res
signTransactionResult
if
err
:=
api
.
client
.
Call
(
&
res
,
"account_signTransaction"
,
args
);
err
!=
nil
{
if
err
:=
api
.
client
.
Call
(
&
res
,
"account_signTransaction"
,
args
);
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
...
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