From 1a9e66915b415cb1ca2bc2680f8fb4ff1883787c Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 15 Jun 2016 00:36:31 +0200 Subject: common/compiler: simplify solc wrapper Support for legacy version 0.9.x is gone. The compiler version is no longer cached. Compilation results (and the version) are read directly from stdout using the --combined-json flag. As a workaround for ethereum/solidity#651, source code is written to a temporary file before compilation. Integration of solc in package ethapi and cmd/abigen is now much simpler because the compiler wrapper is no longer passed around as a pointer. Fixes #2806, accidentally --- internal/ethapi/backend.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'internal/ethapi/backend.go') diff --git a/internal/ethapi/backend.go b/internal/ethapi/backend.go index d112a6aef..791a06925 100644 --- a/internal/ethapi/backend.go +++ b/internal/ethapi/backend.go @@ -22,7 +22,6 @@ import ( "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/compiler" "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/vm" @@ -69,12 +68,13 @@ type State interface { GetNonce(ctx context.Context, addr common.Address) (uint64, error) } -func GetAPIs(apiBackend Backend, solcPath *string, solc **compiler.Solidity) []rpc.API { - return []rpc.API{ +func GetAPIs(apiBackend Backend, solcPath string) []rpc.API { + compiler := makeCompilerAPIs(solcPath) + all := []rpc.API{ { Namespace: "eth", Version: "1.0", - Service: NewPublicEthereumAPI(apiBackend, solcPath, solc), + Service: NewPublicEthereumAPI(apiBackend), Public: true, }, { Namespace: "eth", @@ -91,10 +91,6 @@ func GetAPIs(apiBackend Backend, solcPath *string, solc **compiler.Solidity) []r Version: "1.0", Service: NewPublicTxPoolAPI(apiBackend), Public: true, - }, { - Namespace: "admin", - Version: "1.0", - Service: NewPrivateAdminAPI(apiBackend, solcPath, solc), }, { Namespace: "debug", Version: "1.0", @@ -116,4 +112,5 @@ func GetAPIs(apiBackend Backend, solcPath *string, solc **compiler.Solidity) []r Public: false, }, } + return append(compiler, all...) } -- cgit v1.2.3