Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
8967d2e8
Commit
8967d2e8
authored
2 years ago
by
Jake Taylor
Browse files
Options
Downloads
Patches
Plain Diff
fix eventModel interface
parent
d2cb1308
No related branches found
No related tags found
4 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!369
Full round obj
,
!340
Project/channels
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
channels/eventModel.go
+4
-3
4 additions, 3 deletions
channels/eventModel.go
channels/eventModel_test.go
+26
-0
26 additions, 0 deletions
channels/eventModel_test.go
channels/joinedChannel_test.go
+26
-0
26 additions, 0 deletions
channels/joinedChannel_test.go
with
56 additions
and
3 deletions
channels/eventModel.go
+
4
−
3
View file @
8967d2e8
...
@@ -54,9 +54,10 @@ type EventModel interface {
...
@@ -54,9 +54,10 @@ type EventModel interface {
// it is incumbent on the user of the API to filter such called by message ID
// it is incumbent on the user of the API to filter such called by message ID
// Messages may arrive our of order, so a reply in theory can arrive before
// Messages may arrive our of order, so a reply in theory can arrive before
// the initial message, as a result it may be important to buffer replies.
// the initial message, as a result it may be important to buffer replies.
ReceiveReply
(
ChannelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
ReceiveReply
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
SenderUsername
string
,
text
string
,
timestamp
time
.
Time
,
reactionTo
cryptoChannel
.
MessageID
,
senderUsername
string
,
lease
time
.
Duration
,
round
rounds
.
Round
)
text
string
,
timestamp
time
.
Time
,
lease
time
.
Duration
,
round
rounds
.
Round
)
// ReceiveReaction is called whenever a reaction to a message is received
// ReceiveReaction is called whenever a reaction to a message is received
// on a given channel. It may be called multiple times on the same reaction,
// on a given channel. It may be called multiple times on the same reaction,
...
...
This diff is collapsed.
Click to expand it.
channels/eventModel_test.go
+
26
−
0
View file @
8967d2e8
...
@@ -37,6 +37,32 @@ type MockEvent struct {
...
@@ -37,6 +37,32 @@ type MockEvent struct {
eventReceive
eventReceive
}
}
func
(
m
*
MockEvent
)
MessageSent
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
myUsername
string
,
text
string
,
timestamp
time
.
Time
,
lease
time
.
Duration
,
round
rounds
.
Round
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
m
*
MockEvent
)
ReplySent
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
replyTo
cryptoChannel
.
MessageID
,
myUsername
string
,
text
string
,
timestamp
time
.
Time
,
lease
time
.
Duration
,
round
rounds
.
Round
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
m
*
MockEvent
)
ReactionSent
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
reactionTo
cryptoChannel
.
MessageID
,
senderUsername
string
,
reaction
string
,
timestamp
time
.
Time
,
lease
time
.
Duration
,
round
rounds
.
Round
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
m
*
MockEvent
)
UpdateSentStatus
(
messageID
cryptoChannel
.
MessageID
,
status
SentStatus
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
*
MockEvent
)
JoinChannel
(
channel
*
cryptoBroadcast
.
Channel
)
{}
func
(
*
MockEvent
)
JoinChannel
(
channel
*
cryptoBroadcast
.
Channel
)
{}
func
(
*
MockEvent
)
LeaveChannel
(
channelID
*
id
.
ID
)
{}
func
(
*
MockEvent
)
LeaveChannel
(
channelID
*
id
.
ID
)
{}
func
(
m
*
MockEvent
)
ReceiveMessage
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
func
(
m
*
MockEvent
)
ReceiveMessage
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
...
...
This diff is collapsed.
Click to expand it.
channels/joinedChannel_test.go
+
26
−
0
View file @
8967d2e8
...
@@ -500,6 +500,32 @@ type mockEventModel struct {
...
@@ -500,6 +500,32 @@ type mockEventModel struct {
leftCh
*
id
.
ID
leftCh
*
id
.
ID
}
}
func
(
m
*
mockEventModel
)
MessageSent
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
myUsername
string
,
text
string
,
timestamp
time
.
Time
,
lease
time
.
Duration
,
round
rounds
.
Round
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
m
*
mockEventModel
)
ReplySent
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
replyTo
cryptoChannel
.
MessageID
,
myUsername
string
,
text
string
,
timestamp
time
.
Time
,
lease
time
.
Duration
,
round
rounds
.
Round
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
m
*
mockEventModel
)
ReactionSent
(
channelID
*
id
.
ID
,
messageID
cryptoChannel
.
MessageID
,
reactionTo
cryptoChannel
.
MessageID
,
senderUsername
string
,
reaction
string
,
timestamp
time
.
Time
,
lease
time
.
Duration
,
round
rounds
.
Round
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
m
*
mockEventModel
)
UpdateSentStatus
(
messageID
cryptoChannel
.
MessageID
,
status
SentStatus
)
{
//TODO implement me
panic
(
"implement me"
)
}
func
(
m
*
mockEventModel
)
JoinChannel
(
c
*
cryptoBroadcast
.
Channel
)
{
func
(
m
*
mockEventModel
)
JoinChannel
(
c
*
cryptoBroadcast
.
Channel
)
{
m
.
joinedCh
=
c
m
.
joinedCh
=
c
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment