From 1886d03faa9b7d8cdf335da84c297d30c213bb69 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 25 Jan 2017 16:29:40 +0100 Subject: console, internal/web3ext: remove bzz and ens extensions (#3602) web3.js includes bzz methods and throws an error when the extension module is reregistered. The ENS RPC API is deprecated and not exposed by anything. --- console/console.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'console') diff --git a/console/console.go b/console/console.go index 9bb3df926..389d52858 100644 --- a/console/console.go +++ b/console/console.go @@ -137,10 +137,14 @@ func (c *Console) init(preload []string) error { continue // manually mapped or ignore } if file, ok := web3ext.Modules[api]; ok { + // Load our extension for the module. if err = c.jsre.Compile(fmt.Sprintf("%s.js", api), file); err != nil { return fmt.Errorf("%s.js: %v", api, err) } flatten += fmt.Sprintf("var %s = web3.%s; ", api, api) + } else if obj, err := c.jsre.Run("web3." + api); err == nil && obj.IsObject() { + // Enable web3.js built-in extension if available. + flatten += fmt.Sprintf("var %s = web3.%s; ", api, api) } } if _, err = c.jsre.Run(flatten); err != nil { -- cgit v1.2.3