mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Update tests to support latest ripple-lib:
* Update ripple-lib api usage * Use latest npm ripple-lib * Tested with bignumber.js branch and tip of develop * Use new version of coffee-script * Better source maps * Update mocha * Add assert-diff for better error reporting * Add rconsole, enabled via USE_RCONSOLE env var * For use with manual installation only
This commit is contained in:
committed by
Nik Bougalis
parent
44450bf644
commit
4dc2cf8a6b
17
package.json
17
package.json
@@ -2,33 +2,28 @@
|
|||||||
"name": "rippled",
|
"name": "rippled",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "Rippled Server",
|
"description": "Rippled Server",
|
||||||
|
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|
||||||
"directories": {
|
"directories": {
|
||||||
"test": "test"
|
"test": "test"
|
||||||
},
|
},
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ripple-lib": "0.8.2",
|
"assert-diff": "0.0.4",
|
||||||
"async": "~0.2.9",
|
"async": "~0.2.9",
|
||||||
|
"deep-equal": "0.0.0",
|
||||||
"extend": "~1.2.0",
|
"extend": "~1.2.0",
|
||||||
"simple-jsonrpc": "~0.0.2",
|
"ripple-lib": "0.10.0",
|
||||||
"deep-equal": "0.0.0"
|
"simple-jsonrpc": "~0.0.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"coffee-script": "~1.6.3",
|
"coffee-script": "^1.8.0",
|
||||||
"mocha": "~1.13.0"
|
"mocha": "^2.1.0"
|
||||||
},
|
},
|
||||||
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha test/websocket-test.js test/server-test.js test/*-test.{js,coffee}"
|
"test": "mocha test/websocket-test.js test/server-test.js test/*-test.{js,coffee}"
|
||||||
},
|
},
|
||||||
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/ripple/rippled.git"
|
"url": "git://github.com/ripple/rippled.git"
|
||||||
},
|
},
|
||||||
|
|
||||||
"readmeFilename": "README.md"
|
"readmeFilename": "README.md"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,6 +101,9 @@ exports.submit_for_final = (tx, done) ->
|
|||||||
accept so the transaction will finalize.
|
accept so the transaction will finalize.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
tx.on 'proposed', -> tx.remote.ledger_accept()
|
tx.on 'submitted', (m) ->
|
||||||
|
ter = (m.engine_result ? '').slice(0, 3)
|
||||||
|
if ter in ['tes', 'tec']
|
||||||
|
tx.remote.ledger_accept()
|
||||||
tx.on 'final', (m) -> done(m)
|
tx.on 'final', (m) -> done(m)
|
||||||
tx.submit()
|
tx.submit()
|
||||||
|
|||||||
@@ -188,7 +188,8 @@ config = testutils.init_config()
|
|||||||
#################################### HELPERS ###################################
|
#################################### HELPERS ###################################
|
||||||
|
|
||||||
get_lines = (remote, acc, done) ->
|
get_lines = (remote, acc, done) ->
|
||||||
remote.request_account_lines acc, null, 'validated', (err, lines) ->
|
args = {account: acc, ledger: 'validated'}
|
||||||
|
remote.request_account_lines args, (err, lines) ->
|
||||||
done(lines)
|
done(lines)
|
||||||
|
|
||||||
account_set_factory = (remote, ledger, alias_for) ->
|
account_set_factory = (remote, ledger, alias_for) ->
|
||||||
@@ -844,7 +845,7 @@ execute_if_enabled (suite, enforced) ->
|
|||||||
|
|
||||||
test_if enforced, 'offer was removed by offer_create', (done) ->
|
test_if enforced, 'offer was removed by offer_create', (done) ->
|
||||||
args = { account: 'A4', ledger: 'validated' }
|
args = { account: 'A4', ledger: 'validated' }
|
||||||
|
|
||||||
remote.request_account_offers args, (err, res) ->
|
remote.request_account_offers args, (err, res) ->
|
||||||
assert res.offers.length == 0
|
assert res.offers.length == 0
|
||||||
done()
|
done()
|
||||||
@@ -357,12 +357,12 @@ exports.LedgerState = class LedgerState
|
|||||||
incr_reserve_amt = @incr_reserve()
|
incr_reserve_amt = @incr_reserve()
|
||||||
|
|
||||||
base_reserve = @parse_amount base_reserve_amt
|
base_reserve = @parse_amount base_reserve_amt
|
||||||
inc_reserve = @parse_amount incr_reserve_amt
|
incr_reserve = @parse_amount incr_reserve_amt
|
||||||
|
|
||||||
@assert base_reserve != null,
|
@assert base_reserve != null,
|
||||||
"Base reserve amount #{base_reserve_amt} is invalid"
|
"Base reserve amount #{base_reserve_amt} is invalid"
|
||||||
|
|
||||||
@assert base_reserve != null,
|
@assert incr_reserve != null,
|
||||||
"incremental amount #{incr_reserve_amt} is invalid"
|
"incremental amount #{incr_reserve_amt} is invalid"
|
||||||
|
|
||||||
for account_id, account of @declaration.accounts
|
for account_id, account of @declaration.accounts
|
||||||
@@ -380,10 +380,10 @@ exports.LedgerState = class LedgerState
|
|||||||
owner_count += Object.keys(@trusts_by_ci[account_id]).length
|
owner_count += Object.keys(@trusts_by_ci[account_id]).length
|
||||||
|
|
||||||
owner_count_amount = Amount.from_json(String(owner_count))
|
owner_count_amount = Amount.from_json(String(owner_count))
|
||||||
inc_reserve_n = owner_count_amount.multiply(inc_reserve)
|
inc_reserve_n = owner_count_amount.multiply(incr_reserve)
|
||||||
total_needed = total_needed.add(inc_reserve_n)
|
total_needed = total_needed.add(inc_reserve_n)
|
||||||
|
|
||||||
@assert @accounts[account_id].compareTo total_needed != - 1,
|
@assert @accounts[account_id].compareTo(total_needed) != - 1,
|
||||||
"Account #{account_id} needs more XRP for reserve"
|
"Account #{account_id} needs more XRP for reserve"
|
||||||
|
|
||||||
@reserves[account_id] = total_needed
|
@reserves[account_id] = total_needed
|
||||||
@@ -481,12 +481,6 @@ exports.LedgerState = class LedgerState
|
|||||||
tx.offer_create(src, pays, gets)
|
tx.offer_create(src, pays, gets)
|
||||||
tx.set_flags(flags)
|
tx.set_flags(flags)
|
||||||
|
|
||||||
# console.log tx.tx_json
|
|
||||||
# process.exit()
|
|
||||||
|
|
||||||
# tx_json = make_tx_json(src, 'OfferCreate')
|
|
||||||
# tx_json.TakerPays = pays.to_json()
|
|
||||||
# tx_json.TakerGets = gets.to_json()
|
|
||||||
lines.push submit_line(src, tx.tx_json)
|
lines.push submit_line(src, tx.tx_json)
|
||||||
|
|
||||||
ledger_accept()
|
ledger_accept()
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ mocha = require("mocha")
|
|||||||
// Stash a reference away to this
|
// Stash a reference away to this
|
||||||
old_loader = mocha.prototype.loadFiles
|
old_loader = mocha.prototype.loadFiles
|
||||||
|
|
||||||
|
// Optionally use a more useful (but noisy) logger
|
||||||
|
if (process.env.USE_RCONSOLE) {
|
||||||
|
require('rconsole');
|
||||||
|
};
|
||||||
|
|
||||||
if (!old_loader.monkey_patched) {
|
if (!old_loader.monkey_patched) {
|
||||||
// Gee thanks Mocha ...
|
// Gee thanks Mocha ...
|
||||||
mocha.prototype.loadFiles = function() {
|
mocha.prototype.loadFiles = function() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--require ./test/mocha-loader-patch.js
|
--require ./test/mocha-loader-patch.js
|
||||||
--reporter spec
|
--reporter spec
|
||||||
--compilers coffee:coffee-script
|
--compilers coffee:coffee-script/register
|
||||||
--ui tdd
|
--ui tdd
|
||||||
--timeout 10000
|
--timeout 10000
|
||||||
--slow 600
|
--slow 600
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
var async = require('async');
|
var async = require('async');
|
||||||
var assert = require('assert');
|
var assert = require('assert-diff')({strict:true});
|
||||||
var Account = require('ripple-lib').UInt160;
|
var Account = require('ripple-lib').UInt160;
|
||||||
var Remote = require('ripple-lib').Remote;
|
var Remote = require('ripple-lib').Remote;
|
||||||
var Transaction = require('ripple-lib').Transaction;
|
var Transaction = require('ripple-lib').Transaction;
|
||||||
var testutils = require('./testutils');
|
var testutils = require('./testutils');
|
||||||
var config = testutils.init_config();
|
var config = testutils.init_config();
|
||||||
|
|
||||||
suite('Order Book', function() {
|
suite('Order Book', function() {
|
||||||
var $ = { };
|
var $ = { };
|
||||||
|
|
||||||
setup(function(done) {
|
setup(function(done) {
|
||||||
testutils.build_setup().call($, done);
|
testutils.build_setup().call($, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
teardown(function(done) {
|
teardown(function(done) {
|
||||||
testutils.build_teardown().call($, done);
|
testutils.build_teardown().call($, done);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Track offers', function (done) {
|
test('Track offers', function (done) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
var steps = [
|
var steps = [
|
||||||
function(callback) {
|
function(callback) {
|
||||||
self.what = 'Create accounts';
|
self.what = 'Create accounts';
|
||||||
@@ -32,17 +32,17 @@ suite('Order Book', function() {
|
|||||||
callback
|
callback
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
function waitLedgers(callback) {
|
function waitLedgers(callback) {
|
||||||
self.what = 'Wait ledger';
|
self.what = 'Wait ledger';
|
||||||
|
|
||||||
$.remote.once('ledger_closed', function() {
|
$.remote.once('ledger_closed', function() {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
$.remote.ledger_accept();
|
$.remote.ledger_accept();
|
||||||
},
|
},
|
||||||
|
|
||||||
function verifyBalance(callback) {
|
function verifyBalance(callback) {
|
||||||
self.what = 'Verify balance';
|
self.what = 'Verify balance';
|
||||||
|
|
||||||
@@ -53,63 +53,63 @@ suite('Order Book', function() {
|
|||||||
callback
|
callback
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Set transfer rate';
|
self.what = 'Set transfer rate';
|
||||||
|
|
||||||
var tx = $.remote.transaction('AccountSet', {
|
var tx = $.remote.transaction('AccountSet', {
|
||||||
account: 'mtgox'
|
account: 'mtgox'
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.transferRate(1.1 * 1e9);
|
tx.transferRate(1.1 * 1e9);
|
||||||
|
|
||||||
tx.submit(function(err, m) {
|
tx.submit(function(err, m) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.strictEqual(m.engine_result, 'tesSUCCESS');
|
assert.strictEqual(m.engine_result, 'tesSUCCESS');
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
testutils.ledger_wait($.remote, tx);
|
testutils.ledger_wait($.remote, tx);
|
||||||
},
|
},
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Set limits';
|
self.what = 'Set limits';
|
||||||
|
|
||||||
testutils.credit_limits($.remote, {
|
testutils.credit_limits($.remote, {
|
||||||
'alice' : '1000/USD/mtgox',
|
'alice' : '1000/USD/mtgox',
|
||||||
'bob' : '1000/USD/mtgox'
|
'bob' : '1000/USD/mtgox'
|
||||||
},
|
},
|
||||||
callback);
|
callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Distribute funds';
|
self.what = 'Distribute funds';
|
||||||
|
|
||||||
testutils.payments($.remote, {
|
testutils.payments($.remote, {
|
||||||
'mtgox' : [ '100/USD/alice', '50/USD/bob' ]
|
'mtgox' : [ '100/USD/alice', '50/USD/bob' ]
|
||||||
},
|
},
|
||||||
callback);
|
callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Create offer';
|
self.what = 'Create offer';
|
||||||
|
|
||||||
// get 4000/XRP pay 10/USD : offer pays 10 USD for 4000 XRP
|
// get 4000/XRP pay 10/USD : offer pays 10 USD for 4000 XRP
|
||||||
var tx = $.remote.transaction('OfferCreate', {
|
var tx = $.remote.transaction('OfferCreate', {
|
||||||
account: 'alice',
|
account: 'alice',
|
||||||
taker_pays: '4000',
|
taker_pays: '4000',
|
||||||
taker_gets: '10/USD/mtgox'
|
taker_gets: '10/USD/mtgox'
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.submit(function(err, m) {
|
tx.submit(function(err, m) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.strictEqual(m.engine_result, 'tesSUCCESS');
|
assert.strictEqual(m.engine_result, 'tesSUCCESS');
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
|
|
||||||
testutils.ledger_wait($.remote, tx);
|
testutils.ledger_wait($.remote, tx);
|
||||||
},
|
},
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Create order book';
|
self.what = 'Create order book';
|
||||||
|
|
||||||
@@ -118,13 +118,13 @@ suite('Order Book', function() {
|
|||||||
issuer_gets: Account.json_rewrite('mtgox'),
|
issuer_gets: Account.json_rewrite('mtgox'),
|
||||||
currency_gets: 'USD'
|
currency_gets: 'USD'
|
||||||
});
|
});
|
||||||
|
|
||||||
ob.on('model', function(){});
|
ob.on('model', function(){});
|
||||||
|
|
||||||
ob.getOffers(function(err, offers) {
|
ob.getOffers(function(err, offers) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
//console.log('OFFERS', offers);
|
// console.log('OFFERS', offers);
|
||||||
|
|
||||||
var expected = [
|
var expected = [
|
||||||
{ Account: 'rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn',
|
{ Account: 'rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn',
|
||||||
BookDirectory: 'AE0A97F385FFE42E3096BA3F98A0173090FE66A3C2482FE0570E35FA931A0000',
|
BookDirectory: 'AE0A97F385FFE42E3096BA3F98A0173090FE66A3C2482FE0570E35FA931A0000',
|
||||||
@@ -132,8 +132,6 @@ suite('Order Book', function() {
|
|||||||
Flags: 0,
|
Flags: 0,
|
||||||
LedgerEntryType: 'Offer',
|
LedgerEntryType: 'Offer',
|
||||||
OwnerNode: '0000000000000000',
|
OwnerNode: '0000000000000000',
|
||||||
PreviousTxnID: offers[0].PreviousTxnID,
|
|
||||||
PreviousTxnLgrSeq: offers[0].PreviousTxnLgrSeq,
|
|
||||||
Sequence: 2,
|
Sequence: 2,
|
||||||
TakerGets: { currency: 'USD',
|
TakerGets: { currency: 'USD',
|
||||||
issuer: 'rGihwhaqU8g7ahwAvTq6iX5rvsfcbgZw6v',
|
issuer: 'rGihwhaqU8g7ahwAvTq6iX5rvsfcbgZw6v',
|
||||||
@@ -142,38 +140,38 @@ suite('Order Book', function() {
|
|||||||
TakerPays: '4000',
|
TakerPays: '4000',
|
||||||
index: 'CD6AE78EE0A5438978501A0404D9093597F57B705D566B5070D58BD48F98468C',
|
index: 'CD6AE78EE0A5438978501A0404D9093597F57B705D566B5070D58BD48F98468C',
|
||||||
owner_funds: '100',
|
owner_funds: '100',
|
||||||
quality: '400',
|
|
||||||
is_fully_funded: true,
|
is_fully_funded: true,
|
||||||
taker_gets_funded: '10',
|
taker_gets_funded: '10',
|
||||||
taker_pays_funded: '4000' }
|
taker_pays_funded: '4000' }
|
||||||
]
|
]
|
||||||
|
|
||||||
assert.deepEqual(offers, expected);
|
assert.deepEqual(offers, expected);
|
||||||
|
|
||||||
callback(null, ob);
|
callback(null, ob);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
function (ob, callback) {
|
function (ob, callback) {
|
||||||
self.what = 'Create offer';
|
self.what = 'Create offer';
|
||||||
|
|
||||||
// get 5/USD pay 2000/XRP: offer pays 2000 XRP for 5 USD
|
// get 5/USD pay 2000/XRP: offer pays 2000 XRP for 5 USD
|
||||||
var tx = $.remote.transaction('OfferCreate', {
|
var tx = $.remote.transaction('OfferCreate', {
|
||||||
account: 'bob',
|
account: 'bob',
|
||||||
taker_pays: '5/USD/mtgox',
|
taker_pays: '5/USD/mtgox',
|
||||||
taker_gets: '2000',
|
taker_gets: '2000',
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.submit(function(err, m) {
|
tx.submit(function(err, m) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.strictEqual(m.engine_result, 'tesSUCCESS');
|
assert.strictEqual(m.engine_result, 'tesSUCCESS');
|
||||||
callback(null, ob);
|
callback(null, ob);
|
||||||
});
|
});
|
||||||
|
|
||||||
testutils.ledger_wait($.remote, tx);
|
testutils.ledger_wait($.remote, tx);
|
||||||
},
|
},
|
||||||
|
|
||||||
function (ob, callback) {
|
function (ob, callback) {
|
||||||
self.what = 'Check order book tracking';
|
self.what = 'Check order book tracking';
|
||||||
|
|
||||||
ob.getOffers(function(err, offers) {
|
ob.getOffers(function(err, offers) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
@@ -186,17 +184,14 @@ suite('Order Book', function() {
|
|||||||
Flags: 0,
|
Flags: 0,
|
||||||
LedgerEntryType: 'Offer',
|
LedgerEntryType: 'Offer',
|
||||||
OwnerNode: '0000000000000000',
|
OwnerNode: '0000000000000000',
|
||||||
PreviousTxnID: offers[0].PreviousTxnID,
|
|
||||||
PreviousTxnLgrSeq: offers[0].PreviousTxnLgrSeq,
|
|
||||||
Sequence: 2,
|
Sequence: 2,
|
||||||
TakerGets:
|
TakerGets:
|
||||||
{ currency: 'USD',
|
{ currency: 'USD',
|
||||||
issuer: 'rGihwhaqU8g7ahwAvTq6iX5rvsfcbgZw6v',
|
issuer: 'rGihwhaqU8g7ahwAvTq6iX5rvsfcbgZw6v',
|
||||||
value: '5' },
|
value: '5' },
|
||||||
TakerPays: '2000',
|
TakerPays: '2000',
|
||||||
index: 'CD6AE78EE0A5438978501A0404D9093597F57B705D566B5070D58BD48F98468C',
|
index: 'CD6AE78EE0A5438978501A0404D9093597F57B705D566B5070D58BD48F98468C',
|
||||||
owner_funds: '94.5',
|
owner_funds: '94.5',
|
||||||
quality: '400',
|
|
||||||
is_fully_funded: true,
|
is_fully_funded: true,
|
||||||
taker_gets_funded: '5',
|
taker_gets_funded: '5',
|
||||||
taker_pays_funded: '2000' }
|
taker_pays_funded: '2000' }
|
||||||
@@ -207,7 +202,7 @@ suite('Order Book', function() {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
async.waterfall(steps, function (error) {
|
async.waterfall(steps, function (error) {
|
||||||
assert(!error, self.what + ': ' + error);
|
assert(!error, self.what + ': ' + error);
|
||||||
done();
|
done();
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ make_suite('Robust transaction submission', function() {
|
|||||||
var tx = $.remote.transaction().payment({
|
var tx = $.remote.transaction().payment({
|
||||||
from: 'root',
|
from: 'root',
|
||||||
to: 'alice',
|
to: 'alice',
|
||||||
amount: Amount.from_human('1XRP')
|
amount: Amount.from_human('1 XRP')
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.once('submitted', function(m) {
|
tx.once('submitted', function(m) {
|
||||||
@@ -72,16 +72,16 @@ make_suite('Robust transaction submission', function() {
|
|||||||
tx.submit();
|
tx.submit();
|
||||||
|
|
||||||
//Invoke callback immediately
|
//Invoke callback immediately
|
||||||
callback();
|
callback(null, tx);
|
||||||
},
|
},
|
||||||
|
|
||||||
function sendValidTransaction(callback) {
|
function sendValidTransaction(previousTx, callback) {
|
||||||
self.what = 'Send normal transaction which should succeed';
|
self.what = 'Send normal transaction which should succeed';
|
||||||
|
|
||||||
var tx = $.remote.transaction().payment({
|
var tx = $.remote.transaction().payment({
|
||||||
from: 'root',
|
from: 'root',
|
||||||
to: 'bob',
|
to: 'bob',
|
||||||
amount: Amount.from_human('1XRP')
|
amount: Amount.from_human('1 XRP')
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.on('submitted', function(m) {
|
tx.on('submitted', function(m) {
|
||||||
@@ -99,7 +99,8 @@ make_suite('Robust transaction submission', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
tx.once('final', function() {
|
tx.once('final', function() {
|
||||||
callback();
|
previousTx.once('final', function(){ callback(); });
|
||||||
|
testutils.ledger_wait($.remote, previousTx);
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.submit();
|
tx.submit();
|
||||||
@@ -121,7 +122,7 @@ make_suite('Robust transaction submission', function() {
|
|||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
async.series(steps, function(err) {
|
async.waterfall(steps, function(err) {
|
||||||
assert(!err, self.what + ': ' + err);
|
assert(!err, self.what + ': ' + err);
|
||||||
assert(self.resubmitted, 'Transaction failed to resubmit');
|
assert(self.resubmitted, 'Transaction failed to resubmit');
|
||||||
done();
|
done();
|
||||||
@@ -161,7 +162,7 @@ make_suite('Robust transaction submission', function() {
|
|||||||
var tx = $.remote.transaction().payment({
|
var tx = $.remote.transaction().payment({
|
||||||
from: 'root',
|
from: 'root',
|
||||||
to: 'alice',
|
to: 'alice',
|
||||||
amount: Amount.from_human('1XRP')
|
amount: Amount.from_human('1 XRP')
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.submit();
|
tx.submit();
|
||||||
@@ -241,7 +242,7 @@ make_suite('Robust transaction submission', function() {
|
|||||||
var tx = $.remote.transaction().payment({
|
var tx = $.remote.transaction().payment({
|
||||||
from: 'root',
|
from: 'root',
|
||||||
to: 'alice',
|
to: 'alice',
|
||||||
amount: Amount.from_human('1XRP')
|
amount: Amount.from_human('1 XRP')
|
||||||
});
|
});
|
||||||
|
|
||||||
tx.once('submitted', function(m) {
|
tx.once('submitted', function(m) {
|
||||||
@@ -334,7 +335,7 @@ make_suite('Robust transaction submission', function() {
|
|||||||
var tx = $.remote.transaction().payment({
|
var tx = $.remote.transaction().payment({
|
||||||
from: 'root',
|
from: 'root',
|
||||||
to: 'alice',
|
to: 'alice',
|
||||||
amount: Amount.from_human('1XRP')
|
amount: Amount.from_human('1 XRP')
|
||||||
});
|
});
|
||||||
|
|
||||||
var timed_out = false;
|
var timed_out = false;
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ function(remote, src, account, amount, callback) {
|
|||||||
// 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
|
||||||
// the ledger is not in the expected state.
|
// the ledger is not in the expected state.
|
||||||
var info = remote.requestAccountInfo(account);
|
var info = remote.requestAccountInfo({account: account});
|
||||||
|
|
||||||
info.once('success', function(result) {
|
info.once('success', function(result) {
|
||||||
// The account exists. Fail by returning an error to callback.
|
// The account exists. Fail by returning an error to callback.
|
||||||
|
|||||||
Reference in New Issue
Block a user