mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-23 13:45:48 +00:00
Add getLedgerVersion and unit test
This commit is contained in:
@@ -6,6 +6,7 @@ const disconnect = server.disconnect;
|
|||||||
const getServerInfo = server.getServerInfo;
|
const getServerInfo = server.getServerInfo;
|
||||||
const getFee = server.getFee;
|
const getFee = server.getFee;
|
||||||
const isConnected = server.isConnected;
|
const isConnected = server.isConnected;
|
||||||
|
const getLedgerVersion = server.getLedgerVersion;
|
||||||
const getTransaction = require('./ledger/transaction');
|
const getTransaction = require('./ledger/transaction');
|
||||||
const getTransactions = require('./ledger/transactions');
|
const getTransactions = require('./ledger/transactions');
|
||||||
const getTrustlines = require('./ledger/trustlines');
|
const getTrustlines = require('./ledger/trustlines');
|
||||||
@@ -34,6 +35,7 @@ RippleAPI.prototype = {
|
|||||||
isConnected,
|
isConnected,
|
||||||
getServerInfo,
|
getServerInfo,
|
||||||
getFee,
|
getFee,
|
||||||
|
getLedgerVersion,
|
||||||
|
|
||||||
getTransaction,
|
getTransaction,
|
||||||
getTransactions,
|
getTransactions,
|
||||||
|
|||||||
@@ -36,10 +36,15 @@ function getFee() {
|
|||||||
return common.dropsToXrp(this.remote.createTransaction()._computeFee());
|
return common.dropsToXrp(this.remote.createTransaction()._computeFee());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getLedgerVersion() {
|
||||||
|
return this.remote.getLedgerSequence();
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
connect: connect,
|
connect,
|
||||||
disconnect: disconnect,
|
disconnect,
|
||||||
isConnected: isConnected,
|
isConnected,
|
||||||
getServerInfo: getServerInfo,
|
getServerInfo,
|
||||||
getFee: getFee
|
getFee,
|
||||||
|
getLedgerVersion
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -190,4 +190,8 @@ describe('RippleAPI', function() {
|
|||||||
this.api.getPathFind(pathfind,
|
this.api.getPathFind(pathfind,
|
||||||
_.partial(checkResult, getPathFindResponse, done));
|
_.partial(checkResult, getPathFindResponse, done));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('getLedgerVersion', function() {
|
||||||
|
assert.strictEqual(this.api.getLedgerVersion(), 8819952);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user