mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
JS: Add is_native() to Amount.
This commit is contained in:
committed by
Stefan Thomas
parent
252a81f3e2
commit
5db1dafc98
@@ -221,13 +221,18 @@ var verify_balance = function (remote, src, amount_json, callback) {
|
||||
assert(4 === arguments.length);
|
||||
var amount = Amount.from_json(amount_json);
|
||||
|
||||
if (amount.is_native()) {
|
||||
// XXX Not implemented.
|
||||
callback(false);
|
||||
}
|
||||
else {
|
||||
remote.request_ripple_balance(src, amount.issuer.to_json(), amount.currency.to_json(), 'CURRENT')
|
||||
.once('ripple_state', function (m) {
|
||||
// console.log("BALANCE: %s", JSON.stringify(m));
|
||||
// console.log("account_balance: %s", m.account_balance.to_text_full());
|
||||
// console.log("account_limit: %s", m.account_limit.to_text_full());
|
||||
// console.log("issuer_balance: %s", m.issuer_balance.to_text_full());
|
||||
// console.log("issuer_limit: %s", m.issuer_limit.to_text_full());
|
||||
// console.log("BALANCE: %s", JSON.stringify(m));
|
||||
// console.log("account_balance: %s", m.account_balance.to_text_full());
|
||||
// console.log("account_limit: %s", m.account_limit.to_text_full());
|
||||
// console.log("issuer_balance: %s", m.issuer_balance.to_text_full());
|
||||
// console.log("issuer_limit: %s", m.issuer_limit.to_text_full());
|
||||
|
||||
if (!m.account_balance.equals(amount)) {
|
||||
console.log("verify_balance: failed: %s vs %s is %s", src, amount_json, amount.to_text_full());
|
||||
@@ -236,6 +241,7 @@ var verify_balance = function (remote, src, amount_json, callback) {
|
||||
callback(!m.account_balance.equals(amount));
|
||||
})
|
||||
.request();
|
||||
}
|
||||
};
|
||||
|
||||
var verify_balances = function (remote, balances, callback) {
|
||||
|
||||
Reference in New Issue
Block a user