Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Remove Accept/Decline from Alice's actions #598

Merged
merged 1 commit into from Jan 2, 2019

Conversation

luckysori
Copy link
Contributor

Resolves #561.

@ghost ghost assigned luckysori Dec 20, 2018
@ghost ghost added the review label Dec 20, 2018
@luckysori luckysori force-pushed the 561-alice-cannot-accept-or-decline branch from 7d13387 to d8dd413 Compare December 20, 2018 06:00
@luckysori luckysori requested a review from a team December 21, 2018 03:25
@mergify mergify bot removed the review label Dec 21, 2018
@luckysori luckysori changed the title [WIP] Remove Accept/Decline from Alice's actions Remove Accept/Decline from Alice's actions Dec 21, 2018
Copy link
Contributor

@D4nte D4nte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment regarding the macro, happy to approve after.

}

#[macro_export]
macro_rules! with_swap_types_bob {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it a one-time use macro? is there much point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It saves us about 60 lines of duplicated code for every (alpha_ledger, beta_ledger, alpha_asset, beta_asset) tuple.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I understand know, should have said that the macro repeats the passed arguments... 😄

type Role = Bob<AL, BL, AA, BA>;
$fn()
}
_ => unimplemented!(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when do we implement that?

@luckysori luckysori force-pushed the 561-alice-cannot-accept-or-decline branch from d8dd413 to 36319fe Compare December 28, 2018 07:01
@ghost ghost added review and removed work-in-progress labels Dec 28, 2018
@luckysori luckysori force-pushed the 561-alice-cannot-accept-or-decline branch from 36319fe to f674e92 Compare December 28, 2018 07:05
Copy link
Member

@bonomat bonomat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@luckysori luckysori force-pushed the 561-alice-cannot-accept-or-decline branch from f674e92 to 489b41a Compare December 29, 2018 07:00
@D4nte D4nte merged commit cd2a296 into master Jan 2, 2019
@ghost ghost removed the review label Jan 2, 2019
@D4nte D4nte deleted the 561-alice-cannot-accept-or-decline branch January 2, 2019 22:18
bors bot added a commit that referenced this pull request Dec 15, 2019
1768: Bump async-std from 1.2.0 to 1.3.0 r=mergify[bot] a=dependabot-preview[bot]

Bumps [async-std](https://github.com/async-rs/async-std) from 1.2.0 to 1.3.0.
<details>
<summary>Release notes</summary>

*Sourced from [async-std's releases](https://github.com/async-rs/async-std/releases).*

> ## v1.3.0
> 
> [API Documentation](https://docs.rs/async-std/1.3.0/async-std)
> 
> This patch introduces `Stream::delay`, more methods on `DoubleEndedStream`,
> and improves compile times. `Stream::delay` is a new API that's similar to
> [`task::sleep`](https://docs.rs/async-std/1.2.0/async_std/task/fn.sleep.html),
> but can be passed as part of as stream, rather than as a separate block. This is
> useful for examples, or when manually debugging race conditions.
> 
> ## Examples
> 
> ```rust
> let start = Instant::now();
> let mut s = stream::from_iter(vec![0u8, 1]).delay(Duration::from_millis(200));
> 
> // The first time will take more than 200ms due to delay.
> s.next().await;
> assert!(start.elapsed().as_millis() >= 200);
> 
> // There will be no delay after the first time.
> s.next().await;
> assert!(start.elapsed().as_millis() <= 210);
> ```
> 
> ## Added
> 
> - Added `Stream::delay` as "unstable" [([#309](https://github-redirect.dependabot.com/async-rs/async-std/issues/309))](https://github-redirect.dependabot.com/async-rs/async-std/pull/309)
> - Added `DoubleEndedStream::next_back` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::nth_back` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::rfind` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::rfold` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::try_rfold` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - `stream::Once` now implements `DoubleEndedStream` [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - `stream::FromIter` now implements `DoubleEndedStream` [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> 
> ## Changed
> 
> - Removed our dependency on `async-macros`, speeding up compilation [([#610](https://github-redirect.dependabot.com/async-rs/async-std/issues/610))](https://github-redirect.dependabot.com/async-rs/async-std/pull/610)
> 
> ## Fixes
> 
> - Fixed a link in the task docs [([#598](https://github-redirect.dependabot.com/async-rs/async-std/issues/598))](https://github-redirect.dependabot.com/async-rs/async-std/pull/598)
> - Fixed the `UdpSocket::recv` example [([#603](https://github-redirect.dependabot.com/async-rs/async-std/issues/603))](https://github-redirect.dependabot.com/async-rs/async-std/pull/603)
> - Fixed a link to `task::block_on` [([#608](https://github-redirect.dependabot.com/async-rs/async-std/issues/608))](https://github-redirect.dependabot.com/async-rs/async-std/pull/608)
> - Fixed an incorrect API mention in `task::Builder` [([#612](https://github-redirect.dependabot.com/async-rs/async-std/issues/612))](https://github-redirect.dependabot.com/async-rs/async-std/pull/612)
> - Fixed leftover mentions of `futures-preview` [([#595](https://github-redirect.dependabot.com/async-rs/async-std/issues/595))](https://github-redirect.dependabot.com/async-rs/async-std/pull/595)
> - Fixed a typo in the tutorial [([#614](https://github-redirect.dependabot.com/async-rs/async-std/issues/614))](https://github-redirect.dependabot.com/async-rs/async-std/pull/614)
> - `<TcpStream as Write>::poll_close` now closes the write half of the stream [([#618](https://github-redirect.dependabot.com/async-rs/async-std/issues/618))](https://github-redirect.dependabot.com/async-rs/async-std/pull/618)
> 
></tr></table> ... (truncated)
</details>
<details>
<summary>Changelog</summary>

*Sourced from [async-std's changelog](https://github.com/async-rs/async-std/blob/master/CHANGELOG.md).*

> # [1.3.0] - 2019-12-12
> 
> [API Documentation](https://docs.rs/async-std/1.3.0/async-std)
> 
> This patch introduces `Stream::delay`, more methods on `DoubleEndedStream`,
> and improves compile times. `Stream::delay` is a new API that's similar to
> [`task::sleep`](https://docs.rs/async-std/1.2.0/async_std/task/fn.sleep.html),
> but can be passed as part of as stream, rather than as a separate block. This is
> useful for examples, or when manually debugging race conditions.
> 
> ## Examples
> 
> ```rust
> let start = Instant::now();
> let mut s = stream::from_iter(vec![0u8, 1]).delay(Duration::from_millis(200));
> 
> // The first time will take more than 200ms due to delay.
> s.next().await;
> assert!(start.elapsed().as_millis() >= 200);
> 
> // There will be no delay after the first time.
> s.next().await;
> assert!(start.elapsed().as_millis() <= 210);
> ```
> 
> ## Added
> 
> - Added `Stream::delay` as "unstable" [([#309](https://github-redirect.dependabot.com/async-rs/async-std/issues/309))](https://github-redirect.dependabot.com/async-rs/async-std/pull/309)
> - Added `DoubleEndedStream::next_back` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::nth_back` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::rfind` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::rfold` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - Added `DoubleEndedStream::try_rfold` as "unstable" [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - `stream::Once` now implements `DoubleEndedStream` [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> - `stream::FromIter` now implements `DoubleEndedStream` [([#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562))](https://github-redirect.dependabot.com/async-rs/async-std/pull/562)
> 
> ## Changed
> 
> - Removed our dependency on `async-macros`, speeding up compilation [([#610](https://github-redirect.dependabot.com/async-rs/async-std/issues/610))](https://github-redirect.dependabot.com/async-rs/async-std/pull/610)
> 
> ## Fixes
> 
> - Fixed a link in the task docs [([#598](https://github-redirect.dependabot.com/async-rs/async-std/issues/598))](https://github-redirect.dependabot.com/async-rs/async-std/pull/598)
> - Fixed the `UdpSocket::recv` example [([#603](https://github-redirect.dependabot.com/async-rs/async-std/issues/603))](https://github-redirect.dependabot.com/async-rs/async-std/pull/603)
> - Fixed a link to `task::block_on` [([#608](https://github-redirect.dependabot.com/async-rs/async-std/issues/608))](https://github-redirect.dependabot.com/async-rs/async-std/pull/608)
> - Fixed an incorrect API mention in `task::Builder` [([#612](https://github-redirect.dependabot.com/async-rs/async-std/issues/612))](https://github-redirect.dependabot.com/async-rs/async-std/pull/612)
> - Fixed leftover mentions of `futures-preview` [([#595](https://github-redirect.dependabot.com/async-rs/async-std/issues/595))](https://github-redirect.dependabot.com/async-rs/async-std/pull/595)
> - Fixed a typo in the tutorial [([#614](https://github-redirect.dependabot.com/async-rs/async-std/issues/614))](https://github-redirect.dependabot.com/async-rs/async-std/pull/614)
> - `<TcpStream as Write>::poll_close` now closes the write half of the stream [([#618](https://github-redirect.dependabot.com/async-rs/async-std/issues/618))](https://github-redirect.dependabot.com/async-rs/async-std/pull/618)
</details>
<details>
<summary>Commits</summary>

- [`2f09077`](async-rs/async-std@2f09077) Merge pull request [#617](https://github-redirect.dependabot.com/async-rs/async-std/issues/617) from async-rs/1.3.0
- [`055c64e`](async-rs/async-std@055c64e) 1.3.0
- [`96d6fc4`](async-rs/async-std@96d6fc4) Merge pull request [#618](https://github-redirect.dependabot.com/async-rs/async-std/issues/618) from twittner/poll_close_shutdown
- [`3d3bf91`](async-rs/async-std@3d3bf91) Merge pull request [#562](https://github-redirect.dependabot.com/async-rs/async-std/issues/562) from felipesere/double_ended_ext
- [`182fe68`](async-rs/async-std@182fe68) No need for a custom impl for FromIter for DoubleEndedStream
- [`b0038e1`](async-rs/async-std@b0038e1) Only implement the DoubleEndedStream for once when the flag is on
- [`8e5dede`](async-rs/async-std@8e5dede) Restructure package. No longer use a extension trait to match std.
- [`41cf0f8`](async-rs/async-std@41cf0f8) Make Once a DoubleEndedStream
- [`f9a4c35`](async-rs/async-std@f9a4c35) Silence warning about missing docs for the double_ended module
- [`6e8236d`](async-rs/async-std@6e8236d) Document from_iter for DoubleEndedStream
- Additional commits viewable in [compare view](async-rs/async-std@v1.2.0...v1.3.0)
</details>
<br />

[![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=async-std&package-manager=cargo&previous-version=1.2.0&new-version=1.3.0)](https://dependabot.com/compatibility-score.html?dependency-name=async-std&package-manager=cargo&previous-version=1.2.0&new-version=1.3.0)

You can trigger a rebase of this PR 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 badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in the `.dependabot/config.yml` file in this repo:
- Update frequency
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)



</details>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants