mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 02:25:53 +00:00
UT: Fixes for reserves.
This commit is contained in:
@@ -27,7 +27,7 @@ buster.testCase("Basic Path finding", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Find path from alice to bob";
|
||||
@@ -55,7 +55,7 @@ buster.testCase("Basic Path finding", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set credit limits.";
|
||||
@@ -119,7 +119,7 @@ buster.testCase("Basic Path finding", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set credit limits.";
|
||||
@@ -177,7 +177,7 @@ buster.testCase("Basic Path finding", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set credit limits.";
|
||||
@@ -236,7 +236,7 @@ buster.testCase("Extended Path finding", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set credit limits.";
|
||||
@@ -296,7 +296,7 @@ buster.testCase("Extended Path finding", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set transfer rate.";
|
||||
@@ -368,7 +368,7 @@ buster.testCase("Extended Path finding", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set transfer rate.";
|
||||
|
||||
@@ -185,8 +185,7 @@ buster.testCase("Remote functions", {
|
||||
"create account" :
|
||||
function (done) {
|
||||
this.remote.transaction()
|
||||
.payment('root', 'alice', Amount.from_json("10000"))
|
||||
.set_flags('CreateAccount')
|
||||
.payment('root', 'alice', "10000.0")
|
||||
.on('success', function (r) {
|
||||
// console.log("account_root: %s", JSON.stringify(r));
|
||||
|
||||
@@ -210,8 +209,7 @@ buster.testCase("Remote functions", {
|
||||
var got_success;
|
||||
|
||||
this.remote.transaction()
|
||||
.payment('root', 'alice', Amount.from_json("10000"))
|
||||
.set_flags('CreateAccount')
|
||||
.payment('root', 'alice', "10000.0")
|
||||
.on('success', function (r) {
|
||||
// console.log("create_account: %s", JSON.stringify(r));
|
||||
|
||||
|
||||
@@ -40,17 +40,17 @@ buster.testCase("Fee Changes", {
|
||||
*/
|
||||
|
||||
buster.testCase("Sending", {
|
||||
'setUp' : testutils.build_setup(),
|
||||
'tearDown' : testutils.build_teardown(),
|
||||
'setUp' : testutils.build_setup(),
|
||||
'tearDown' : testutils.build_teardown(),
|
||||
|
||||
"send XRP to non-existent account without create." :
|
||||
"send XRP to non-existent account with insufficent fee" :
|
||||
function (done) {
|
||||
var self = this;
|
||||
var ledgers = 20;
|
||||
var got_proposed;
|
||||
|
||||
this.remote.transaction()
|
||||
.payment('root', 'alice', "10000")
|
||||
.payment('root', 'alice', "1")
|
||||
.on('success', function (r) {
|
||||
// Transaction sent.
|
||||
|
||||
@@ -123,7 +123,7 @@ buster.testCase("Sending", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Check a non-existent credit limit.";
|
||||
@@ -275,7 +275,7 @@ buster.testCase("Sending future", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set alice's limit.";
|
||||
@@ -475,8 +475,9 @@ buster.testCase("Sending future", {
|
||||
});
|
||||
|
||||
buster.testCase("Indirect ripple", {
|
||||
'setUp' : testutils.build_setup(),
|
||||
'tearDown' : testutils.build_teardown(),
|
||||
// 'setUp' : testutils.build_setup({ verbose: true }),
|
||||
'setUp' : testutils.build_setup(),
|
||||
'tearDown' : testutils.build_teardown(),
|
||||
|
||||
"indirect ripple" :
|
||||
function (done) {
|
||||
@@ -488,7 +489,7 @@ buster.testCase("Indirect ripple", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set credit limits.";
|
||||
@@ -557,7 +558,7 @@ buster.testCase("Indirect ripple", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set credit limits.";
|
||||
@@ -615,7 +616,7 @@ buster.testCase("Indirect ripple", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set credit limits.";
|
||||
@@ -677,7 +678,7 @@ buster.testCase("Indirect ripple", {
|
||||
function (callback) {
|
||||
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) {
|
||||
self.what = "Set mtgox transfer rate.";
|
||||
|
||||
@@ -141,7 +141,6 @@ var create_accounts = function (remote, src, amount, accounts, callback) {
|
||||
async.forEachSeries(accounts, function (account, callback) {
|
||||
remote.transaction()
|
||||
.payment(src, account, amount)
|
||||
.set_flags('CreateAccount')
|
||||
.on('proposed', function (m) {
|
||||
// console.log("proposed: %s", JSON.stringify(m));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user