diff --git a/cmd/devtool/devtool.go b/cmd/devtool/devtool.go index ab1614eb2c..61b5ddea94 100644 --- a/cmd/devtool/devtool.go +++ b/cmd/devtool/devtool.go @@ -159,19 +159,13 @@ func ethSetup(ethAcctAddr, keystoreDir string, isBroadcaster bool) { } glog.Infof("Using controller address %s", ethController) - client, err := eth.NewClient(ethcommon.HexToAddress(ethAcctAddr), keystoreDir, backend, - ethcommon.HexToAddress(ethController), ethTxTimeout) + client, err := eth.NewClient(ethcommon.HexToAddress(ethAcctAddr), keystoreDir, passphrase, backend, + ethcommon.HexToAddress(ethController), ethTxTimeout, nil) if err != nil { glog.Errorf("Failed to create client: %v", err) return } - err = client.Setup(passphrase, uint64(0), nil) - if err != nil { - glog.Fatalf("Failed to setup client: %v", err) - return - } - if isBroadcaster { amount := new(big.Int).Mul(big.NewInt(100), new(big.Int).Exp(big.NewInt(10), big.NewInt(18), nil)) diff --git a/eth/client.go b/eth/client.go index bc2ad139fb..f06e8635d6 100644 --- a/eth/client.go +++ b/eth/client.go @@ -42,7 +42,6 @@ var ( ) type LivepeerEthClient interface { - Setup(password string, gasLimit uint64, gasPrice *big.Int) error Account() accounts.Account Backend() (Backend, error) @@ -164,6 +163,10 @@ func NewClient(accountAddr ethcommon.Address, keystoreDir, password string, eth return nil, err } + if err := am.Unlock(password); err != nil { + return nil, err + } + return &client{ accountManager: am, backend: backend, @@ -172,15 +175,6 @@ func NewClient(accountAddr ethcommon.Address, keystoreDir, password string, eth }, nil } -func (c *client) Setup(password string, gasLimit uint64, gasPrice *big.Int) error { - err := c.accountManager.Unlock(password) - if err != nil { - return err - } - - return c.SetGasInfo(gasLimit, gasPrice) -} - func (c *client) setContracts(opts *bind.TransactOpts) error { controller, err := contracts.NewController(c.controllerAddr, c.backend) if err != nil { @@ -579,13 +573,7 @@ func (c *client) Vote(pollAddr ethcommon.Address, choiceID *big.Int) (*types.Tra return nil, err } - gl, gp := c.GetGasInfo() - opts, err := c.accountManager.CreateTransactOpts(gl, gp) - if err != nil { - return nil, err - } - - return poll.Vote(opts, choiceID) + return poll.Vote(nil, choiceID) } func (c *client) Reward() (*types.Transaction, error) {