diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-20 17:31:52 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-20 17:31:52 +0800 |
commit | 0300eef94d7d1e58bc5cf94094a3d492c70486e1 (patch) | |
tree | d2828b978ad2a0128459c9a09096aec95b18af1c /xeth/xeth.go | |
parent | 6b83a0a589d4615382de3d9f3ed2800064b4c1b9 (diff) | |
parent | e1d1417729b82f00bcb62dffa36358cb74ab790f (diff) | |
download | go-tangerine-0300eef94d7d1e58bc5cf94094a3d492c70486e1.tar go-tangerine-0300eef94d7d1e58bc5cf94094a3d492c70486e1.tar.gz go-tangerine-0300eef94d7d1e58bc5cf94094a3d492c70486e1.tar.bz2 go-tangerine-0300eef94d7d1e58bc5cf94094a3d492c70486e1.tar.lz go-tangerine-0300eef94d7d1e58bc5cf94094a3d492c70486e1.tar.xz go-tangerine-0300eef94d7d1e58bc5cf94094a3d492c70486e1.tar.zst go-tangerine-0300eef94d7d1e58bc5cf94094a3d492c70486e1.zip |
Merge pull request #1048 from ethersphere/cli-fixes
CLI, JSRE admin and Solc improvements
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r-- | xeth/xeth.go | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 7de3e31be..4925fe635 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -66,12 +66,16 @@ type XEth struct { // regmut sync.Mutex // register map[string][]*interface{} // TODO improve return type - solcPath string - solc *compiler.Solidity - agent *miner.RemoteAgent } +func NewTest(eth *eth.Ethereum, frontend Frontend) *XEth { + return &XEth{ + backend: eth, + frontend: frontend, + } +} + // New creates an XEth that uses the given frontend. // If a nil Frontend is provided, a default frontend which // confirms all transactions will be used. @@ -379,17 +383,12 @@ func (self *XEth) Accounts() []string { // accessor for solidity compiler. // memoized if available, retried on-demand if not func (self *XEth) Solc() (*compiler.Solidity, error) { - var err error - if self.solc == nil { - self.solc, err = compiler.New(self.solcPath) - } - return self.solc, err + return self.backend.Solc() } // set in js console via admin interface or wrapper from cli flags func (self *XEth) SetSolc(solcPath string) (*compiler.Solidity, error) { - self.solcPath = solcPath - self.solc = nil + self.backend.SetSolc(solcPath) return self.Solc() } |