aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
Diffstat (limited to 'accounts')
-rw-r--r--accounts/abi/bind/bind.go14
-rw-r--r--accounts/abi/bind/template.go6
2 files changed, 12 insertions, 8 deletions
diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go
index 154c67b0e..84cf22e3c 100644
--- a/accounts/abi/bind/bind.go
+++ b/accounts/abi/bind/bind.go
@@ -120,12 +120,16 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
if err := tmpl.Execute(buffer, data); err != nil {
return "", err
}
- // Pass the code through goimports to clean it up and double check
- code, err := imports.Process("", buffer.Bytes(), nil)
- if err != nil {
- return "", fmt.Errorf("%v\n%s", err, buffer)
+ // For Go bindings pass the code through goimports to clean it up and double check
+ if lang == LangGo {
+ code, err := imports.Process("", buffer.Bytes(), nil)
+ if err != nil {
+ return "", fmt.Errorf("%v\n%s", err, buffer)
+ }
+ return string(code), nil
}
- return string(code), nil
+ // For all others just return as is for now
+ return string(buffer.Bytes()), nil
}
// bindType is a set of type binders that convert Solidity types to some supported
diff --git a/accounts/abi/bind/template.go b/accounts/abi/bind/template.go
index 7225794a1..64dd598c0 100644
--- a/accounts/abi/bind/template.go
+++ b/accounts/abi/bind/template.go
@@ -283,8 +283,8 @@ import org.ethereum.geth.internal.*;
public final static String ABI = "{{.InputABI}}";
{{if .InputBin}}
- // Bytecode is the compiled bytecode used for deploying new contracts.
- public final static byte[] Bytecode = "{{.InputBin}}".getBytes();
+ // BYTECODE is the compiled bytecode used for deploying new contracts.
+ public final static byte[] BYTECODE = "{{.InputBin}}".getBytes();
// deploy deploys a new Ethereum contract, binding an instance of {{.Type}} to it.
public static {{.Type}} deploy(TransactOpts auth, EthereumClient client{{range .Constructor.Inputs}}, {{bindtype .Type}} {{.Name}}{{end}}) throws Exception {
@@ -292,7 +292,7 @@ import org.ethereum.geth.internal.*;
{{range $index, $element := .Constructor.Inputs}}
args.set({{$index}}, Geth.newInterface()); args.get({{$index}}).set{{namedtype (bindtype .Type) .Type}}({{.Name}});
{{end}}
- return new {{.Type}}(Geth.deployContract(auth, ABI, Bytecode, client, args));
+ return new {{.Type}}(Geth.deployContract(auth, ABI, BYTECODE, client, args));
}
// Internal constructor used by contract deployment.