63
}
64
65
>
func (u UpdateUtils) UpdateAcceptMessages(tv *testvars.TestVars, updRequestMsg *protocolpb.Message) []*protocolpb.Message {
update.go
66
>
if th, ok := u.t.(helper); ok {
67
>
th.Helper()
68
>
}
69
>
updRequest := protoutils.UnmarshalAny[*updatepb.Request](u.t, updRequestMsg.GetBody())
70
>
71
>
return []*protocolpb.Message{
72
>
{
73
>
Id: tv.MessageID() + "_update-accepted",
74
>
ProtocolInstanceId: updRequest.GetMeta().GetUpdateId(),
75
>
SequencingId: nil,
76
>
Body: protoutils.MarshalAny(u.t, &updatepb.Acceptance{
77
>
AcceptedRequestMessageId: updRequestMsg.GetId(),
78
>
AcceptedRequestSequencingEventId: updRequestMsg.GetEventId(),
79
>
AcceptedRequest: updRequest,
80
>
}),
81
>
},
82
>
}
83
}
84
85
>
func (u UpdateUtils) UpdateCompleteMessages(tv *testvars.TestVars, updRequestMsg *protocolpb.Message) []*protocolpb.Message {
update.go
86
>
if th, ok := u.t.(helper); ok {
87
>
th.Helper()
88
>
}
89
>
updRequest := protoutils.UnmarshalAny[*updatepb.Request](u.t, updRequestMsg.GetBody())
90
>
91
>
return []*protocolpb.Message{
92
>
{
93
>
Id: tv.MessageID() + "_update-completed",
94
>
ProtocolInstanceId: updRequest.GetMeta().GetUpdateId(),
95
>
SequencingId: nil,
96
>
Body: protoutils.MarshalAny(u.t, &updatepb.Response{
97
>
Meta: updRequest.GetMeta(),
98
>
Outcome: &updatepb.Outcome{
99
>
Value: &updatepb.Outcome_Success{
100
>
Success: payloads.EncodeString("success-result-of-" + updRequest.GetMeta().GetUpdateId()),
101
>
},
102
>
},
103
>
}),
104
>
},
105
>
}
106
}
107
108
>
func (u UpdateUtils) UpdateAcceptCompleteMessages(tv *testvars.TestVars, updRequestMsg *protocolpb.Message) []*protocolpb.Message {
update.go
109
>
if th, ok := u.t.(helper); ok {
110
>
th.Helper()
111
>
}
112
>
return append(
113
>
u.UpdateAcceptMessages(tv, updRequestMsg),
114
>
u.UpdateCompleteMessages(tv, updRequestMsg)...)
115
}
116