lian / bitcoin-ruby

bitcoin utils and protocol in ruby.
Other
922 stars 322 forks source link

Clean up Gemfile and gemspec #264

Closed etscrivner closed 6 years ago

etscrivner commented 6 years ago

This change involved cleaning up the Gemfile and gemspec to help ensure that all dependencies required to run bitcoin-ruby and any of the coins it supports are all present. Namely, the following things were done:

Closes #257

etscrivner commented 6 years ago

The cross-test state was found and fixed using the following script:

#!/usr/bin/env ksh
#
# Runs tests in larger and larger groupings until the test that, when added,
# causes FAILING_SPEC to fail is added.
# 
typeset -a ALL_TESTS=(spec/bitcoin/bitcoin_spec.rb spec/bitcoin/protocol/addr_spec.rb spec/bitcoin/protocol/alert_spec.rb spec/bitcoin/protocol/aux_pow_spec.rb spec/bitcoin/protocol/bip143_spec.rb spec/bitcoin/protocol/block_spec.rb spec/bitcoin/protocol/getblocks_spec.rb spec/bitcoin/protocol/inv_spec.rb spec/bitcoin/protocol/notfound_spec.rb spec/bitcoin/protocol/parser_spec.rb spec/bitcoin/protocol/partial_merkle_tree_spec.rb spec/bitcoin/protocol/ping_spec.rb spec/bitcoin/protocol/tx_spec.rb spec/bitcoin/protocol/txin_spec.rb spec/bitcoin/protocol/txout_spec.rb)
const FAILING_SPEC="spec/bitcoin/protocol/version_spec.rb"

typeset -a TestsToRun=()
for file in "${ALL_TESTS[@]}"
do
    TestsToRun+=($file)
    SECP256K1_LIB_PATH=./secp256k1.so bacon "${TestsToRun[@]}" "${FAILING_SPEC}"
    if [[ $? -ne 0 ]]
    then
        echo "BAD TEST: ${file}"
        exit 0
    fi
done

# Discovered spec/bitcoin/protocol/aux_pow_spec.rb setting network to :namecoin
# was causing the issue.