@@ -27,7 +27,6 @@ import (
27
27
"github.com/ethereum/go-ethereum/common/hexutil"
28
28
"github.com/ethereum/go-ethereum/core/types"
29
29
"github.com/ethereum/go-ethereum/event"
30
- "github.com/ethereum/go-ethereum/internal/ethapi"
31
30
"github.com/ethereum/go-ethereum/log"
32
31
"github.com/ethereum/go-ethereum/rpc"
33
32
"github.com/ethereum/go-ethereum/signer/core"
@@ -191,8 +190,13 @@ func (api *ExternalSigner) SignText(account accounts.Account, text []byte) ([]by
191
190
return signature , nil
192
191
}
193
192
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
+
194
199
func (api * ExternalSigner ) SignTx (account accounts.Account , tx * types.Transaction , chainID * big.Int ) (* types.Transaction , error ) {
195
- res := ethapi.SignTransactionResult {}
196
200
data := hexutil .Bytes (tx .Data ())
197
201
var to * common.MixedcaseAddress
198
202
if tx .To () != nil {
@@ -208,6 +212,7 @@ func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transactio
208
212
To : to ,
209
213
From : common .NewMixedcaseAddress (account .Address ),
210
214
}
215
+ var res signTransactionResult
211
216
if err := api .client .Call (& res , "account_signTransaction" , args ); err != nil {
212
217
return nil , err
213
218
}
0 commit comments