WS: Add support for ledger_entry to return an account_root.

This commit is contained in:
Arthur Britto
2012-09-27 13:09:57 -07:00
committed by Stefan Thomas
parent f6b4f4c171
commit 7d7f5f568b

View File

@@ -168,6 +168,8 @@ Remote.method('request', function(command, done) {
});
Remote.method('ledger_closed', function(done) {
assert(this.trusted); // If not trusted, need to check proof.
this.request({ 'command' : 'ledger_closed' }, done);
});
@@ -177,6 +179,17 @@ Remote.method('ledger_current', function(done) {
this.request({ 'command' : 'ledger_current' }, done);
});
// <-> params:
// --> ledger : optional
// --> ledger_index : optional
Remote.method('ledger_entry', function(params, done) {
assert(this.trusted); // If not trusted, need to check proof, maybe talk packet protocol.
params.command = 'ledger_entry';
this.request(params, done);
});
// Submit a json transaction.
// done(value)
// <-> value: { 'status', status, 'result' : result, ... }
@@ -186,16 +199,6 @@ Remote.method('submit', function(json, done) {
// });
});
// done(value)
// --> value: { 'status', status, 'result' : result, ... }
// done may be called up to 3 times.
Remote.method('account_root', function(account_id, done) {
this.request({
'command' : 'ledger_current',
}, function() {
});
});
exports.Remote = Remote;
exports.remoteConfig = remoteConfig;