<commit_before>var Web3 = require('web3');
var solc = require('solc');
var TestRPC = require("ethereumjs-testrpc");

var fs = require('fs');
require.extensions['.sol'] = function (module, filename) {
    module.exports = fs.readFileSync(filename, 'utf8');
};

var web3 = new Web3();

if(process.env.PROVIDER == 'LIVE'){
    var httpProvider = new web3.providers.HttpProvider("http://192.168.127.12:8545");
    web3.setProvider(httpProvider);
} else{
    var testProvider = TestRPC.provider();
    web3.setProvider(testProvider);
}






var contracts = require('praetorian-contracts');
var compiled = solc.compile(contracts, 1).contracts;

module.exports = function (suite) {
    suite.timeout(1000000);

    return {
        init: function (callback) {
            web3.eth.getCoinbase(function (err, coinbase) {
                web3.eth.defaultAccount = coinbase
                callback();
            });
        },
        deploy: function (callback) {

            var abi = JSON.parse(compiled.Factory.interface);
            var code = compiled.Factory.bytecode;
            var gas = compiled.Factory.gasEstimates.creation[1];

            web3.eth.contract(abi).new({
                gas: gas * 2,
                data: code<commit_msg>build live and test<commit_after>var Web3 = require('web3');
var solc = require('solc');
var TestRPC = require("ethereumjs-testrpc");

var fs = require('fs');
require.extensions['.sol'] = function (module, filename) {
    module.exports = fs.readFileSync(filename, 'utf8');
};

var web3 = new Web3();

if(process.env.PROVIDER == 'LIVE'){
    var httpProvider = new web3.providers.HttpProvider("http://192.168.127.12:8545");
    web3.setProvider(httpProvider);
}

if(process.env.PROVIDER == 'TEST'){
    var testProvider = TestRPC.provider();
    web3.setProvider(testProvider);
}

var contracts = require('praetorian-contracts');
var compiled = solc.compile(contracts, 1).contracts;

module.exports = function (suite) {
    suite.timeout(1000000);

    return {
        init: function (callback) {
            web3.eth.getCoinbase(function (err, coinbase) {
                web3.eth.defaultAccount = coinbase
                callback();
            });
        },
        deploy: function (callback) {

            var abi = JSON.parse(compiled.Factory.interface);
            var code = compiled.Factory.bytecode;
            var gas = compiled.Factory.gasEstimates.creation[1];

            web3.eth.contract(abi).new({
                gas: gas * 2,
                data: code
{'fraction_non_alphanumeric': 0.14025356576862125, 'fraction_numerical': 0.028526148969889066, 'mean_word_length': 2.6915204678362574, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '295700', 'n_tokens_mistral': 813, 'n_tokens_neox': 756, 'n_words': 151}