Browse Source

Fix build after pull.

etomic
Artem Pikulin 7 years ago
parent
commit
7053d4fd54
  1. 2
      iguana/exchanges/CMakeLists.txt
  2. 138
      iguana/exchanges/LP_etomic.c
  3. 3
      iguana/exchanges/mm.c

2
iguana/exchanges/CMakeLists.txt

@ -2,4 +2,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(marketmaker mm.c)
include_directories(../../crypto777)
target_sources(marketmaker PRIVATE ../mini-gmp.c)
target_sources(marketmaker PRIVATE ../groestl.c)
target_sources(marketmaker PRIVATE ../segwit_addr.c)
target_link_libraries(marketmaker PRIVATE nanomsg curl pthread m libcrypto777 libjpeg libsecp256k1 "-Wl,--allow-multiple-definition" etomiclib)

138
iguana/exchanges/LP_etomic.c

@ -21,142 +21,12 @@
//
// Created by artem on 24.01.18.
//
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
char* from;
char* to;
char* amount;
int nonce;
char* secretKey;
} BasicTxData;
typedef struct {
char* dealId;
char* bobAddress;
char* aliceHash;
char* bobHash;
} AliceInitEthInput;
typedef struct {
char* dealId;
char* amount;
char* tokenAddress;
char* bobAddress;
char* aliceHash;
char* bobHash;
} AliceInitErc20Input;
typedef struct {
char* dealId;
char* amount;
char* tokenAddress;
char* bobAddress;
char* aliceHash;
char* bobSecret;
} AliceReclaimsAlicePaymentInput;
typedef struct {
char* dealId;
char* amount;
char* tokenAddress;
char* aliceAddress;
char* aliceSecret;
char* bobHash;
} BobSpendsAlicePaymentInput;
typedef struct {
char* depositId;
char* aliceAddress;
char* bobHash;
} BobMakesEthDepositInput;
typedef struct {
char* depositId;
char* amount;
char* tokenAddress;
char* aliceAddress;
char* bobHash;
} BobMakesErc20DepositInput;
typedef struct {
char* depositId;
char* amount;
char* tokenAddress;
char* aliceAddress;
char* bobSecret;
char* aliceCanClaimAfter;
} BobRefundsDepositInput;
typedef struct {
char* depositId;
char* amount;
char* tokenAddress;
char* bobAddress;
char* bobHash;
char* aliceCanClaimAfter;
} AliceClaimsBobDepositInput;
typedef struct {
char* paymentId;
char* aliceAddress;
char* aliceHash;
} BobMakesEthPaymentInput;
typedef struct {
char* paymentId;
char* amount;
char* tokenAddress;
char* aliceAddress;
char* aliceHash;
} BobMakesErc20PaymentInput;
typedef struct {
char* paymentId;
char* amount;
char* tokenAddress;
char* aliceAddress;
char* aliceHash;
char* bobCanClaimAfter;
} BobReclaimsBobPaymentInput;
typedef struct {
char* paymentId;
char* amount;
char* tokenAddress;
char* aliceSecret;
char* bobAddress;
char* bobCanClaimAfter;
} AliceSpendsBobPaymentInput;
// Your prototype or Definition
#ifdef __cplusplus
}
#endif
#include <cpp-ethereum/etomicswap/etomiclib.h>
#define ETOMIC_ALICECONTRACT "0xe1D4236C5774D35Dc47dcc2E5E0CcFc463A3289c"
#define ETOMIC_BOBCONTRACT "0x9387Fd3a016bB0205e4e131Dde886B9d2BC000A2"
#define ETOMIC_SATOSHICAT "0000000000"
char *aliceInitsEthDeal(AliceInitEthInput input,BasicTxData txData);
char *aliceInitsErc20Deal(AliceInitErc20Input input,BasicTxData txData);
//char *aliceMakesEthPayment(AliceMakesEthPaymentInput input,BasicTxData txData);
//char *aliceMakesErc20Payment(AliceMakesErc20PaymentInput input,BasicTxData txData);
char *aliceSpendsBobPayment(AliceSpendsBobPaymentInput input,BasicTxData txData);
char *aliceReclaimsAlicePayment(AliceReclaimsAlicePaymentInput input,BasicTxData txData);
char *aliceClaimsBobDeposit(AliceClaimsBobDepositInput input,BasicTxData txData);
char *bobMakesEthDeposit(BobMakesEthDepositInput input,BasicTxData txData);
char *bobMakesErc20Deposit(BobMakesErc20DepositInput input,BasicTxData txData);
char *bobMakesEthPayment(BobMakesEthPaymentInput input,BasicTxData txData);
char *bobMakesErc20Payment(BobMakesErc20PaymentInput input,BasicTxData txData);
char *bobSpendsAlicePayment(BobSpendsAlicePaymentInput input,BasicTxData txData);
char *bobReclaimsBobPayment(BobReclaimsBobPaymentInput input,BasicTxData txData);
char *bobRefundsDeposit(BobRefundsDepositInput input,BasicTxData txData);
char *approveErc20(char *amount,char *from,char *secret,char *buffer,int32_t nonce);
int32_t LP_etomicsymbol(char *etomic,char *symbol)
{
struct iguana_info *coin;
@ -168,17 +38,17 @@ int32_t LP_etomicsymbol(char *etomic,char *symbol)
char *LP_etomicalice_start(struct basilisk_swap *swap)
{
AliceInitEthInput input; AliceInitErc20Input input20; BasicTxData txData;
AliceSendsEthPaymentInput input; AliceSendsErc20PaymentInput input20; BasicTxData txData;
// set input and txData fields from the swap data structure
memset(&txData,0,sizeof(txData));
if ( strcmp(swap->I.alicestr,"ETH") == 0 )
{
memset(&input,0,sizeof(input));
return(aliceInitsEthDeal(input,txData));
return(aliceSendsEthPayment(input,txData));
}
else
{
memset(&input20,0,sizeof(input20));
return(aliceInitsErc20Deal(input20,txData));
return(aliceSendsErc20Payment(input20,txData));
}
}

3
iguana/exchanges/mm.c

@ -72,7 +72,6 @@ void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveas
#include "LP_nativeDEX.c"
#include <cpp-ethereum/etomicswap/etomiclib.h>
void LP_ports(uint16_t *pullportp,uint16_t *pubportp,uint16_t *busportp,uint16_t netid)
{
@ -130,7 +129,7 @@ int main(int argc, const char * argv[])
char* ethSignedTx;
ethSignedTx = bobSendsEthDeposit(input, txData);
printf("%s", ethSignedTx);
printf("%s\n", ethSignedTx);
free(ethSignedTx);
char dirname[512],*passphrase; double incr; cJSON *retjson;
OS_init();

Loading…
Cancel
Save