Improvements to js tests and increment of the ripple-lib version

This commit is contained in:
wltsmrz
2013-09-04 16:29:32 -07:00
committed by Vinnie Falco
parent 604ca590b6
commit 4109e51e30
9 changed files with 2129 additions and 2234 deletions

View File

@@ -19,202 +19,199 @@ buster.testCase("AccountSet", {
// 'setUp' : testutils.build_setup({verbose: true , no_server: false}),
'tearDown' : testutils.build_teardown(),
"RequireDestTag" :
function (done) {
var self = this;
"RequireDestTag" : function (done) {
var self = this;
async.waterfall([
function (callback) {
self.what = "Set RequireDestTag.";
async.waterfall([
function (callback) {
self.what = "Set RequireDestTag.";
self.remote.transaction()
.account_set("root")
.set_flags('RequireDestTag')
.on('proposed', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
self.remote.transaction()
.account_set("root")
.set_flags('RequireDestTag')
.on('submitted', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check RequireDestTag";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !(m.node.Flags & Remote.flags.account_root.RequireDestTag);
if (wrong)
console.log("Set RequireDestTag: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
function (callback) {
self.what = "Clear RequireDestTag.";
self.remote.transaction()
.account_set("root")
.set_flags('OptionalDestTag')
.on('proposed', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check No RequireDestTag";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !!(m.node.Flags & Remote.flags.account_root.RequireDestTag);
if (wrong)
console.log("Clear RequireDestTag: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
], function (error) {
buster.refute(error, self.what);
done();
});
callback(m.engine_result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check RequireDestTag";
"RequireAuth" :
function (done) {
var self = this;
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !(m.node.Flags & Remote.flags.account_root.RequireDestTag);
async.waterfall([
function (callback) {
self.what = "Set RequireAuth.";
if (wrong)
console.log("Set RequireDestTag: failed: %s", JSON.stringify(m));
self.remote.transaction()
.account_set("root")
.set_flags('RequireAuth')
.on('proposed', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check RequireAuth";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !(m.node.Flags & Remote.flags.account_root.RequireAuth);
if (wrong)
console.log("Set RequireAuth: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
function (callback) {
self.what = "Clear RequireAuth.";
self.remote.transaction()
.account_set("root")
.set_flags('OptionalAuth')
.on('proposed', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check No RequireAuth";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !!(m.node.Flags & Remote.flags.account_root.RequireAuth);
if (wrong)
console.log("Clear RequireAuth: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
// XXX Also check fails if something is owned.
], function (error) {
buster.refute(error, self.what);
done();
});
callback(wrong);
})
.request();
},
function (callback) {
self.what = "Clear RequireDestTag.";
"DisallowXRP" :
function (done) {
var self = this;
self.remote.transaction()
.account_set("root")
.set_flags('OptionalDestTag')
.on('submitted', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
async.waterfall([
function (callback) {
self.what = "Set DisallowXRP.";
self.remote.transaction()
.account_set("root")
.set_flags('DisallowXRP')
.on('proposed', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check DisallowXRP";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !(m.node.Flags & Remote.flags.account_root.DisallowXRP);
if (wrong)
console.log("Set RequireDestTag: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
function (callback) {
self.what = "Clear DisallowXRP.";
self.remote.transaction()
.account_set("root")
.set_flags('AllowXRP')
.on('proposed', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check AllowXRP";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !!(m.node.Flags & Remote.flags.account_root.DisallowXRP);
if (wrong)
console.log("Clear DisallowXRP: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
], function (error) {
buster.refute(error, self.what);
done();
});
callback(m.engine_result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check No RequireDestTag";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !!(m.node.Flags & Remote.flags.account_root.RequireDestTag);
if (wrong)
console.log("Clear RequireDestTag: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
], function (error) {
buster.refute(error, self.what);
done();
});
},
"RequireAuth" : function (done) {
var self = this;
async.waterfall([
function (callback) {
self.what = "Set RequireAuth.";
self.remote.transaction()
.account_set("root")
.set_flags('RequireAuth')
.on('submitted', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.engine_result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check RequireAuth";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !(m.node.Flags & Remote.flags.account_root.RequireAuth);
if (wrong)
console.log("Set RequireAuth: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
function (callback) {
self.what = "Clear RequireAuth.";
self.remote.transaction()
.account_set("root")
.set_flags('OptionalAuth')
.on('submitted', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.engine_result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check No RequireAuth";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !!(m.node.Flags & Remote.flags.account_root.RequireAuth);
if (wrong)
console.log("Clear RequireAuth: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
// XXX Also check fails if something is owned.
], function (error) {
buster.refute(error, self.what);
done();
});
},
"DisallowXRP" : function (done) {
var self = this;
async.waterfall([
function (callback) {
self.what = "Set DisallowXRP.";
self.remote.transaction()
.account_set("root")
.set_flags('DisallowXRP')
.on('submitted', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.engine_result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check DisallowXRP";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !(m.node.Flags & Remote.flags.account_root.DisallowXRP);
if (wrong)
console.log("Set RequireDestTag: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
function (callback) {
self.what = "Clear DisallowXRP.";
self.remote.transaction()
.account_set("root")
.set_flags('AllowXRP')
.on('submitted', function (m) {
//console.log("proposed: %s", JSON.stringify(m));
callback(m.engine_result !== 'tesSUCCESS');
})
.submit();
},
function (callback) {
self.what = "Check AllowXRP";
self.remote.request_account_flags('root', 'CURRENT')
.on('success', function (m) {
var wrong = !!(m.node.Flags & Remote.flags.account_root.DisallowXRP);
if (wrong)
console.log("Clear DisallowXRP: failed: %s", JSON.stringify(m));
callback(wrong);
})
.request();
},
], function (error) {
buster.refute(error, self.what);
done();
});
},
});
// vim:sw=2:sts=2:ts=8:et
// vim:sw=2:sts=2:ts=8:et