Compare commits

..

2 Commits

Author SHA1 Message Date
Nik Bougalis
232693419a Set version to 0.27.3-sp1 2015-03-11 10:26:39 -07:00
Nicholas Dudfield
ed66b951c6 Fix testutils.create_accounts
* Don't call ledger_wait inside parallel async loop
2015-03-11 10:25:27 -07:00
3 changed files with 28 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
Name: rippled Name: rippled
Version: 0.27.3 Version: 0.27.3-sp1
Release: 1%{?dist} Release: 1%{?dist}
Summary: Ripple peer-to-peer network daemon Summary: Ripple peer-to-peer network daemon

View File

@@ -35,7 +35,7 @@ char const* getRawVersionString ()
// //
// The build version number (edit this for each release) // The build version number (edit this for each release)
// //
"0.27.3" "0.27.3-sp1"
// //
// Must follow the format described here: // Must follow the format described here:
// //

View File

@@ -213,7 +213,7 @@ function account_dump(remote, account, callback) {
// get closed ledger hash // get closed ledger hash
// get account root // get account root
// construct a json result // construct a json result
}; }
function set_account_flag(remote, account, options, callback) { function set_account_flag(remote, account, options, callback) {
if (typeof options === 'number') { if (typeof options === 'number') {
@@ -224,7 +224,9 @@ function set_account_flag(remote, account, options, callback) {
account: account account: account
}, options)); }, options));
submit_transaction(tx, callback); // submit_transaction(tx, callback);
tx.submit();
tx.once('proposed', function(){callback();});
} }
exports.fund_account = exports.fund_account =
@@ -259,7 +261,6 @@ function(remote, src, account, amount, options, callback) {
options = {}; options = {};
} }
options = extend({default_rippling: true}, options);
// Before creating the account, check if it exists in the ledger. // Before creating the account, check if it exists in the ledger.
// If it does, regardless of the balance, fail the test, because // If it does, regardless of the balance, fail the test, because
@@ -272,28 +273,19 @@ function(remote, src, account, amount, options, callback) {
}); });
info.once('error', function(result) { info.once('error', function(result) {
var isNotFoundError = result.error === 'remoteError' var isNotFoundError = result.error === 'remoteError' &&
&& result.remote.error === 'actNotFound'; result.remote.error === 'actNotFound';
if (!isNotFoundError) { if (!isNotFoundError) {
return callback(result); return callback(result);
} }
// rippled indicated the account does not exist. Create it by funding it. // rippled indicated the account does not exist. Create it by funding it.
fund_account(remote, src, account, amount, function(err) { fund_account(remote, src, account, amount, callback);
if (err) {
callback(err);
} else if (!options.default_rippling) {
callback();
} else {
// Set default rippling on trustlines for account
set_account_flag(remote, account, 8, callback);
}
});
}); });
info.request(); info.request();
} };
function create_accounts(remote, src, amount, accounts, options, callback) { function create_accounts(remote, src, amount, accounts, options, callback) {
if (typeof options === 'function') { if (typeof options === 'function') {
@@ -305,8 +297,24 @@ function create_accounts(remote, src, amount, accounts, options, callback) {
async.forEach(accounts, function (account, callback) { async.forEach(accounts, function (account, callback) {
create_account(remote, src, account, amount, options, callback); create_account(remote, src, account, amount, options, callback);
}, callback); }, function(){
}; options = extend({default_rippling: true}, options);
// If we don't want to set default rippling, then bail, otherwise
if (!options.default_rippling) {
return callback();
}
// close the ledger, so all the accounts always exist, then
remote.ledger_accept(function(){
// set the default rippling flag, on all the accounts
async.forEach(accounts, function(account, callback){
set_account_flag(remote, account, 8, callback);
}, function(){
remote.ledger_accept(function(){callback();});
});
});
});
}
function credit_limit(remote, src, amount, callback) { function credit_limit(remote, src, amount, callback) {
assert.strictEqual(arguments.length, 4); assert.strictEqual(arguments.length, 4);