aboutsummaryrefslogtreecommitdiffstats
path: root/console
diff options
context:
space:
mode:
authorFelix Lange <fjl@users.noreply.github.com>2017-01-25 23:29:40 +0800
committerGitHub <noreply@github.com>2017-01-25 23:29:40 +0800
commit1886d03faa9b7d8cdf335da84c297d30c213bb69 (patch)
tree23fafe325e5832046d2fd698adb7b69b16bc8f5d /console
parentf1069a30b9ca13769ace154ff25dfabc83f25485 (diff)
downloadgo-tangerine-1886d03faa9b7d8cdf335da84c297d30c213bb69.tar.gz
go-tangerine-1886d03faa9b7d8cdf335da84c297d30c213bb69.tar.zst
go-tangerine-1886d03faa9b7d8cdf335da84c297d30c213bb69.zip
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.
Diffstat (limited to 'console')
-rw-r--r--console/console.go4
1 files changed, 4 insertions, 0 deletions
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 {