Commit Graph

53 Commits

Author SHA1 Message Date
Dmitry Holodov
adfb0fa602 Test cleanup (#135)
* version independent monerod path with localhost-only binding

* fixed lint target and install script

* created 3rd ETH key constant to avoid race condition in tests

* updated run-integration-tests.sh with the same changes made to run-unit-tests.sh

* new design for paritioning out 2 unique keys to test packages

* restored accidentally deleted tests/alice.key

* removed websocket connection leaks from tests

* made file paths unique between tests with better file cleanup

* fix for the websocket connection leak commit

* reverted increase of GenerateBlocks (didn't mean to commit that)

* fixed maker/taker key that I had reversed

* fixed incorrect zero-balance check

* fixed comment on ClaimOrRefund

* added back sample script for installing go in /usr/local/go

* etchclient creation cleanup using t.Cleanup()

* minor cleanup to ganache_test_keys code

* initial dynamic monero-wallet-rpc implementation for tests

* converted monero tests to use dynamic monero-wallet-rpc services

* unit tests all using dynamic monero-wallet-rpc services

* fixed 2 tests that failed after moving to dynamic monero-wallet-rpc services

* fixed low balance issues in TestSwapState_NotifyClaimed

Co-authored-by: noot <36753753+noot@users.noreply.github.com>
2022-06-29 13:36:03 -04:00
noot
cca0b6c771 allow for multiple ongoing swaps (#128) 2022-06-13 20:50:10 -04:00
noot
11e3b27c2e ui: metamask integration, swapd: implement external sender for front-end integration (#126) 2022-06-07 18:06:24 -04:00
noot
0eb4f73dcc refactor: create protocol backend, rename protocol packages to xmrmaker/xmrtaker (#123) 2022-06-02 22:08:20 -04:00
Matthew Di Ferrante
961ceea463 Optimize gas usage through less reads (#122)
* rework contracts to use less gas by storing just swap hash when creating a swap

* prevent overriding of existing swaps

* ensure swap exists when trying to refund

* update bindings script and go contract bindings

* update swapfactory go tests

* updating protocol, compiles

* update recoverer, everything builds

* fix cmd/recover tests

* fix recover tests

* lint

* fix checkContractCode

* fix protocol/ tests

* inherit secp256k1 instead of using library to prevent double deployment

* rerun abigen and hardcode runtime bin for now

* add nolint to long hardcoded runtime bin line

* cleanup commented out stuff

Co-authored-by: noot <elizabethjbinks@gmail.com>
2022-05-28 22:36:01 +02:00
noot
5384d707a5 add joining stagenet and recovery module documentation (#117) 2022-05-24 20:37:27 -04:00
noot
55ae59046c add more unit tests + errors clean up (#114) 2022-05-15 23:36:03 -04:00
noot
2b631d2d36 automated tester improvements and fixes (#111) 2022-05-09 21:30:07 -04:00
noot
968dd75fbd fixes for stagenet, log cleanup, add automated stagenet tester binary (#108) 2022-04-11 18:56:53 -04:00
noot
65d64544d7 implement unhappy path and error case integration tests (#102) 2022-03-21 15:54:41 -04:00
noot
d24eb78434 create separate integration test CI job, implement net_makeOfferAndSubscribe, swap_getOffers, implement happy path integration test (#101) 2022-03-15 22:50:05 -04:00
noot
f0021ce118 implement websocket client, net_takeOfferAndSubscribe (#100) 2022-03-07 22:05:27 -05:00
noot
e81de8cd57 implement websockets server and swap_subscribeSwap (#96) 2022-02-26 17:58:38 -05:00
noot
f98ba1f902 implement swap_getStage (#95) 2022-02-12 20:46:42 -05:00
noot
8a8bc8a943 implement swap_refund endpoint (#94) 2022-02-12 20:07:36 -05:00
noot
5d225ac41d add code coverage to unit tests step, add lots of unit tests (#79) 2022-02-05 23:07:29 -05:00
noot
d62765a1ff implement SwapFactory.sol and integrate into codebase (#85) 2022-01-26 19:27:29 -05:00
noot
b0b6cb5286 implement swap_ rpc service to allow for fetching of current/past swap statuses (#82) 2022-01-22 22:24:43 -05:00
noot
988b514cf1 cleanup codebase (#72)
* remove unused code, move some funcs around

* move monero/crypto to crypto/monero

* cleanup alice swap_state.go, move funcs

* move rpcclient and types package to common
2022-01-16 23:34:29 -05:00
noot
39e6cc0bcd integrate DLEq into protocol (#67)
* update contract to use secp256k1 curve verification

* update go contract bindings script and bindings

* cleanup rust code, move to its own folder

* remove commented out stuff

* go fmt

* add go wrapper around farcaster-dleq

* add unit tests for farcaster-dleq wrapper

* add dleq unit test for keys

* add swap.go claim test, worksgit status

* add swap.go refund tests

* lint

* update SendKeysMessage to include DLEqProof, update alice/bob generateKeys

* add dleq proof verification to alice/bob handlers

* move alice and bob to protocol package

* add common protocol funcs for generating/verifying dleq proof

* lint

* update alice to store secp256k1 pubkey commitments in contract, update alice/bob to use dleq secret when calling contract

* update alice unit tests

* fix bob unit tests

* update network msg size

* add build-dleq makefile step

* cleanup

* attempt to fix test

* skip inconsistent test on CI
2022-01-15 13:41:27 -05:00
noot
242cb82d92 implement recovery in case program crashes during swap (#65) 2022-01-11 23:40:46 -05:00
noot
5033587a4a refactor: allow for Bob to explicitly make offers and Alice to take them (#66)
* begin refactor of make/take offer

* implement ability to make offer, advertise new offers, lint, etc

* implement personal rpc service

* update readme instructions

* add check that taker of offer provides correct amount
2022-01-04 21:13:33 -05:00
noot
bcbb77d8f6 add private key proof to SendKeyMessage, verify on receipt (#62) 2021-12-11 20:54:21 -05:00
noot
d6aba125e4 improve linter and lint code (#58) 2021-12-11 11:26:06 -05:00
noot
acee21ce19 add --gas-price, --gas-limit flags, net_setGasPrice RPC (#55) 2021-12-06 22:00:55 -05:00
noot
0c41b794e7 add more unit tests, add integration tests (#53) 2021-12-01 23:54:39 -05:00
noot
d703279d9b update units passed by cli/RPC to be standard unts, not smallest denomination (#50)
* update units for cmd line/RPC to be ether and monero

* fix log

* cleanup

* lint
2021-11-28 16:57:56 -05:00
noot
e2cffc980a implement swapcli (#47)
* add lock to swapState

* cli created w discover, query, and initiate

* add bold logging

* update readme
2021-11-25 23:15:06 -05:00
noot
4fecb7977e fix reading privkey from file (#45)
* fix eth privkey size

* fix reading privkey from file
2021-11-24 13:34:44 -05:00
noot
1a84f05f11 fix eth privkey size (#44) 2021-11-24 12:37:37 -05:00
noot
f369b9a3bb create mainnet, stagenet, and dev environments (#41)
* add environment type, update monero address to use network prefix

* update tests

* pass env through flag

* update --ethereum-privkey to take a file

* config basepath and chainIDs

* fix tests

* update network protocol IDs

* pass env to net

* go fmt, bump ci go version to 1.17

* make directories when needed

* fix tests
2021-11-23 23:47:41 -05:00
noot
95d72b7b02 add view key checks using open_wallet and close_wallet (#40)
* add view key checks using open_wallet and close_wallet

* fix unit tests, update script

* fix tests
2021-11-22 22:22:39 -05:00
noot
5da175b471 utilize t0 and t1 logic in protocol code for Alice and Bob (#30) 2021-11-21 21:10:34 -05:00
noot
10749646df implement rpc server for daemon process, refactor codebase to be controlled via rpc calls (#23) 2021-11-14 18:48:07 -05:00
noot
c8644792ec add discovery and advertisement; update WantMessage to be ProvidesMessage (#21) 2021-11-13 19:18:01 -05:00
noot
09f53b7b06 move hard-coded values to consts file, cleanup context usage, add some tests for Bob (#18) 2021-10-29 17:47:29 -04:00
noot
e9057490f9 add ci checks for build, test, lint; lint code; change filenames to be go-idiomatic (#12) 2021-10-25 18:20:14 -04:00
noot
0c93532313 add log of alice's xmr balance after swap 2021-10-24 06:55:44 -04:00
noot
2b087ac2a0 use ipfs go-log for logging, cleanup logs 2021-10-24 06:09:09 -04:00
noot
7036c4636f update alice.NotifyClaimed 2021-10-23 20:43:07 -04:00
noot
2ce6df2ee3 attempt to get alice.NotifyClaimed working 2021-10-23 20:11:08 -04:00
noot
3cbd0a162e add NotifyClaimed message 2021-10-23 20:05:01 -04:00
noot
dd868d8a19 update alice/bob protocol 2021-10-23 19:42:27 -04:00
noot
f7138c5ad6 add monero crypto pubkey test 2021-10-23 18:35:48 -04:00
noot
4e424e74ef events working, protocol ok up until Claim secret check 2021-10-23 18:04:41 -04:00
noot
c72d5e8e01 protocol ok up to Alice receiving notify of lock 2021-10-23 17:24:25 -04:00
noot
a8e4ae5995 rename to bob.ClaimFunds 2021-10-23 17:04:43 -04:00
noot
c7ccbfcdb3 add alice.CreateMoneroWallet 2021-10-23 17:03:17 -04:00
noot
73f324968b implement alice.WatchForClaim and bob.WatchForReady 2021-10-23 16:46:44 -04:00
noot
493e225bbe working on Alice protocol 2021-10-23 16:17:50 -04:00