Merge branch 'develop' of https://github.com/ripple/ripple-lib into develop

This commit is contained in:
wltsmrz
2014-01-03 20:13:35 -08:00

View File

@@ -221,6 +221,11 @@ Transaction.prototype._getServer = function() {
*/
Transaction.prototype.complete = function() {
// Try to auto-fill the secret
if (!this._secret) {
this._secret = this._account_secret(this.tx_json.Account);
}
if (this.remote && typeof this.tx_json.Fee === 'undefined') {
if (this.remote.local_fee || !this.remote.trusted) {
this._server = this._getServer();
@@ -450,7 +455,6 @@ Transaction.prototype.accountSet = function(src) {
throw new Error('Source address invalid');
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'AccountSet';
this.tx_json.Account = UInt160.json_rewrite(src);
return this;
@@ -465,7 +469,6 @@ Transaction.prototype.claim = function(src, generator, public_key, signature) {
src = options.source || options.from;
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'Claim';
this.tx_json.Generator = generator;
this.tx_json.PublicKey = public_key;
@@ -484,7 +487,6 @@ Transaction.prototype.offerCancel = function(src, sequence) {
throw new Error('Source address invalid');
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'OfferCancel';
this.tx_json.Account = UInt160.json_rewrite(src);
this.tx_json.OfferSequence = Number(sequence);
@@ -509,7 +511,6 @@ Transaction.prototype.offerCreate = function(src, taker_pays, taker_gets, expira
throw new Error('Source address invalid');
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'OfferCreate';
this.tx_json.Account = UInt160.json_rewrite(src);
this.tx_json.TakerPays = Amount.json_rewrite(taker_pays);
@@ -545,7 +546,6 @@ Transaction.prototype.passwordFund = function(src, dst) {
throw new Error('Destination address invalid');
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'PasswordFund';
this.tx_json.Destination = UInt160.json_rewrite(dst);
return this;
@@ -565,7 +565,6 @@ Transaction.prototype.passwordSet = function(src, authorized_key, generator, pub
throw new Error('Source address invalid');
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'PasswordSet';
this.tx_json.RegularKey = authorized_key;
this.tx_json.Generator = generator;
@@ -614,7 +613,6 @@ Transaction.prototype.payment = function(src, dst, amount) {
amount = Amount.from_human(amount);
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'Payment';
this.tx_json.Account = UInt160.json_rewrite(src);
this.tx_json.Amount = Amount.json_rewrite(amount);
@@ -636,7 +634,6 @@ Transaction.prototype.rippleLineSet = function(src, limit, quality_in, quality_o
throw new Error('Source address invalid');
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'TrustSet';
this.tx_json.Account = UInt160.json_rewrite(src);
@@ -671,7 +668,6 @@ Transaction.prototype.walletAdd = function(src, amount, authorized_key, public_k
throw new Error('Source address invalid');
}
this._secret = this._account_secret(src);
this.tx_json.TransactionType = 'WalletAdd';
this.tx_json.Amount = Amount.json_rewrite(amount);
this.tx_json.RegularKey = authorized_key;