aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/external
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2019-07-04 03:54:59 +0800
committerPéter Szilágyi <peterke@gmail.com>2019-07-04 03:54:59 +0800
commit68147971734ea1f89f7899b1ca595c2c57e67079 (patch)
tree7fdd84eeb011a1e01947af30400c9363b8236149 /accounts/external
parent59a31983829ee542682b842e5b9b12b4cdac193d (diff)
downloadgo-tangerine-68147971734ea1f89f7899b1ca595c2c57e67079.tar
go-tangerine-68147971734ea1f89f7899b1ca595c2c57e67079.tar.gz
go-tangerine-68147971734ea1f89f7899b1ca595c2c57e67079.tar.bz2
go-tangerine-68147971734ea1f89f7899b1ca595c2c57e67079.tar.lz
go-tangerine-68147971734ea1f89f7899b1ca595c2c57e67079.tar.xz
go-tangerine-68147971734ea1f89f7899b1ca595c2c57e67079.tar.zst
go-tangerine-68147971734ea1f89f7899b1ca595c2c57e67079.zip
accounts, cmd, contracts, les: integrate clef for transaction signing (#19783)
* accounts, cmd, contracts, les: integrate clef for transaction signing * accounts, cmd/checkpoint-admin, signer/core: minor fixups
Diffstat (limited to 'accounts/external')
-rw-r--r--accounts/external/backend.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/accounts/external/backend.go b/accounts/external/backend.go
index 23037f52d..705c98722 100644
--- a/accounts/external/backend.go
+++ b/accounts/external/backend.go
@@ -182,18 +182,21 @@ func (api *ExternalSigner) SignText(account accounts.Account, text []byte) ([]by
func (api *ExternalSigner) SignTx(account accounts.Account, tx *types.Transaction, chainID *big.Int) (*types.Transaction, error) {
res := ethapi.SignTransactionResult{}
- to := common.NewMixedcaseAddress(*tx.To())
data := hexutil.Bytes(tx.Data())
+ var to *common.MixedcaseAddress
+ if tx.To() != nil {
+ t := common.NewMixedcaseAddress(*tx.To())
+ to = &t
+ }
args := &core.SendTxArgs{
Data: &data,
Nonce: hexutil.Uint64(tx.Nonce()),
Value: hexutil.Big(*tx.Value()),
Gas: hexutil.Uint64(tx.Gas()),
GasPrice: hexutil.Big(*tx.GasPrice()),
- To: &to,
+ To: to,
From: common.NewMixedcaseAddress(account.Address),
}
-
if err := api.client.Call(&res, "account_signTransaction", args); err != nil {
return nil, err
}