AthanorLabs / atomic-swap

💫 ETH-XMR atomic swap implementation
GNU Lesser General Public License v3.0
341 stars 44 forks source link

eth endpoint defaults and error handling #451

Closed dimalinux closed 1 year ago

dimalinux commented 1 year ago

This PR uses our environment config to set the ETH endpoint defaults for dev and stagenet. For mainnet, instead of giving an error because the code cannot connect to the default ganache port on localhost, we tell them that they need to set the endpoint.

Notable change: Our tests are using the http endpoint starting with this PR instead of the ws endpoint.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 71.28% and project coverage change: +0.38 :tada:

Comparison is base (c131112) 58.35% compared to head (b45cfb5) 58.73%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #451 +/- ## ========================================== + Coverage 58.35% 58.73% +0.38% ========================================== Files 123 123 Lines 11576 11581 +5 ========================================== + Hits 6755 6802 +47 + Misses 4103 4060 -43 - Partials 718 719 +1 ``` | [Impacted Files](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [ethereum/check\_swap\_creator\_contract.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZXRoZXJldW0vY2hlY2tfc3dhcF9jcmVhdG9yX2NvbnRyYWN0Lmdv) | `57.14% <ø> (ø)` | | | [protocol/backend/backend.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cHJvdG9jb2wvYmFja2VuZC9iYWNrZW5kLmdv) | `63.75% <ø> (ø)` | | | [protocol/swap/types.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cHJvdG9jb2wvc3dhcC90eXBlcy5nbw==) | `88.23% <ø> (ø)` | | | [protocol/xmrmaker/errors.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cHJvdG9jb2wveG1ybWFrZXIvZXJyb3JzLmdv) | `40.00% <ø> (ø)` | | | [protocol/xmrmaker/event.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cHJvdG9jb2wveG1ybWFrZXIvZXZlbnQuZ28=) | `71.52% <ø> (ø)` | | | [protocol/xmrtaker/event.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cHJvdG9jb2wveG1ydGFrZXIvZXZlbnQuZ28=) | `71.28% <ø> (+2.05%)` | :arrow_up: | | [rpc/swap.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-cnBjL3N3YXAuZ28=) | `23.64% <0.00%> (ø)` | | | [cmd/swapd/main.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y21kL3N3YXBkL21haW4uZ28=) | `66.14% <12.50%> (-1.06%)` | :arrow_down: | | [cmd/swapcli/main.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-Y21kL3N3YXBjbGkvbWFpbi5nbw==) | `43.91% <33.33%> (ø)` | | | [ethereum/swap\_creator.go](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-ZXRoZXJldW0vc3dhcF9jcmVhdG9yLmdv) | `8.02% <33.33%> (ø)` | | | ... and [12 more](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/AthanorLabs/atomic-swap/pull/451/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.