mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 22:45:52 +00:00
UT add testing for ledger_closed and update ledger_current.
This commit is contained in:
10
js/remote.js
10
js/remote.js
@@ -82,7 +82,7 @@ Remote.method('connect_helper', function() {
|
||||
self.done(ws.readyState);
|
||||
};
|
||||
|
||||
// XXX Why doesn't onmessage work?
|
||||
// Node's ws module doesn't pass arguments to onmessage.
|
||||
ws.on('message', function(json, flags) {
|
||||
var message = JSON.parse(json);
|
||||
// console.log("message: %s", json);
|
||||
@@ -167,12 +167,16 @@ Remote.method('request', function(command, done) {
|
||||
ws.send(JSON.stringify(command));
|
||||
});
|
||||
|
||||
// Get the current ledger entry (may be live or not).
|
||||
Remote.method('ledger_closed', function(done) {
|
||||
this.request({ 'command' : 'ledger_closed' }, done);
|
||||
});
|
||||
|
||||
// Get the current proposed ledger entry. May be closed (and revised) at any time (even before returning).
|
||||
// Only for use by unit tests.
|
||||
Remote.method('ledger_current', function(done) {
|
||||
this.request({ 'command' : 'ledger_current' }, done);
|
||||
});
|
||||
|
||||
|
||||
// Submit a json transaction.
|
||||
// done(value)
|
||||
// <-> value: { 'status', status, 'result' : result, ... }
|
||||
|
||||
Reference in New Issue
Block a user