Skip to content

Commit feb40e3

Browse files
rjl493456442fjl
andauthored
accounts/external: remove dependency on internal/ethapi (#21319)
Fixes #20535 Co-authored-by: Felix Lange <[email protected]>
1 parent beabf95 commit feb40e3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

accounts/external/backend.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import (
2727
"github.com/ethereum/go-ethereum/common/hexutil"
2828
"github.com/ethereum/go-ethereum/core/types"
2929
"github.com/ethereum/go-ethereum/event"
30-
"github.com/ethereum/go-ethereum/internal/ethapi"
3130
"github.com/ethereum/go-ethereum/log"
3231
"github.com/ethereum/go-ethereum/rpc"
3332
"github.com/ethereum/go-ethereum/signer/core"
@@ -191,8 +190,13 @@ func (api *ExternalSigner) SignText(account accounts.Account, text []byte) ([]by
191190
return signature, nil
192191
}
193192

193+
// signTransactionResult represents the signinig result returned by clef.
194+
type signTransactionResult struct {
195+
Raw hexutil.Bytes `json:"raw"`
196+
Tx *types.Transaction `json:"tx"`
197+
}
198+
194199
func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
195-
res := ethapi.SignTransactionResult{}
196200
data := hexutil.Bytes(tx.Data())
197201
var to *common.MixedcaseAddress
198202
if tx.To() != nil {
@@ -208,6 +212,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
208212
To: to,
209213
From: common.NewMixedcaseAddress(account.Address),
210214
}
215+
var res signTransactionResult
211216
if err := api.client.Call(&res, "account_signTransaction", args); err != nil {
212217
return nil, err
213218
}

0 commit comments

Comments
 (0)