Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
e728aaca
Commit
e728aaca
authored
Apr 15, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpc: move web3.js extensions to internal/web3ext
parent
6197fbf8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
13 deletions
+12
-13
js.go
cmd/geth/js.go
+2
-1
web3ext.go
internal/web3ext/web3ext.go
+10
-12
No files found.
cmd/geth/js.go
View file @
e728aaca
...
...
@@ -32,6 +32,7 @@ import (
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/registrar"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/internal/web3ext"
re
"github.com/ethereum/go-ethereum/jsre"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/rpc"
...
...
@@ -202,7 +203,7 @@ func (js *jsre) apiBindings() error {
continue
// manually mapped or ignore
}
if
jsFile
,
ok
:=
rpc
.
WEB3Extension
s
[
apiName
];
ok
{
if
jsFile
,
ok
:=
web3ext
.
Module
s
[
apiName
];
ok
{
if
err
=
js
.
re
.
Compile
(
fmt
.
Sprintf
(
"%s.js"
,
apiName
),
jsFile
);
err
==
nil
{
shortcuts
+=
fmt
.
Sprintf
(
"var %s = web3.%s; "
,
apiName
,
apiName
)
}
else
{
...
...
rpc/javascrip
t.go
→
internal/web3ext/web3ex
t.go
View file @
e728aaca
...
...
@@ -14,19 +14,17 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package
rpc
// package web3ext contains geth specific web3.js extensions.
package
web3ext
var
(
// Holds geth specific RPC extends which can be used to extend web3
WEB3Extensions
=
map
[
string
]
string
{
"txpool"
:
TxPool_JS
,
"admin"
:
Admin_JS
,
"eth"
:
Eth_JS
,
"miner"
:
Miner_JS
,
"debug"
:
Debug_JS
,
"net"
:
Net_JS
,
}
)
var
Modules
=
map
[
string
]
string
{
"txpool"
:
TxPool_JS
,
"admin"
:
Admin_JS
,
"eth"
:
Eth_JS
,
"miner"
:
Miner_JS
,
"debug"
:
Debug_JS
,
"net"
:
Net_JS
,
}
const
TxPool_JS
=
`
web3._extend({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment