From 214c4e1254036bc198b73f549142b3cc5189510e Mon Sep 17 00:00:00 2001 From: Joel Burget Date: Fri, 18 Aug 2017 15:35:18 -0400 Subject: [PATCH] Fix `SignTx` calls in executables other than geth. --- cmd/faucet/faucet.go | 2 +- internal/guide/guide_test.go | 4 ++-- mobile/accounts.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index 8cd62441edaf5..d73e87895c7ba 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -446,7 +446,7 @@ func (f *faucet) apiHandler(conn *websocket.Conn) { amount = new(big.Int).Div(amount, new(big.Int).Exp(big.NewInt(2), big.NewInt(int64(msg.Tier)), nil)) tx := types.NewTransaction(f.nonce+uint64(len(f.reqs)), address, amount, big.NewInt(21000), f.price, nil) - signed, err := f.keystore.SignTx(f.account, tx, f.config.ChainId) + signed, err := f.keystore.SignTx(f.account, tx, f.config.ChainId, false) if err != nil { websocket.JSON.Send(conn, map[string]string{"error": err.Error()}) f.lock.Unlock() diff --git a/internal/guide/guide_test.go b/internal/guide/guide_test.go index 9c7ad16d182de..146750dac0cea 100644 --- a/internal/guide/guide_test.go +++ b/internal/guide/guide_test.go @@ -85,7 +85,7 @@ func TestAccountManagement(t *testing.T) { if err := ks.Unlock(signer, "Signer password"); err != nil { t.Fatalf("Failed to unlock account: %v", err) } - if _, err := ks.SignTx(signer, tx, chain); err != nil { + if _, err := ks.SignTx(signer, tx, chain, false); err != nil { t.Fatalf("Failed to sign with unlocked account: %v", err) } if err := ks.Lock(signer.Address); err != nil { @@ -95,7 +95,7 @@ func TestAccountManagement(t *testing.T) { if err := ks.TimedUnlock(signer, "Signer password", time.Second); err != nil { t.Fatalf("Failed to time unlock account: %v", err) } - if _, err := ks.SignTx(signer, tx, chain); err != nil { + if _, err := ks.SignTx(signer, tx, chain, false); err != nil { t.Fatalf("Failed to sign with time unlocked account: %v", err) } } diff --git a/mobile/accounts.go b/mobile/accounts.go index 4d979bffff5da..2ddff93e6947b 100644 --- a/mobile/accounts.go +++ b/mobile/accounts.go @@ -120,7 +120,7 @@ func (ks *KeyStore) SignTx(account *Account, tx *Transaction, chainID *BigInt) ( if chainID == nil { // Null passed from mobile app chainID = new(BigInt) } - signed, err := ks.keystore.SignTx(account.account, tx.tx, chainID.bigint) + signed, err := ks.keystore.SignTx(account.account, tx.tx, chainID.bigint, false) if err != nil { return nil, err }