JS: Correctly construct submit request when using local_signing.

This commit is contained in:
Stefan Thomas
2013-02-08 03:15:43 +01:00
parent c886ae843e
commit 3fff761a1e
2 changed files with 11 additions and 4 deletions

View File

@@ -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' : [

View File

@@ -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;