UT: Fixes for reserves.

This commit is contained in:
Arthur Britto
2012-12-12 23:08:18 -08:00
parent 6d3c82ab7b
commit 68327ab27f
4 changed files with 22 additions and 24 deletions

View File

@@ -27,7 +27,7 @@ buster.testCase("Basic Path finding", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob"], callback);
}, },
function (callback) { function (callback) {
self.what = "Find path from alice to bob"; self.what = "Find path from alice to bob";
@@ -55,7 +55,7 @@ buster.testCase("Basic Path finding", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set credit limits."; self.what = "Set credit limits.";
@@ -119,7 +119,7 @@ buster.testCase("Basic Path finding", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set credit limits."; self.what = "Set credit limits.";
@@ -177,7 +177,7 @@ buster.testCase("Basic Path finding", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set credit limits."; self.what = "Set credit limits.";
@@ -236,7 +236,7 @@ buster.testCase("Extended Path finding", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox", "bitstamp"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox", "bitstamp"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set credit limits."; self.what = "Set credit limits.";
@@ -296,7 +296,7 @@ buster.testCase("Extended Path finding", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox", "bitstamp"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox", "bitstamp"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set transfer rate."; self.what = "Set transfer rate.";
@@ -368,7 +368,7 @@ buster.testCase("Extended Path finding", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox", "bitstamp"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox", "bitstamp"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set transfer rate."; self.what = "Set transfer rate.";

View File

@@ -185,8 +185,7 @@ buster.testCase("Remote functions", {
"create account" : "create account" :
function (done) { function (done) {
this.remote.transaction() this.remote.transaction()
.payment('root', 'alice', Amount.from_json("10000")) .payment('root', 'alice', "10000.0")
.set_flags('CreateAccount')
.on('success', function (r) { .on('success', function (r) {
// console.log("account_root: %s", JSON.stringify(r)); // console.log("account_root: %s", JSON.stringify(r));
@@ -210,8 +209,7 @@ buster.testCase("Remote functions", {
var got_success; var got_success;
this.remote.transaction() this.remote.transaction()
.payment('root', 'alice', Amount.from_json("10000")) .payment('root', 'alice', "10000.0")
.set_flags('CreateAccount')
.on('success', function (r) { .on('success', function (r) {
// console.log("create_account: %s", JSON.stringify(r)); // console.log("create_account: %s", JSON.stringify(r));

View File

@@ -40,17 +40,17 @@ buster.testCase("Fee Changes", {
*/ */
buster.testCase("Sending", { buster.testCase("Sending", {
'setUp' : testutils.build_setup(), 'setUp' : testutils.build_setup(),
'tearDown' : testutils.build_teardown(), 'tearDown' : testutils.build_teardown(),
"send XRP to non-existent account without create." : "send XRP to non-existent account with insufficent fee" :
function (done) { function (done) {
var self = this; var self = this;
var ledgers = 20; var ledgers = 20;
var got_proposed; var got_proposed;
this.remote.transaction() this.remote.transaction()
.payment('root', 'alice', "10000") .payment('root', 'alice', "1")
.on('success', function (r) { .on('success', function (r) {
// Transaction sent. // Transaction sent.
@@ -123,7 +123,7 @@ buster.testCase("Sending", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback);
}, },
function (callback) { function (callback) {
self.what = "Check a non-existent credit limit."; self.what = "Check a non-existent credit limit.";
@@ -275,7 +275,7 @@ buster.testCase("Sending future", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set alice's limit."; self.what = "Set alice's limit.";
@@ -475,8 +475,9 @@ buster.testCase("Sending future", {
}); });
buster.testCase("Indirect ripple", { buster.testCase("Indirect ripple", {
'setUp' : testutils.build_setup(), // 'setUp' : testutils.build_setup({ verbose: true }),
'tearDown' : testutils.build_teardown(), 'setUp' : testutils.build_setup(),
'tearDown' : testutils.build_teardown(),
"indirect ripple" : "indirect ripple" :
function (done) { function (done) {
@@ -488,7 +489,7 @@ buster.testCase("Indirect ripple", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set credit limits."; self.what = "Set credit limits.";
@@ -557,7 +558,7 @@ buster.testCase("Indirect ripple", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "mtgox"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "mtgox"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set credit limits."; self.what = "Set credit limits.";
@@ -615,7 +616,7 @@ buster.testCase("Indirect ripple", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "carol", "amazon", "mtgox"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "carol", "amazon", "mtgox"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set credit limits."; self.what = "Set credit limits.";
@@ -677,7 +678,7 @@ buster.testCase("Indirect ripple", {
function (callback) { function (callback) {
self.what = "Create accounts."; self.what = "Create accounts.";
testutils.create_accounts(self.remote, "root", "10000", ["alice", "bob", "carol", "amazon", "mtgox"], callback); testutils.create_accounts(self.remote, "root", "10000.0", ["alice", "bob", "carol", "amazon", "mtgox"], callback);
}, },
function (callback) { function (callback) {
self.what = "Set mtgox transfer rate."; self.what = "Set mtgox transfer rate.";

View File

@@ -141,7 +141,6 @@ var create_accounts = function (remote, src, amount, accounts, callback) {
async.forEachSeries(accounts, function (account, callback) { async.forEachSeries(accounts, function (account, callback) {
remote.transaction() remote.transaction()
.payment(src, account, amount) .payment(src, account, amount)
.set_flags('CreateAccount')
.on('proposed', function (m) { .on('proposed', function (m) {
// console.log("proposed: %s", JSON.stringify(m)); // console.log("proposed: %s", JSON.stringify(m));