@@ -211,7 +211,7 @@ pub fn mk2pc(
211211
212212 pub const info = two_pc (coordinator , &.{ alice , bob });
213213
214- pub fn process (ctx : * info .RoleCtx (coordinator )) ! @This () {
214+ pub fn process (ctx : * info .Ctx (coordinator )) ! @This () {
215215 ctx .counter = 0 ;
216216 return .{ .begin = .{ .data = {} } };
217217 }
@@ -222,13 +222,13 @@ pub fn mk2pc(
222222
223223 pub const info = two_pc (alice , &.{coordinator });
224224
225- pub fn process (ctx : * info .RoleCtx (alice )) ! @This () {
225+ pub fn process (ctx : * info .Ctx (alice )) ! @This () {
226226 const random : std.Random = ctx .xoshiro256 .random ();
227227 const res : bool = random .intRangeAtMost (u32 , 0 , 100 ) < 80 ;
228228 return .{ .resp = .{ .data = res } };
229229 }
230230
231- pub fn preprocess_0 (ctx : * info .RoleCtx (coordinator ), msg : @This ()) ! void {
231+ pub fn preprocess_0 (ctx : * info .Ctx (coordinator ), msg : @This ()) ! void {
232232 switch (msg ) {
233233 .resp = > | val | {
234234 if (val .data ) ctx .counter += 1 ;
@@ -243,13 +243,13 @@ pub fn mk2pc(
243243
244244 pub const info = two_pc (bob , &.{coordinator });
245245
246- pub fn process (ctx : * info .RoleCtx (bob )) ! @This () {
246+ pub fn process (ctx : * info .Ctx (bob )) ! @This () {
247247 const random : std.Random = ctx .xoshiro256 .random ();
248248 const res : bool = random .intRangeAtMost (u32 , 0 , 100 ) < 80 ;
249249 return .{ .resp = .{ .data = res } };
250250 }
251251
252- pub fn preprocess_0 (ctx : * info .RoleCtx (coordinator ), msg : @This ()) ! void {
252+ pub fn preprocess_0 (ctx : * info .Ctx (coordinator ), msg : @This ()) ! void {
253253 switch (msg ) {
254254 .resp = > | val | {
255255 if (val .data ) ctx .counter += 1 ;
@@ -265,7 +265,7 @@ pub fn mk2pc(
265265
266266 pub const info = two_pc (coordinator , &.{ alice , bob });
267267
268- pub fn process (ctx : * info .RoleCtx (coordinator )) ! @This () {
268+ pub fn process (ctx : * info .Ctx (coordinator )) ! @This () {
269269 if (ctx .counter == 2 ) {
270270 ctx .retry_times = 0 ;
271271 return .{ .succcessed = .{ .data = {} } };
0 commit comments