<commit_before>/**
 * Service to create trust lines on Ripple
 */

'use strict';

var Utils = require('./../../utils/utils');

/**
* Creates a trst line between 2 ripple accounts
* @param rippleDestination target trustline endpoint
* @param rippleSource source trustline endpoint
* @param rippleSourceSecret source address secret (used to create the trustline)
*/
function set_trust(rippleDestination, rippleSource, rippleSourceSecret) {
  var remote = Utils.getNewConnectedRemote(rippleSource, );


}

exports.set_trust = set_trust;

exports.register = function(socket) {

}<commit_msg>Does this work? (set_trust)<commit_after>/**
 * Service to create trust lines on Ripple
 */

'use strict';

var Q = require('q');

var Utils = require('./../../utils/utils');

/**
* Creates a trst line between 2 ripple accounts
* @param rippleDestinationAddr target trustline endpoint
* @param rippleSourceAddr source trustline endpoint
* @param rippleSourceSecret source address secret (used to create the trustline)
*/
function set_trust(rippleDestinationAddr, rippleSourceAddr, rippleSourceSecret, limit, currency) {
  var currency = currency || 'EUR';
  var limit = limit || 1000;

  var deferred = Q.defer();

  var remote = Utils.getNewConnectedRemote(rippleSourceAddr, rippleSourceSecret);

  var transaction = remote.createTransaction('TrustSet', {
    account: rippleSourceAddr,
    limit: limit + '/' + currency + + '/' + rippleDestinationAddr;
  });

  transaction.on('reusbmitted', function()) {
    // mkay...
  }

  transaction.submit(function(err, res) {
    if(!err) {
      deferred.resolve(null); // See no evil
    } else {
      deferred.reject(err);
    }
  });

  return deffered.promise;
}

exports.set_trust = set_trust;

exports.register = function(socket) {

}
{'fraction_non_alphanumeric': 0.12295544275239707, 'fraction_numerical': 0.00338409475465313, 'mean_word_length': 4.2485207100591715, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1070426', 'n_tokens_mistral': 566, 'n_tokens_neox': 523, 'n_words': 147}