Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make all commands extend Has*ReplyToCommand #1543

Merged
merged 5 commits into from
Sep 30, 2020
Merged

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Sep 28, 2020

Commands have to be of type HasReplyToCommand or HasOptionalReplyToCommand. The latter is mostly for commands which don't need replies except in tests.

With this change, there is no more replying in Channel, and a lot of sender.send() have been removed from tests, in preparation to full akka typed.

Supersedes #1533.

@@ -68,7 +68,10 @@ class WaitForFundingCreatedInternalStateSpec extends TestKitBaseClass with Fixtu

test("recv CMD_CLOSE") { f =>
import f._
alice ! CMD_CLOSE(None)
val sender = TestProbe()
val c = CMD_CLOSE(sender.ref, None)
Copy link
Member

Choose a reason for hiding this comment

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

Should we have one of these tests test the fallback to sender when ActorRef.noSender is provided?

val sender = TestProbe()
val c = CMD_CLOSE(ActorRef.noSender, None)
sender.send(alice, c)
sender.expectMsg(RES_SUCCESS(c, ByteVector32.Zeroes))
awaitCond(alice.stateName == CLOSED)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done with 2bad181... and found a bug!

@pm47 pm47 requested a review from t-bast September 29, 2020 15:49
t-bast
t-bast previously approved these changes Sep 29, 2020
This way we can maintain replies in tests.
I'm not sure how we could prevent extending `Command` directly.
@pm47 pm47 force-pushed the channel-cmd-optional-replyto branch from 7f01183 to da98eff Compare September 29, 2020 18:20
@pm47 pm47 requested a review from t-bast September 29, 2020 18:20
@pm47 pm47 merged commit 1274168 into master Sep 30, 2020
@pm47 pm47 deleted the channel-cmd-optional-replyto branch September 30, 2020 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants