aboutsummaryrefslogtreecommitdiffstats
path: root/internal/ethapi/backend.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-06-15 06:36:31 +0800
committerFelix Lange <fjl@twurst.com>2016-08-17 23:39:04 +0800
commit1a9e66915b415cb1ca2bc2680f8fb4ff1883787c (patch)
tree849620e85ab94fccf1e49a9a2ea9602d700ea7c1 /internal/ethapi/backend.go
parent84d11c19fd246e245906ca7e498a67f6e0c55e1e (diff)
downloadgo-tangerine-1a9e66915b415cb1ca2bc2680f8fb4ff1883787c.tar
go-tangerine-1a9e66915b415cb1ca2bc2680f8fb4ff1883787c.tar.gz
go-tangerine-1a9e66915b415cb1ca2bc2680f8fb4ff1883787c.tar.bz2
go-tangerine-1a9e66915b415cb1ca2bc2680f8fb4ff1883787c.tar.lz
go-tangerine-1a9e66915b415cb1ca2bc2680f8fb4ff1883787c.tar.xz
go-tangerine-1a9e66915b415cb1ca2bc2680f8fb4ff1883787c.tar.zst
go-tangerine-1a9e66915b415cb1ca2bc2680f8fb4ff1883787c.zip
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
Diffstat (limited to 'internal/ethapi/backend.go')
-rw-r--r--internal/ethapi/backend.go13
1 files changed, 5 insertions, 8 deletions
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",
@@ -92,10 +92,6 @@ func GetAPIs(apiBackend Backend, solcPath *string, solc **compiler.Solidity) []r
Service: NewPublicTxPoolAPI(apiBackend),
Public: true,
}, {
- Namespace: "admin",
- Version: "1.0",
- Service: NewPrivateAdminAPI(apiBackend, solcPath, solc),
- }, {
Namespace: "debug",
Version: "1.0",
Service: NewPublicDebugAPI(apiBackend),
@@ -116,4 +112,5 @@ func GetAPIs(apiBackend Backend, solcPath *string, solc **compiler.Solidity) []r
Public: false,
},
}
+ return append(compiler, all...)
}