@@ -250,32 +250,141 @@ func TestCertificateTypeMethods(t *testing.T) {
250
250
cert Certificate
251
251
expected uint
252
252
}{
253
- {"StakeRegistration" , & StakeRegistrationCertificate {CertType : CertificateTypeStakeRegistration }, CertificateTypeStakeRegistration },
254
- {"StakeDeregistration" , & StakeDeregistrationCertificate {CertType : CertificateTypeStakeDeregistration }, CertificateTypeStakeDeregistration },
255
- {"StakeDelegation" , & StakeDelegationCertificate {CertType : CertificateTypeStakeDelegation }, CertificateTypeStakeDelegation },
256
- {"PoolRegistration" , & PoolRegistrationCertificate {CertType : CertificateTypePoolRegistration }, CertificateTypePoolRegistration },
257
- {"PoolRetirement" , & PoolRetirementCertificate {CertType : CertificateTypePoolRetirement }, CertificateTypePoolRetirement },
258
- {"GenesisKeyDelegation" , & GenesisKeyDelegationCertificate {CertType : CertificateTypeGenesisKeyDelegation }, CertificateTypeGenesisKeyDelegation },
259
- {"MoveInstantaneousRewards" , & MoveInstantaneousRewardsCertificate {CertType : CertificateTypeMoveInstantaneousRewards }, CertificateTypeMoveInstantaneousRewards },
260
- {"Registration" , & RegistrationCertificate {CertType : CertificateTypeRegistration }, CertificateTypeRegistration },
261
- {"Deregistration" , & DeregistrationCertificate {CertType : CertificateTypeDeregistration }, CertificateTypeDeregistration },
262
- {"VoteDelegation" , & VoteDelegationCertificate {CertType : CertificateTypeVoteDelegation }, CertificateTypeVoteDelegation },
263
- {"StakeVoteDelegation" , & StakeVoteDelegationCertificate {CertType : CertificateTypeStakeVoteDelegation }, CertificateTypeStakeVoteDelegation },
264
- {"StakeRegistrationDelegation" , & StakeRegistrationDelegationCertificate {CertType : CertificateTypeStakeRegistrationDelegation }, CertificateTypeStakeRegistrationDelegation },
265
- {"VoteRegistrationDelegation" , & VoteRegistrationDelegationCertificate {CertType : CertificateTypeVoteRegistrationDelegation }, CertificateTypeVoteRegistrationDelegation },
266
- {"StakeVoteRegistrationDelegation" , & StakeVoteRegistrationDelegationCertificate {CertType : CertificateTypeStakeVoteRegistrationDelegation }, CertificateTypeStakeVoteRegistrationDelegation },
267
- {"AuthCommitteeHot" , & AuthCommitteeHotCertificate {CertType : CertificateTypeAuthCommitteeHot }, CertificateTypeAuthCommitteeHot },
268
- {"ResignCommitteeCold" , & ResignCommitteeColdCertificate {CertType : CertificateTypeResignCommitteeCold }, CertificateTypeResignCommitteeCold },
269
- {"RegistrationDrep" , & RegistrationDrepCertificate {CertType : CertificateTypeRegistrationDrep }, CertificateTypeRegistrationDrep },
270
- {"DeregistrationDrep" , & DeregistrationDrepCertificate {CertType : CertificateTypeDeregistrationDrep }, CertificateTypeDeregistrationDrep },
271
- {"UpdateDrep" , & UpdateDrepCertificate {CertType : CertificateTypeUpdateDrep }, CertificateTypeUpdateDrep },
253
+ {
254
+ "StakeRegistration" ,
255
+ & StakeRegistrationCertificate {
256
+ CertType : CertificateTypeStakeRegistration ,
257
+ },
258
+ CertificateTypeStakeRegistration ,
259
+ },
260
+ {
261
+ "StakeDeregistration" ,
262
+ & StakeDeregistrationCertificate {
263
+ CertType : CertificateTypeStakeDeregistration ,
264
+ },
265
+ CertificateTypeStakeDeregistration ,
266
+ },
267
+ {
268
+ "StakeDelegation" ,
269
+ & StakeDelegationCertificate {
270
+ CertType : CertificateTypeStakeDelegation ,
271
+ },
272
+ CertificateTypeStakeDelegation ,
273
+ },
274
+ {
275
+ "PoolRegistration" ,
276
+ & PoolRegistrationCertificate {
277
+ CertType : CertificateTypePoolRegistration ,
278
+ },
279
+ CertificateTypePoolRegistration ,
280
+ },
281
+ {
282
+ "PoolRetirement" ,
283
+ & PoolRetirementCertificate {CertType : CertificateTypePoolRetirement },
284
+ CertificateTypePoolRetirement ,
285
+ },
286
+ {
287
+ "GenesisKeyDelegation" ,
288
+ & GenesisKeyDelegationCertificate {
289
+ CertType : CertificateTypeGenesisKeyDelegation ,
290
+ },
291
+ CertificateTypeGenesisKeyDelegation ,
292
+ },
293
+ {
294
+ "MoveInstantaneousRewards" ,
295
+ & MoveInstantaneousRewardsCertificate {
296
+ CertType : CertificateTypeMoveInstantaneousRewards ,
297
+ },
298
+ CertificateTypeMoveInstantaneousRewards ,
299
+ },
300
+ {
301
+ "Registration" ,
302
+ & RegistrationCertificate {CertType : CertificateTypeRegistration },
303
+ CertificateTypeRegistration ,
304
+ },
305
+ {
306
+ "Deregistration" ,
307
+ & DeregistrationCertificate {CertType : CertificateTypeDeregistration },
308
+ CertificateTypeDeregistration ,
309
+ },
310
+ {
311
+ "VoteDelegation" ,
312
+ & VoteDelegationCertificate {CertType : CertificateTypeVoteDelegation },
313
+ CertificateTypeVoteDelegation ,
314
+ },
315
+ {
316
+ "StakeVoteDelegation" ,
317
+ & StakeVoteDelegationCertificate {
318
+ CertType : CertificateTypeStakeVoteDelegation ,
319
+ },
320
+ CertificateTypeStakeVoteDelegation ,
321
+ },
322
+ {
323
+ "StakeRegistrationDelegation" ,
324
+ & StakeRegistrationDelegationCertificate {
325
+ CertType : CertificateTypeStakeRegistrationDelegation ,
326
+ },
327
+ CertificateTypeStakeRegistrationDelegation ,
328
+ },
329
+ {
330
+ "VoteRegistrationDelegation" ,
331
+ & VoteRegistrationDelegationCertificate {
332
+ CertType : CertificateTypeVoteRegistrationDelegation ,
333
+ },
334
+ CertificateTypeVoteRegistrationDelegation ,
335
+ },
336
+ {
337
+ "StakeVoteRegistrationDelegation" ,
338
+ & StakeVoteRegistrationDelegationCertificate {
339
+ CertType : CertificateTypeStakeVoteRegistrationDelegation ,
340
+ },
341
+ CertificateTypeStakeVoteRegistrationDelegation ,
342
+ },
343
+ {
344
+ "AuthCommitteeHot" ,
345
+ & AuthCommitteeHotCertificate {
346
+ CertType : CertificateTypeAuthCommitteeHot ,
347
+ },
348
+ CertificateTypeAuthCommitteeHot ,
349
+ },
350
+ {
351
+ "ResignCommitteeCold" ,
352
+ & ResignCommitteeColdCertificate {
353
+ CertType : CertificateTypeResignCommitteeCold ,
354
+ },
355
+ CertificateTypeResignCommitteeCold ,
356
+ },
357
+ {
358
+ "RegistrationDrep" ,
359
+ & RegistrationDrepCertificate {
360
+ CertType : CertificateTypeRegistrationDrep ,
361
+ },
362
+ CertificateTypeRegistrationDrep ,
363
+ },
364
+ {
365
+ "DeregistrationDrep" ,
366
+ & DeregistrationDrepCertificate {
367
+ CertType : CertificateTypeDeregistrationDrep ,
368
+ },
369
+ CertificateTypeDeregistrationDrep ,
370
+ },
371
+ {
372
+ "UpdateDrep" ,
373
+ & UpdateDrepCertificate {CertType : CertificateTypeUpdateDrep },
374
+ CertificateTypeUpdateDrep ,
375
+ },
272
376
}
273
377
274
378
for _ , tt := range tests {
275
379
t .Run (tt .name , func (t * testing.T ) {
276
380
got := tt .cert .Type ()
277
381
if got != tt .expected {
278
- t .Errorf ("FAIL: %s -> Type() = %d, expected = %d" , tt .name , got , tt .expected )
382
+ t .Errorf (
383
+ "FAIL: %s -> Type() = %d, expected = %d" ,
384
+ tt .name ,
385
+ got ,
386
+ tt .expected ,
387
+ )
279
388
} else {
280
389
t .Logf ("PASS: %s -> Type() = %d, expected = %d \n " , tt .name , got , tt .expected )
281
390
}
0 commit comments