From 7d7f5f568b53a29c9ae5fbdacd7a60b60ffce132 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 27 Sep 2012 13:09:57 -0700 Subject: [PATCH] WS: Add support for ledger_entry to return an account_root. --- js/remote.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/js/remote.js b/js/remote.js index c98129d1..ffab43ea 100644 --- a/js/remote.js +++ b/js/remote.js @@ -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;