Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add debug_accountRangeAt/debug_storageRangeAt methods #1799

Merged
merged 2 commits into from
Aug 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/web3.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ var Shh = require('./web3/methods/shh');
var Net = require('./web3/methods/net');
var Personal = require('./web3/methods/personal');
var Swarm = require('./web3/methods/swarm');
var Debug = require('./web3/methods/debug');
var Settings = require('./web3/settings');
var version = require('./version.json');
var utils = require('./utils/utils');
Expand All @@ -60,6 +61,7 @@ function Web3 (provider) {
this.shh = new Shh(this);
this.net = new Net(this);
this.personal = new Personal(this);
this.debug = new Debug(this);
this.bzz = new Swarm(this);
this.settings = new Settings();
this.version = {
Expand Down Expand Up @@ -155,4 +157,3 @@ Web3.prototype.createBatch = function () {
};

module.exports = Web3;

58 changes: 58 additions & 0 deletions lib/web3/methods/debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
This file is part of web3.js.

web3.js is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

web3.js is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file debug.js
* @author ewasm team
* @date 2018
*/

"use strict";

var Method = require('../method');

function Debug(web3) {
this._requestManager = web3._requestManager;

var self = this;

methods().forEach(function(method) {
method.attachToObject(self);
method.setRequestManager(self._requestManager);
});
}

var methods = function () {

var accountRangeAt = new Method({
name: 'accountRangeAt',
call: 'debug_accountRangeAt',
params: 4
});

var storageRangeAt = new Method({
name: 'storageRangeAt',
call: 'debug_storageRangeAt',
params: 5
});

return [
accountRangeAt,
storageRangeAt
];
};

module.exports = Debug;