256: 2nd cet trial fixes r=da-kami a=da-kami
I wish I could have had the brainpower and dicipline to do the last commit in multiple atomic commits.
Quite a nightmare "fixing" all these things. Too many moving parts and complex code.
`@thomaseizinger` maybe you can help me split it up?
Co-authored-by: Daniel Karzel <daniel@comit.network>
267: Make HTTP listen address configurable r=bonomat a=bonomat
Maker and taker by default only listened on localhost:XXXX. Given our architecture it is very likely that the taker and maker might run on remote machine.
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
The DLC does not concern the UI, hence the amounts should be handles in satoshi.
Note: This commit enforces db reset of CFDs that are stored in `as_btc`.
We are looping over multiple CFDs when trying to publish the CET.
If we fail inside the loop then the next CFD(s) are not processed and CETs might not get published properly.
This should make the code more resilient.
Reasoning:
The state transition can fail, hence the result.
It can, however, happen that there is no failure, but we still did not transition to a new state.
In such cases we don't want to save the state in the database because it would be an unwanted duplicated entry.
The `Attestation` in the `oracle` module has `Desiarialization` rules that conflict with loading it from the db.
We should not reuse domain structs between modules anyway, so this was cleaned up by introducing a dedicated `model::Attestation` and mapping to `oracle::Attestation`.
258: Bump reqwest from 0.11.4 to 0.11.5 r=thomaseizinger a=dependabot[bot]
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.4 to 0.11.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/seanmonstar/reqwest/releases">reqwest's releases</a>.</em></p>
<blockquote>
<h2>v0.11.5</h2>
<ul>
<li>Add <code>ClientBuilder::http1_only()</code> method.</li>
<li>Add <code>tls::Version</code> type, and <code>ClientBuilder::min_tls_version()</code> and <code>ClientBuilder::max_tls_version()</code> methods.</li>
<li>Implement <code>TryFrom<Request></code> for <code>http::Request</code>.</li>
<li>Implement <code>Clone</code> for <code>Identity</code>.</li>
<li>Fix <code>NO_PROXY</code>environment variable parsing to more closely match curl's. Comma-separated entries are now trimmed for whitespace, and <code>*</code> is allowed to match everything.</li>
<li>Fix redirection to respect <code>https_only</code> option.</li>
<li>(wasm) Add <code>Body::as_bytes()</code> method.</li>
<li>(wasm) Fix sometimes wrong conversation of bytes into a <code>JsValue</code>.</li>
<li>(wasm) Avoid dependency on serde-serialize feature.</li>
</ul>
<h2>New Contributors 😍</h2>
<ul>
<li><a href="https://github.com/blyxxyz"><code>`@blyxxyz</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1294">seanmonstar/reqwest#1294</a></li>
<li><a href="https://github.com/Saruniks"><code>`@Saruniks</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1296">seanmonstar/reqwest#1296</a></li>
<li><a href="https://github.com/dlesl"><code>`@dlesl</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1313">seanmonstar/reqwest#1313</a></li>
<li><a href="https://github.com/Dr-Emann"><code>`@Dr-Emann</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1322">seanmonstar/reqwest#1322</a></li>
<li><a href="https://github.com/jmgilman"><code>`@jmgilman</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1335">seanmonstar/reqwest#1335</a></li>
<li><a href="https://github.com/silvioprog"><code>`@silvioprog</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1334">seanmonstar/reqwest#1334</a></li>
<li><a href="https://github.com/skystar-p"><code>`@skystar-p</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1341">seanmonstar/reqwest#1341</a></li>
<li><a href="https://github.com/abatkin"><code>`@abatkin</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1332">seanmonstar/reqwest#1332</a></li>
<li><a href="https://github.com/VictorBulba"><code>`@VictorBulba</code></a>` made their first contribution in <a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/pull/1270">seanmonstar/reqwest#1270</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md">reqwest's changelog</a>.</em></p>
<blockquote>
<h2>v0.11.5</h2>
<ul>
<li>Add <code>ClientBuilder::http1_only()</code> method.</li>
<li>Add <code>tls::Version</code> type, and <code>ClientBuilder::min_tls_version()</code> and <code>ClientBuilder::max_tls_version()</code> methods.</li>
<li>Implement <code>TryFrom<Request></code> for <code>http::Request</code>.</li>
<li>Implement <code>Clone</code> for <code>Identity</code>.</li>
<li>Fix <code>NO_PROXY</code>environment variable parsing to more closely match curl's. Comma-separated entries are now trimmed for whitespace, and <code>*</code> is allowed to match everything.</li>
<li>Fix redirection to respect <code>https_only</code> option.</li>
<li>(wasm) Add <code>Body::as_bytes()</code> method.</li>
<li>(wasm) Fix sometimes wrong conversation of bytes into a <code>JsValue</code>.</li>
<li>(wasm) Avoid dependency on serde-serialize feature.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="5cc1eff23b"><code>5cc1eff</code></a> v0.11.5</li>
<li><a href="d40276c0f0"><code>d40276c</code></a> wasm: add missing <code>as_bytes</code> method to <code>Body</code> implementation (<a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/issues/1270">#1270</a>)</li>
<li><a href="203cd5bfdc"><code>203cd5b</code></a> Follow cURL's rules for parsing and matching NO_PROXY (<a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/issues/1332">#1332</a>)</li>
<li><a href="6d682b53e2"><code>6d682b5</code></a> use Array when converting bytes into JsValue (<a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/issues/1341">#1341</a>)</li>
<li><a href="cf87893b17"><code>cf87893</code></a> Implement Clone for Identity (<a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/issues/1334">#1334</a>)</li>
<li><a href="eb9e343142"><code>eb9e343</code></a> docs: adds amplifying note about private key formats (<a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/issues/1335">#1335</a>)</li>
<li><a href="cfa301c7fa"><code>cfa301c</code></a> wasm: avoid dependency on serde-serialize feature (<a href="https://github-redirect.dependabot.com/seanmonstar/reqwest/issues/1337">#1337</a>)</li>
<li><a href="2767071cac"><code>2767071</code></a> Optimize <code>replace_headers</code> to avoid copies of keys</li>
<li><a href="2881354c90"><code>2881354</code></a> Fix more clippy warnings</li>
<li><a href="4be5ec7ffd"><code>4be5ec7</code></a> Replace use of assert_eq with assert</li>
<li>Additional commits viewable in <a href="https://github.com/seanmonstar/reqwest/compare/v0.11.4...v0.11.5">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=reqwest&package-manager=cargo&previous-version=0.11.4&new-version=0.11.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting ``@dependabot` rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
263: Signet support and bug fix r=bonomat a=bonomat
Valid hours are only 0-23, which means we need to roll over to the next day.
Unfortunately I could not find a public electrum server for Signet so maybe we want to run one ourselves. I tested with a node locally and it works.
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
253: A few fixes r=bonomat a=bonomat
A few fixes
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
252: Rework oracle actor communication r=da-kami a=da-kami
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Daniel Karzel <daniel@comit.network>
Note: Since our sliding window of `next_24_hours` in the oracle actor is current hour `+[1..24]` the window should always be able to handle fetching an event of current hour + 1.
211: Rename "Accept / Reject" to "Pending" in CfdTables r=klochowicz a=klochowicz
Pending is a more succinct nudge to the user that they should react with an
action to the CFDs inside these tables.
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
Instead of the oracle actor sending out the `Announcements` we only store them internally and let the cfd actors chose what `Announcement` is relevant given the term of the offer.
The specific `Announcement` is then fetched from the oracle actor.
The monitoring logic for pending attestations remains the same.
249: First cet trial fixes r=da-kami a=da-kami
Note: Just discussed with `@thomaseizinger` that the Oracle actor should be changed to be able to handle multiple terms.
So, instead of the oracle actor sending out the current 24 hours to the cfd actor, the cfd actor should be able to request events for a time interval (i.e. different terms).
Changing that should also allow us to test more easily, because we can use a very short term.
Co-authored-by: Daniel Karzel <daniel@comit.network>
250: Roll over bug fixes r=bonomat a=bonomat
With these bugs fixed we get all the way back into `Open` state :)
Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>