mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Update integration tests for changes to ripple-lib account request API:
Account requests expect an object as first argument
This commit is contained in:
@@ -188,7 +188,7 @@ 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) ->
|
remote.request_account_lines { account: acc, ledger: 'validated' }, (err, lines) ->
|
||||||
done(lines)
|
done(lines)
|
||||||
|
|
||||||
account_set_factory = (remote, ledger, alias_for) ->
|
account_set_factory = (remote, ledger, alias_for) ->
|
||||||
@@ -636,7 +636,7 @@ execute_if_enabled (suite, skipped, enforced) ->
|
|||||||
test_if enforced, 'account_offers always shows their own offers', (done) ->
|
test_if enforced, 'account_offers always shows their own offers', (done) ->
|
||||||
{remote} = h = get_helpers()
|
{remote} = h = get_helpers()
|
||||||
|
|
||||||
remote.request_account_offers 'G1', null, 'validated', (err, res) ->
|
remote.request_account_offers { account: 'G1', ledger: 'validated' }, (err, res) ->
|
||||||
assert.equal res.offers.length, 2
|
assert.equal res.offers.length, 2
|
||||||
done()
|
done()
|
||||||
|
|
||||||
@@ -756,7 +756,7 @@ execute_if_enabled (suite, skipped, enforced) ->
|
|||||||
done()
|
done()
|
||||||
|
|
||||||
test 'offer was only partially consumed', (done) ->
|
test 'offer was only partially consumed', (done) ->
|
||||||
remote.request_account_offers 'A3', null, 'validated', (err, res) ->
|
remote.request_account_offers { account: 'A3', ledger: 'validated' }, (err, res) ->
|
||||||
assert res.offers.length == 1
|
assert res.offers.length == 1
|
||||||
assert res.offers[0].taker_gets.value, '999'
|
assert res.offers[0].taker_gets.value, '999'
|
||||||
done()
|
done()
|
||||||
@@ -794,7 +794,7 @@ execute_if_enabled (suite, skipped, enforced) ->
|
|||||||
done()
|
done()
|
||||||
|
|
||||||
test_if enforced, 'Partially consumed offer was removed by tes* payment', (done) ->
|
test_if enforced, 'Partially consumed offer was removed by tes* payment', (done) ->
|
||||||
remote.request_account_offers 'A3', null, 'validated', (err, res) ->
|
remote.request_account_offers { account: 'A3', ledger: 'validated' }, (err, res) ->
|
||||||
assert res.offers.length == 0
|
assert res.offers.length == 0
|
||||||
done()
|
done()
|
||||||
|
|
||||||
@@ -825,6 +825,6 @@ execute_if_enabled (suite, skipped, enforced) ->
|
|||||||
done()
|
done()
|
||||||
|
|
||||||
test_if enforced, 'offer was removed by offer_create', (done) ->
|
test_if enforced, 'offer was removed by offer_create', (done) ->
|
||||||
remote.request_account_offers 'A4', null, 'validated', (err, res) ->
|
remote.request_account_offers { account: 'A4', ledger: 'validated' }, (err, res) ->
|
||||||
assert res.offers.length == 0
|
assert res.offers.length == 0
|
||||||
done()
|
done()
|
||||||
@@ -125,7 +125,7 @@ class BulkRequests
|
|||||||
@assert callback?, "Must supply a callback"
|
@assert callback?, "Must supply a callback"
|
||||||
|
|
||||||
async.concatSeries(args_list, ((args, callback) =>
|
async.concatSeries(args_list, ((args, callback) =>
|
||||||
req = fn.apply @remote, args
|
req = fn.apply @remote, (args.map (arg) -> return { account: arg })
|
||||||
on_each?(args..., req)
|
on_each?(args..., req)
|
||||||
req.on("success", (m) =>
|
req.on("success", (m) =>
|
||||||
if m.status?
|
if m.status?
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ suite('NoRipple', function() {
|
|||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Check no-ripple sender';
|
self.what = 'Check no-ripple sender';
|
||||||
|
|
||||||
$.remote.requestAccountLines('root', void(0), 'CURRENT', function(err, m) {
|
$.remote.requestAccountLines({ account: 'root', ledger: 'validated' }, function(err, m) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
assert(typeof m === 'object');
|
assert(typeof m === 'object');
|
||||||
assert(Array.isArray(m.lines));
|
assert(Array.isArray(m.lines));
|
||||||
@@ -73,7 +73,7 @@ suite('NoRipple', function() {
|
|||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Check no-ripple destination';
|
self.what = 'Check no-ripple destination';
|
||||||
|
|
||||||
$.remote.requestAccountLines('alice', void(0), 'CURRENT', function(err, m) {
|
$.remote.requestAccountLines({ account: 'alice', ledger: 'validated' }, function(err, m) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
assert(typeof m === 'object');
|
assert(typeof m === 'object');
|
||||||
assert(Array.isArray(m.lines));
|
assert(Array.isArray(m.lines));
|
||||||
@@ -104,7 +104,7 @@ suite('NoRipple', function() {
|
|||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Check no-ripple cleared sender';
|
self.what = 'Check no-ripple cleared sender';
|
||||||
|
|
||||||
$.remote.requestAccountLines('root', void(0), 'CURRENT', function(err, m) {
|
$.remote.requestAccountLines({ account: 'root', ledger: 'validated' }, function(err, m) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
assert(typeof m === 'object');
|
assert(typeof m === 'object');
|
||||||
assert(Array.isArray(m.lines));
|
assert(Array.isArray(m.lines));
|
||||||
@@ -116,7 +116,7 @@ suite('NoRipple', function() {
|
|||||||
function (callback) {
|
function (callback) {
|
||||||
self.what = 'Check no-ripple cleared destination';
|
self.what = 'Check no-ripple cleared destination';
|
||||||
|
|
||||||
$.remote.requestAccountLines('alice', void(0), 'CURRENT', function(err, m) {
|
$.remote.requestAccountLines({ account: 'alice', ledger: 'validated' }, function(err, m) {
|
||||||
if (err) return callback(err);
|
if (err) return callback(err);
|
||||||
assert(typeof m === 'object');
|
assert(typeof m === 'object');
|
||||||
assert(Array.isArray(m.lines));
|
assert(Array.isArray(m.lines));
|
||||||
@@ -217,7 +217,7 @@ suite('NoRipple', function() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
function (callback) {
|
function (callback) {
|
||||||
$.remote.requestAccountLines('alice', function(err, res) {
|
$.remote.requestAccountLines({ account: 'alice' }, function(err, res) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.strictEqual(typeof res, 'object');
|
assert.strictEqual(typeof res, 'object');
|
||||||
assert(Array.isArray(res.lines));
|
assert(Array.isArray(res.lines));
|
||||||
|
|||||||
Reference in New Issue
Block a user