Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
8185e5f247
  1. 19
      iguana/swaps/iguana_BTCswap.c

19
iguana/swaps/iguana_BTCswap.c

@ -955,33 +955,38 @@ struct instantdex_stateinfo *BTC_initFSM(int32_t *n)
// [BLOCKING: feefound] Bob waits for fee and sends deposit when it appears, alice skips past // [BLOCKING: feefound] Bob waits for fee and sends deposit when it appears, alice skips past
instantdex_addevent(s,*n,"BTC_waitfee","gendep","poll","BTC_gendeposit"); // bob's virt instantdex_addevent(s,*n,"BTC_waitfee","gendep","poll","BTC_gendeposit"); // bob's virt
instantdex_addevent(s,*n,"BTC_waitfee","waitdep","poll","BTC_waitdeposit"); // alice's virt instantdex_addevent(s,*n,"BTC_waitfee","waitdep","poll","BTC_waitdeposit"); // alice's virt
instantdex_addevent(s,*n,"BTC_waitfee","poll","poll","BTC_waitfee"); instantdex_addevent(s,*n,"BTC_waitfee","sentprivs","poll","BTC_waitfee");
instantdex_addevent(s,*n,"BTC_waitfee","poll","sentprivs","BTC_waitfee");
instantdex_addevent(s,*n,"BTC_gendeposit","depmade","poll","BTC_waitaltpayment"); instantdex_addevent(s,*n,"BTC_gendeposit","depmade","poll","BTC_waitaltpayment");
instantdex_addevent(s,*n,"BTC_gendeposit","poll","poll","BTC_gendeposit"); instantdex_addevent(s,*n,"BTC_gendeposit","sentprivs","poll","BTC_gendeposit");
instantdex_addevent(s,*n,"BTC_gendeposit","poll","sentprivs","BTC_gendeposit");
// [BLOCKING: depfound] Alice waits for deposit to confirm and sends altpayment, bob skips // [BLOCKING: depfound] Alice waits for deposit to confirm and sends altpayment, bob skips
instantdex_addevent(s,*n,"BTC_waitdeposit","depfound","gotdep","BTC_waitpayment"); // alice virt instantdex_addevent(s,*n,"BTC_waitdeposit","depfound","gotdep","BTC_waitpayment"); // alice virt
instantdex_addevent(s,*n,"BTC_waitdeposit","gotdep","poll","BTC_waitdeposit"); instantdex_addevent(s,*n,"BTC_waitdeposit","gotdep","poll","BTC_waitdeposit");
instantdex_addevent(s,*n,"BTC_waitdeposit","poll","poll","BTC_waitdeposit"); instantdex_addevent(s,*n,"BTC_waitdeposit","sentprivs","poll","BTC_waitdeposit");
instantdex_addevent(s,*n,"BTC_waitdeposit","poll","sentprivs","BTC_waitdeposit");
// [BLOCKING: altfound] now Bob's turn to make sure altpayment is confirmed and send payment // [BLOCKING: altfound] now Bob's turn to make sure altpayment is confirmed and send payment
instantdex_addevent(s,*n,"BTC_waitaltpayment","altfound","gotalt","BTC_waitpayment"); // virt instantdex_addevent(s,*n,"BTC_waitaltpayment","altfound","gotalt","BTC_waitpayment"); // virt
instantdex_addevent(s,*n,"BTC_waitaltpayment","gotalt","poll","BTC_waitaltpayment"); instantdex_addevent(s,*n,"BTC_waitaltpayment","gotalt","poll","BTC_waitaltpayment");
instantdex_addevent(s,*n,"BTC_waitaltpayment","poll","poll","BTC_waitaltpayment"); instantdex_addevent(s,*n,"BTC_waitaltpayment","sentprivs","poll","BTC_waitaltpayment");
instantdex_addevent(s,*n,"BTC_waitaltpayment","poll","sentprivs","BTC_waitaltpayment");
// [BLOCKING: payfound] now Alice's turn to make sure payment is confrmed and send in claim or see bob's reclaim and reclaim // [BLOCKING: payfound] now Alice's turn to make sure payment is confrmed and send in claim or see bob's reclaim and reclaim
instantdex_addevent(s,*n,"BTC_waitpayment","payfound","gotpaytx","BTC_makeclaim"); // virt instantdex_addevent(s,*n,"BTC_waitpayment","payfound","gotpaytx","BTC_makeclaim"); // virt
instantdex_addevent(s,*n,"BTC_waitpayment","gotpaytx","poll","BTC_waitpayment"); instantdex_addevent(s,*n,"BTC_waitpayment","gotpaytx","poll","BTC_waitpayment");
instantdex_addevent(s,*n,"BTC_waitpayment","poll","poll","BTC_waitpayment"); instantdex_addevent(s,*n,"BTC_waitpayment","sentprivs","poll","BTC_waitpayment");
instantdex_addevent(s,*n,"BTC_waitpayment","poll","sentprivs","BTC_waitpayment");
// [BLOCKING: privM] Bob waits for privM either from Alice or alt blockchain // [BLOCKING: privM] Bob waits for privM either from Alice or alt blockchain
instantdex_addevent(s,*n,"BTC_makeclaim","claimed","didclaim","BTC_done"); instantdex_addevent(s,*n,"BTC_makeclaim","claimed","didclaim","BTC_done");
instantdex_addevent(s,*n,"BTC_makeclaim","didclaim","poll","BTC_cashmsig"); instantdex_addevent(s,*n,"BTC_makeclaim","didclaim","poll","BTC_cashmsig");
instantdex_addevent(s,*n,"BTC_makeclaim","poll","poll","BTC_makeclaim"); instantdex_addevent(s,*n,"BTC_makeclaim","poll","sentprivs","BTC_makeclaim");
instantdex_addevent(s,*n,"BTC_cashmsig","gotprivM","didmsig","BTC_done"); instantdex_addevent(s,*n,"BTC_cashmsig","gotprivM","didmsig","BTC_done");
instantdex_addevent(s,*n,"BTC_cashmsig","poll","poll","BTC_cashmsig"); instantdex_addevent(s,*n,"BTC_cashmsig","poll","sentprivs","BTC_cashmsig");
/*s = instantdex_statecreate(s,n,"ALICE_checkbobreclaim",ALICE_checkbobreclaimfunc,0,"ALICE_reclaimed",0,0); /*s = instantdex_statecreate(s,n,"ALICE_checkbobreclaim",ALICE_checkbobreclaimfunc,0,"ALICE_reclaimed",0,0);
instantdex_addevent(s,*n,"ALICE_checkbobreclaim","brefound","poll","ALICE_reclaimed"); instantdex_addevent(s,*n,"ALICE_checkbobreclaim","brefound","poll","ALICE_reclaimed");

Loading…
Cancel
Save