Browse Source

Merge pull request #699 from artemii235/etomic

Increase gas limits. Add cmake-ubuntu Dockerfile.
patch-3
jl777 7 years ago
committed by GitHub
parent
commit
d52073501a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CMakeLists.txt
  2. 7
      Dockerfile
  3. 3
      crypto777/CMakeLists.txt
  4. 24
      crypto777/iguana_utils.c
  5. 2
      iguana/exchanges/CMakeLists.txt
  6. 2
      iguana/exchanges/etomicswap/etomiclib.cpp

2
CMakeLists.txt

@ -19,7 +19,7 @@ download_project(PROJ nanomsg
GIT_TAG 1.1.2
GIT_SHALLOW 1
GIT_PROGRESS 1
CMAKE_ARGS "-DNN_STATIC_LIB=ON -DNN_ENABLE_DOC=OFF -DNN_TESTS=OFF -DNN_TOOLS=OFF -DNN_ENABLE_NANOCAT=OFF -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PREFIX}"
CMAKE_ARGS "-DNN_STATIC_LIB=ON -DNN_ENABLE_GETADDRINFO_A=OFF -DNN_ENABLE_DOC=OFF -DNN_TESTS=OFF -DNN_TOOLS=OFF -DNN_ENABLE_NANOCAT=OFF -DCMAKE_INSTALL_PREFIX=${DEPS_INSTALL_PREFIX}"
UPDATE_DISCONNECTED 1
)

7
Dockerfile

@ -0,0 +1,7 @@
FROM ubuntu:17.10
RUN apt-get update && apt-get install -y git libcurl4-openssl-dev build-essential wget pax libleveldb-dev && apt-get clean
RUN wget https://cmake.org/files/v3.10/cmake-3.10.3-Linux-x86_64.sh && \
chmod +x cmake-3.10.3-Linux-x86_64.sh && \
./cmake-3.10.3-Linux-x86_64.sh --skip-license --exclude-subdir --prefix=/usr && \
rm -rf cmake-3.10.3-Linux-x86_64.sh
CMD rm -rf build && mkdir build && cd build && cmake .. && cmake --build . --target marketmaker-testnet

3
crypto777/CMakeLists.txt

@ -1,4 +1,5 @@
file(GLOB sources "*.c")
file(GLOB headers "*.h")
add_library(libcrypto777 ${sources} ${headers})
target_link_libraries(libcrypto777 PUBLIC curl)
target_compile_definitions(libcrypto777 PRIVATE USE_STATIC_NANOMSG)
target_link_libraries(libcrypto777 PUBLIC curl ${NANOMSG_LIBRARY})

24
crypto777/iguana_utils.c

@ -799,23 +799,23 @@ int32_t nn_base64_decode (const char *in, size_t in_len,uint8_t *out, size_t out
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
for (io = 0, ii = 0, v = 0, rem = 0; ii < in_len; ii++) {
if (isspace ((uint32_t)in [ii]))
continue;
if (in [ii] == '=')
break;
ch = DECODEMAP [(uint32_t)in [ii]];
// Discard invalid characters as per RFC 2045.
if (ch == 0xFF)
break;
v = (v << 6) | ch;
rem += 6;
if (rem >= 8) {
rem -= 8;
if (io >= out_len)
@ -839,7 +839,7 @@ int32_t nn_base64_encode (const uint8_t *in, size_t in_len,char *out, size_t out
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/";
for (io = 0, ii = 0, v = 0, rem = 0; ii < in_len; ii++) {
ch = in [ii];
v = (v << 8) | ch;
@ -851,26 +851,26 @@ int32_t nn_base64_encode (const uint8_t *in, size_t in_len,char *out, size_t out
out [io++] = ENCODEMAP [(v >> rem) & 63];
}
}
if (rem) {
v <<= (6 - rem);
if (io >= out_len)
return -ENOBUFS;
out [io++] = ENCODEMAP [v & 63];
}
// Pad to a multiple of 3
while (io & 3) {
if (io >= out_len)
return -ENOBUFS;
out [io++] = '=';
}
if (io >= out_len)
return -ENOBUFS;
out [io] = '\0';
return io;
}

2
iguana/exchanges/CMakeLists.txt

@ -1,6 +1,6 @@
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(MM_SOURCES mm.c ../mini-gmp.c ../groestl.c ../segwit_addr.c ../keccak.c LP_etomic.c)
set(MM_LIBS ${NANOMSG_LIBRARY} curl pthread libcrypto777 libjpeg libsecp256k1)
set(MM_LIBS curl pthread libcrypto777 libjpeg libsecp256k1)
add_executable(marketmaker-testnet ${MM_SOURCES})
add_executable(marketmaker-mainnet ${MM_SOURCES})
include_directories(../../crypto777)

2
iguana/exchanges/etomicswap/etomiclib.cpp

@ -26,7 +26,7 @@ TransactionSkeleton txDataToSkeleton(BasicTxData txData)
tx.from = jsToAddress(txData.from);
tx.to = jsToAddress(txData.to);
tx.value = jsToU256(txData.amount);
tx.gas = 100000;
tx.gas = 200000;
tx.gasPrice = getGasPriceFromStation() * boost::multiprecision::pow(u256(10), 9);
tx.nonce = getNonce(txData.from);
return tx;

Loading…
Cancel
Save