<commit_before>var assert = require('assert');

var Address = require('../src/address');
var ECKey = require('../src/eckey').ECKey;
var T = require('../src/transaction');
var Transaction = T.Transaction;
var Script = require('../src/script');
var network = require('../src/network');
var crypto = require('../src/crypto');

var helloblock = require('helloblock-js')({
  network: 'testnet'
});

describe('p2sh', function() {
  this.timeout(10000);

  it('spends from a 2-of-2 address', function(done) {
    var privKeys = [
      '<KEY>',
      '<KEY>'
    ].map(function(wif) {
      return ECKey.fromWIF(wif)
    })

    var pubKeys = privKeys.map(function(eck) {
      return eck.pub
    })
    var pubKeyBuffers = pubKeys.map(function(q) {
      return q.toBuffer()
    })
    var redeemScript = Script.createMultisigOutputScript(2, pubKeyBuffers)
    var hash160 = crypto.hash160(redeemScript.buffer)
    var multisigAddress = new Address(hash160, network.testnet.scriptHash)

    // Check what our target address's starting value is
    var targetAddress = 'mrCDrCybB6J1vRfbwM5hemdJz73FwDBC8r';
    helloblock.addresses.get(targetAddress, function(err, resp, resource) {<commit_msg>fixes integration test dependency paths<commit_after>var assert = require('assert');

var Address = require('../../src/address');
var ECKey = require('../../src/eckey').ECKey;
var T = require('../../src/transaction');
var Transaction = T.Transaction;
var Script = require('../../src/script');
var network = require('../../src/network');
var crypto = require('../../src/crypto');

var helloblock = require('helloblock-js')({
  network: 'testnet'
});

describe('p2sh', function() {
  this.timeout(10000);

  it('spends from a 2-of-2 address', function(done) {
    var privKeys = [
      '<KEY>',
      '<KEY>'
    ].map(function(wif) {
      return ECKey.fromWIF(wif)
    })

    var pubKeys = privKeys.map(function(eck) {
      return eck.pub
    })
    var pubKeyBuffers = pubKeys.map(function(q) {
      return q.toBuffer()
    })
    var redeemScript = Script.createMultisigOutputScript(2, pubKeyBuffers)
    var hash160 = crypto.hash160(redeemScript.buffer)
    var multisigAddress = new Address(hash160, network.testnet.scriptHash)

    // Check what our target address's starting value is
    var targetAddress = 'mrCDrCybB6J1vRfbwM5hemdJz73FwDBC8r';
    helloblock.addresses.get(targetAddress, function(err, resp, resource) {
{'fraction_non_alphanumeric': 0.15715467328370555, 'fraction_numerical': 0.019851116625310174, 'mean_word_length': 3.6608863198458574, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '482811', 'n_tokens_mistral': 826, 'n_tokens_neox': 793, 'n_words': 168}