@@ -46,6 +46,7 @@ const (
46
46
CertificateTypeRegistrationDrep = 16
47
47
CertificateTypeDeregistrationDrep = 17
48
48
CertificateTypeUpdateDrep = 18
49
+ CertificateTypeLeiosEb = 19
49
50
)
50
51
51
52
type CertificateWrapper struct {
@@ -99,6 +100,8 @@ func (c *CertificateWrapper) UnmarshalCBOR(data []byte) error {
99
100
tmpCert = & DeregistrationDrepCertificate {}
100
101
case CertificateTypeUpdateDrep :
101
102
tmpCert = & UpdateDrepCertificate {}
103
+ case CertificateTypeLeiosEb :
104
+ tmpCert = & LeiosEbCertificate {}
102
105
default :
103
106
return fmt .Errorf ("unknown certificate type: %d" , certType )
104
107
}
@@ -1361,3 +1364,62 @@ func (c *UpdateDrepCertificate) Utxorpc() (*utxorpc.Certificate, error) {
1361
1364
func (c * UpdateDrepCertificate ) Type () uint {
1362
1365
return c .CertType
1363
1366
}
1367
+
1368
+ // DRep implementation
1369
+ func (d * Drep ) Utxorpc () (* utxorpc.DRep , error ) {
1370
+ switch d .Type {
1371
+ case DrepTypeAddrKeyHash :
1372
+ return & utxorpc.DRep {
1373
+ Drep : & utxorpc.DRep_AddrKeyHash {AddrKeyHash : d .Credential },
1374
+ }, nil
1375
+ case DrepTypeScriptHash :
1376
+ return & utxorpc.DRep {
1377
+ Drep : & utxorpc.DRep_ScriptHash {ScriptHash : d .Credential },
1378
+ }, nil
1379
+ case DrepTypeAbstain :
1380
+ return & utxorpc.DRep {
1381
+ Drep : & utxorpc.DRep_Abstain {Abstain : true },
1382
+ }, nil
1383
+ case DrepTypeNoConfidence :
1384
+ return & utxorpc.DRep {
1385
+ Drep : & utxorpc.DRep_NoConfidence {NoConfidence : true },
1386
+ }, nil
1387
+ default :
1388
+ return nil , fmt .Errorf ("unknown DRep type: %d" , d .Type )
1389
+ }
1390
+ }
1391
+
1392
+ type LeiosEbCertificate struct {
1393
+ cbor.StructAsArray
1394
+ cbor.DecodeStoreCbor
1395
+ CertType uint
1396
+ ElectionId Blake2b256
1397
+ EndorserBlockHash Blake2b256
1398
+ PersistentVoters []any
1399
+ NonpersistentVoters map [Blake2b256 ]any
1400
+ AggregateEligSig * any
1401
+ AggregateVoteSig any
1402
+ }
1403
+
1404
+ func (c LeiosEbCertificate ) isCertificate () {}
1405
+
1406
+ func (c * LeiosEbCertificate ) UnmarshalCBOR (
1407
+ cborData []byte ,
1408
+ ) error {
1409
+ type tLeiosEbCertificate LeiosEbCertificate
1410
+ var tmp tLeiosEbCertificate
1411
+ if _ , err := cbor .Decode (cborData , & tmp ); err != nil {
1412
+ return err
1413
+ }
1414
+ * c = LeiosEbCertificate (tmp )
1415
+ c .SetCbor (cborData )
1416
+ return nil
1417
+ }
1418
+
1419
+ func (c * LeiosEbCertificate ) Utxorpc () (* utxorpc.Certificate , error ) {
1420
+ return & utxorpc.Certificate {}, nil
1421
+ }
1422
+
1423
+ func (c * LeiosEbCertificate ) Type () uint {
1424
+ return c .CertType
1425
+ }
0 commit comments