UT: Work toward dumping an account's history.

This commit is contained in:
Arthur Britto
2012-11-10 16:16:05 -08:00
parent c59c9f91b2
commit 8d89fb256d
3 changed files with 36 additions and 5 deletions

View File

@@ -9,8 +9,6 @@ var testutils = require("./testutils.js");
require("../src/js/amount.js").config = require("./config.js");
require("../src/js/remote.js").config = require("./config.js");
var fastTearDown = true;
// How long to wait for server to start.
var serverDelay = 1500; // XXX Not implemented.

View File

@@ -10,6 +10,40 @@ require("../src/js/remote.js").config = require("./config.js");
var config = require("./config.js");
var account_dump = function (remote, account, callback) {
var self = this;
async.waterfall([
function (callback) {
self.what = "Get latest account_root";
remote
.request_ledger_entry('account_root')
.ledger_hash(remote.ledger_hash())
.account_root("root")
.on('success', function (r) {
console.log("account_root: %s", JSON.stringify(r, undefined, 2));
callback();
})
.on('error', function(m) {
console.log("error: %s", m);
buster.assert(false);
callback();
})
.request();
},
], function (error) {
callback(error);
});
// get closed ledger hash
// get account root
// construct a json result
//
};
/**
* Helper called by test cases to generate a setUp routine.
*
@@ -311,6 +345,8 @@ var verify_offer_not_found = function (remote, owner, seq, callback) {
.request();
};
exports.account_dump = account_dump;
exports.build_setup = build_setup;
exports.create_accounts = create_accounts;
exports.credit_limit = credit_limit;

View File

@@ -5,9 +5,6 @@ var Remote = require("../src/js/remote.js").Remote;
require("../src/js/remote.js").config = require("./config.js");
// How long to wait for server to start.
var serverDelay = 1500;
buster.testRunner.timeout = 5000;
buster.testCase("WebSocket connection", {