mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 23:55:49 +00:00
Generate transaction hash in account_tx automatic binary handling
This commit is contained in:
@@ -1016,6 +1016,7 @@ Remote.prototype.requestAccountTx = function(options, callback) {
|
|||||||
tx.meta = new SerializedObject(transaction.meta).to_json();
|
tx.meta = new SerializedObject(transaction.meta).to_json();
|
||||||
tx.tx = new SerializedObject(transaction.tx_blob).to_json();
|
tx.tx = new SerializedObject(transaction.tx_blob).to_json();
|
||||||
tx.tx.ledger_index = transaction.ledger_index;
|
tx.tx.ledger_index = transaction.ledger_index;
|
||||||
|
tx.tx.hash = Transaction.from_json(tx.tx).hash();
|
||||||
return tx;
|
return tx;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1032,12 +1033,14 @@ Remote.prototype.requestAccountTx = function(options, callback) {
|
|||||||
self.removeAllListeners('success');
|
self.removeAllListeners('success');
|
||||||
|
|
||||||
self.once('success', function(res) {
|
self.once('success', function(res) {
|
||||||
res.transactions = res.transactions.filter(fn);
|
|
||||||
|
|
||||||
if (options.binary) {
|
if (options.binary) {
|
||||||
res.transactions = res.transactions.map(parseBinary);
|
res.transactions = res.transactions.map(parseBinary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fn !== Boolean) {
|
||||||
|
res.transactions = res.transactions.filter(fn);
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof options.map === 'function') {
|
if (typeof options.map === 'function') {
|
||||||
res.transactions = res.transactions.map(options.map);
|
res.transactions = res.transactions.map(options.map);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user