mtx: expose commit method returning a tx and view.

This commit is contained in:
Christopher Jeffrey 2017-08-09 15:26:33 -07:00
parent bb008c50a1
commit a5b736b3f5
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1401,6 +1401,15 @@ MTX.prototype.toTX = function toTX() {
return new TX().inject(this);
};
/**
* Convert the MTX to a TX.
* @returns {Array} [tx, view]
*/
MTX.prototype.commit = function commit() {
return [this.toTX(), this.view];
};
/**
* Instantiate MTX from TX.
* @param {TX} tx