From 937f61434595343722895ca5df0f2903d996c1de Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Fri, 8 Feb 2013 03:15:43 +0100 Subject: [PATCH] JS: Correctly construct submit request when using local_signing. --- src/js/remote.js | 6 ++++++ src/js/transaction.js | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/js/remote.js b/src/js/remote.js index af05c2931c..8c2beb1e57 100644 --- a/src/js/remote.js +++ b/src/js/remote.js @@ -138,6 +138,12 @@ Request.prototype.tx_json = function (j) { return this; }; +Request.prototype.tx_blob = function (j) { + this.message.tx_blob = j; + + return this; +}; + Request.prototype.ripple_state = function (account, issuer, currency) { this.message.ripple_state = { 'accounts' : [ diff --git a/src/js/transaction.js b/src/js/transaction.js index e9d7e8c665..a6e0621ed9 100644 --- a/src/js/transaction.js +++ b/src/js/transaction.js @@ -356,6 +356,7 @@ Transaction.prototype.submit = function (callback) { return this; } else if (this.remote.local_signing) { this.sign(); + request.tx_blob(this.serialize().to_hex()); } else { if (!this.remote.trusted) { this.emit('error', { @@ -363,13 +364,13 @@ Transaction.prototype.submit = function (callback) { 'result_message' : "Attempt to give a secret to an untrusted server." }); return this; - } else { - request.secret(this._secret); } + + request.secret(this._secret); + request.build_path(this._build_path); + request.tx_json(this.tx_json); } - request.build_path(this._build_path); - request.tx_json(this.tx_json); request.request(); return this;