@@ -33,6 +33,7 @@ import (
33
33
"github.com/ethereum/go-ethereum/common/hexutil"
34
34
"github.com/ethereum/go-ethereum/internal/ethapi"
35
35
"github.com/ethereum/go-ethereum/log"
36
+ "github.com/ethereum/go-ethereum/signer/core/apitypes"
36
37
"github.com/ethereum/go-ethereum/signer/storage"
37
38
)
38
39
@@ -52,7 +53,7 @@ type ExternalAPI interface {
52
53
// New request to create a new account
53
54
New (ctx context.Context ) (common.Address , error )
54
55
// SignTransaction request to sign the specified transaction
55
- SignTransaction (ctx context.Context , args SendTxArgs , methodSelector * string ) (* ethapi.SignTransactionResult , error )
56
+ SignTransaction (ctx context.Context , args apitypes. SendTxArgs , methodSelector * string ) (* ethapi.SignTransactionResult , error )
56
57
// SignData - request to sign the given data (plus prefix)
57
58
SignData (ctx context.Context , contentType string , addr common.MixedcaseAddress , data interface {}) (hexutil.Bytes , error )
58
59
// SignTypedData - request to sign the given structured data (plus prefix)
@@ -104,7 +105,7 @@ type Validator interface {
104
105
// ValidateTransaction does a number of checks on the supplied transaction, and
105
106
// returns either a list of warnings, or an error (indicating that the transaction
106
107
// should be immediately rejected).
107
- ValidateTransaction (selector * string , tx * SendTxArgs ) (* ValidationMessages , error )
108
+ ValidateTransaction (selector * string , tx * apitypes. SendTxArgs ) (* apitypes. ValidationMessages , error )
108
109
}
109
110
110
111
// SignerAPI defines the actual implementation of ExternalAPI
@@ -220,24 +221,24 @@ func (m Metadata) String() string {
220
221
type (
221
222
// SignTxRequest contains info about a Transaction to sign
222
223
SignTxRequest struct {
223
- Transaction SendTxArgs `json:"transaction"`
224
- Callinfo []ValidationInfo `json:"call_info"`
225
- Meta Metadata `json:"meta"`
224
+ Transaction apitypes. SendTxArgs `json:"transaction"`
225
+ Callinfo []apitypes. ValidationInfo `json:"call_info"`
226
+ Meta Metadata `json:"meta"`
226
227
}
227
228
// SignTxResponse result from SignTxRequest
228
229
SignTxResponse struct {
229
230
//The UI may make changes to the TX
230
- Transaction SendTxArgs `json:"transaction"`
231
- Approved bool `json:"approved"`
231
+ Transaction apitypes. SendTxArgs `json:"transaction"`
232
+ Approved bool `json:"approved"`
232
233
}
233
234
SignDataRequest struct {
234
- ContentType string `json:"content_type"`
235
- Address common.MixedcaseAddress `json:"address"`
236
- Rawdata []byte `json:"raw_data"`
237
- Messages []* NameValueType `json:"messages"`
238
- Callinfo []ValidationInfo `json:"call_info"`
239
- Hash hexutil.Bytes `json:"hash"`
240
- Meta Metadata `json:"meta"`
235
+ ContentType string `json:"content_type"`
236
+ Address common.MixedcaseAddress `json:"address"`
237
+ Rawdata []byte `json:"raw_data"`
238
+ Messages []* NameValueType `json:"messages"`
239
+ Callinfo []apitypes. ValidationInfo `json:"call_info"`
240
+ Hash hexutil.Bytes `json:"hash"`
241
+ Meta Metadata `json:"meta"`
241
242
}
242
243
SignDataResponse struct {
243
244
Approved bool `json:"approved"`
@@ -537,7 +538,7 @@ func (api *SignerAPI) lookupOrQueryPassword(address common.Address, title, promp
537
538
}
538
539
539
540
// SignTransaction signs the given Transaction and returns it both as json and rlp-encoded form
540
- func (api * SignerAPI ) SignTransaction (ctx context.Context , args SendTxArgs , methodSelector * string ) (* ethapi.SignTransactionResult , error ) {
541
+ func (api * SignerAPI ) SignTransaction (ctx context.Context , args apitypes. SendTxArgs , methodSelector * string ) (* ethapi.SignTransactionResult , error ) {
541
542
var (
542
543
err error
543
544
result SignTxResponse
@@ -548,7 +549,7 @@ func (api *SignerAPI) SignTransaction(ctx context.Context, args SendTxArgs, meth
548
549
}
549
550
// If we are in 'rejectMode', then reject rather than show the user warnings
550
551
if api .rejectMode {
551
- if err := msgs .getWarnings (); err != nil {
552
+ if err := msgs .GetWarnings (); err != nil {
552
553
return nil , err
553
554
}
554
555
}
@@ -585,7 +586,7 @@ func (api *SignerAPI) SignTransaction(ctx context.Context, args SendTxArgs, meth
585
586
return nil , err
586
587
}
587
588
// Convert fields into a real transaction
588
- var unsignedTx = result .Transaction .toTransaction ()
589
+ var unsignedTx = result .Transaction .ToTransaction ()
589
590
// Get the password for the transaction
590
591
pw , err := api .lookupOrQueryPassword (acc .Address , "Account password" ,
591
592
fmt .Sprintf ("Please enter the password for account %s" , acc .Address .String ()))
@@ -621,7 +622,7 @@ func (api *SignerAPI) SignGnosisSafeTx(ctx context.Context, signerAddress common
621
622
}
622
623
// If we are in 'rejectMode', then reject rather than show the user warnings
623
624
if api .rejectMode {
624
- if err := msgs .getWarnings (); err != nil {
625
+ if err := msgs .GetWarnings (); err != nil {
625
626
return nil , err
626
627
}
627
628
}
0 commit comments