<commit_before>assert = require('assert')
Ripple = require('../../lib/ripple')

describe('depositing from ripple', function() {
  before(function(){
    client = new Ripple.Gateway.Client({
      api: 'http://localhost:3000',
      clientId: 'adminUsername',  
      clientSecret: 'somethingSuperSecretAndRandom'
    })
  })
  it('create a valid transaction record', function(done){
    client.createRippleDeposit({ 
      toCurrency: 'XAG',
      toAmount: '10',
      toIssuer: 'someIssurRippleAddress',
      toAddress: 'theGatewaysRippleAddress',
      fromAddress: 'someRippleAddress',
      txState: 'tesSUCCESS',
      txHash: 'someTransactionHash'
    }, function(err, rippleDeposit){
      console.log(err)
      console.log(rippleDeposit)
      assert.equal(rippleDeposit.txState, 'tesSUCCESS') 
      done()
    })
  })
})<commit_msg>[TEST] Randomly generate unique transaction hash<commit_after>assert = require('assert')
Ripple = require('../../lib/ripple')
crypto = require("crypto")

describe('depositing from ripple', function() {
  before(function(){
    client = new Ripple.Gateway.Client({
      api: 'http://localhost:3000',
      clientId: 'adminUsername',  
      clientSecret: 'somethingSuperSecretAndRandom'
    })
  })
  it('create a valid transaction record', function(done){
    txHash = crypto.randomBytes(32).toString('hex')
    client.createRippleDeposit({ 
      toCurrency: 'XAG',
      toAmount: '10',
      toIssuer: 'someIssurRippleAddress',
      toAddress: 'theGatewaysRippleAddress',
      fromAddress: 'someRippleAddress',
      txState: 'tesSUCCESS',
      txHash: txHash
    }, function(err, rippleDeposit){
      assert.equal(rippleDeposit.txState, 'tesSUCCESS') 
      done()
    })
  })
})
{'fraction_non_alphanumeric': 0.14195037507212926, 'fraction_numerical': 0.008078476630121177, 'mean_word_length': 3.5873015873015874, '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': '1669820', 'n_tokens_mistral': 565, 'n_tokens_neox': 524, 'n_words': 99}