Skip to content

Commit f58ac2b

Browse files
authored
Merge pull request #2712 from bas-vk/sendtx
eth/api: rename signAndSendTransaction to sendTransaction
2 parents fb81bc3 + 4ee00b2 commit f58ac2b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

internal/ethapi/api.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,10 @@ func (s *PrivateAccountAPI) LockAccount(addr common.Address) bool {
303303
return s.am.Lock(addr) == nil
304304
}
305305

306-
// SignAndSendTransaction will create a transaction from the given arguments and
306+
// SendTransaction will create a transaction from the given arguments and
307307
// tries to sign it with the key associated with args.To. If the given passwd isn't
308308
// able to decrypt the key it fails.
309-
func (s *PrivateAccountAPI) SignAndSendTransaction(ctx context.Context, args SendTxArgs, passwd string) (common.Hash, error) {
309+
func (s *PrivateAccountAPI) SendTransaction(ctx context.Context, args SendTxArgs, passwd string) (common.Hash, error) {
310310
var err error
311311
args, err = prepareSendTxArgs(ctx, args, s.b)
312312
if err != nil {
@@ -336,6 +336,12 @@ func (s *PrivateAccountAPI) SignAndSendTransaction(ctx context.Context, args Sen
336336
return submitTransaction(ctx, s.b, tx, signature)
337337
}
338338

339+
// SignAndSendTransaction was renamed to SendTransaction. This method is deprecated
340+
// and will be removed in the future. It primary goal is to give clients time to update.
341+
func (s *PrivateAccountAPI) SignAndSendTransaction(ctx context.Context, args SendTxArgs, passwd string) (common.Hash, error) {
342+
return s.SendTransaction(ctx, args, passwd)
343+
}
344+
339345
// PublicBlockChainAPI provides an API to access the Ethereum blockchain.
340346
// It offers only methods that operate on public data that is freely available to anyone.
341347
type PublicBlockChainAPI struct {

internal/web3ext/web3ext.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ web3._extend({
418418
params: 2
419419
}),
420420
new web3._extend.Method({
421-
name: 'signAndSendTransaction',
422-
call: 'personal_signAndSendTransaction',
421+
name: 'sendTransaction',
422+
call: 'personal_sendTransaction',
423423
params: 2,
424424
inputFormatter: [web3._extend.formatters.inputTransactionFormatter, null]
425425
})

0 commit comments

Comments
 (0)