From a5b736b3f5fec48bf159b807903e32ace6d5aba6 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Wed, 9 Aug 2017 15:26:33 -0700 Subject: [PATCH] mtx: expose `commit` method returning a tx and view. --- lib/primitives/mtx.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/primitives/mtx.js b/lib/primitives/mtx.js index e3141fac..6c8c86e2 100644 --- a/lib/primitives/mtx.js +++ b/lib/primitives/mtx.js @@ -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