diff --git a/.travis.yml b/.travis.yml index b77bb4622..581c49ba1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,15 +12,20 @@ matrix: before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get update && sudo apt-get install -y g++-7; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then chmod +x travis_cmake_linux.sh && ./travis_cmake_linux.sh; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then chmod +x travis_cmake_mac.sh && ./travis_cmake_mac.sh; fi - git submodule update --init --recursive script: - export VERSION=`echo "$(git tag -l --points-at HEAD)"` + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export THREAD_COUNT=`echo "$(nproc --all)"`; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export THREAD_COUNT=`echo "$(sysctl -n hw.physicalcpu)"`; fi - mkdir build && cd build - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DMM_VERSION="$VERSION" -DCMAKE_C_COMPILER=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-7 ..; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake -DMM_VERSION="$VERSION" ..; fi - - cmake --build . --target marketmaker-mainnet - - cmake --build . --target marketmaker-testnet + - echo "cmake --build . --target marketmaker-mainnet -j $THREAD_COUNT" + - cmake --build . --target marketmaker-mainnet -j $THREAD_COUNT + - cmake --build . --target marketmaker-testnet -j $THREAD_COUNT cache: apt: true diff --git a/Jenkinsfile b/Jenkinsfile index ee317926f..ef2e76a87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ rm -rf build mkdir build cd build cmake .. -cmake --build . --target marketmaker-testnet +cmake --build . --target marketmaker-testnet -j 4 cd ../ docker-compose build''' } @@ -34,24 +34,6 @@ docker-compose down''' ./start_BEER_OTHER_trade_inverted.sh ETH timeout 600 grep -q "SWAP completed" <(COMPOSE_HTTP_TIMEOUT=600 docker-compose logs -f clientnode) timeout 600 grep -q "SWAP completed" <(COMPOSE_HTTP_TIMEOUT=600 docker-compose logs -f seednode) -docker-compose down''' - } - } - stage('Trade BEER/ETOMIC') { - steps { - sh '''docker-compose up -d -./start_BEER_OTHER_trade.sh ETOMIC -timeout 600 grep -q "SWAP completed" <(COMPOSE_HTTP_TIMEOUT=600 docker-compose logs -f clientnode) -timeout 600 grep -q "SWAP completed" <(COMPOSE_HTTP_TIMEOUT=600 docker-compose logs -f seednode) -docker-compose down''' - } - } - stage('Trade ETOMIC/BEER') { - steps { - sh '''docker-compose up -d -./start_BEER_OTHER_trade_inverted.sh ETOMIC -timeout 600 grep -q "SWAP completed" <(COMPOSE_HTTP_TIMEOUT=600 docker-compose logs -f clientnode) -timeout 600 grep -q "SWAP completed" <(COMPOSE_HTTP_TIMEOUT=600 docker-compose logs -f seednode) docker-compose down''' } } diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index 045f58e15..fc48bbf3e 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1789,7 +1789,7 @@ char *LP_autobuy(void *ctx,int32_t fomoflag,char *myipaddr,int32_t mypubsock,cha destsatoshis = autxo->swap_satoshis; printf("second path dest %.8f from %.8f\n",dstr(destsatoshis),dstr(autxo->swap_satoshis)); } - if ( destsatoshis < (autxo->payment.value / LP_MINCLIENTVOL) || autxo->payment.value < desttxfee*LP_MINSIZE_TXFEEMULT ) + if ( relcoin->etomic[0] == 0 && (destsatoshis < (autxo->payment.value / LP_MINCLIENTVOL) || autxo->payment.value < desttxfee*LP_MINSIZE_TXFEEMULT )) { printf("destsatoshis %.8f vs utxo %.8f this would have triggered an quote error -13\n",dstr(destsatoshis),dstr(autxo->payment.value)); return(clonestr("{\"error\":\"cant find a deposit that is close enough in size. make another deposit that is a bit larger than what you want to trade\"}")); diff --git a/travis_cmake_linux.sh b/travis_cmake_linux.sh new file mode 100644 index 000000000..f11b08e4d --- /dev/null +++ b/travis_cmake_linux.sh @@ -0,0 +1,5 @@ +#!/bin/bash +sudo rm -rf /usr/local/cmake-3.9.2 && sudo rm -rf /usr/local/cmake +wget https://cmake.org/files/v3.12/cmake-3.12.0-rc2-Linux-x86_64.sh +chmod +x cmake-3.12.0-rc2-Linux-x86_64.sh +sudo ./cmake-3.12.0-rc2-Linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr/local \ No newline at end of file diff --git a/travis_cmake_mac.sh b/travis_cmake_mac.sh new file mode 100644 index 000000000..f2fbadca0 --- /dev/null +++ b/travis_cmake_mac.sh @@ -0,0 +1,6 @@ +#!/bin/bash +brew uninstall cmake --force +wget https://cmake.org/files/v3.12/cmake-3.12.0-rc2-Darwin-x86_64.tar.gz +tar -xzf cmake-3.12.0-rc2-Darwin-x86_64.tar.gz +cp -r cmake-3.12.0-rc2-Darwin-x86_64/CMake.app/Contents/bin/* /usr/local/bin/ +cp -r cmake-3.12.0-rc2-Darwin-x86_64/CMake.app/Contents/share/* /usr/local/share/ \ No newline at end of file