Skip to content

Commit cf212da

Browse files
authored
feat: ledger support for TX certificates (#620)
This adds support for decoding the various certificate types available in Shelley through Babbage for things like state pool registration and delegation Fixes #331
1 parent d217dd2 commit cf212da

File tree

11 files changed

+524
-103
lines changed

11 files changed

+524
-103
lines changed

ledger/allegra.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ func (t AllegraTransaction) CollateralReturn() TransactionOutput {
166166
return t.Body.CollateralReturn()
167167
}
168168

169+
func (t AllegraTransaction) Certificates() []Certificate {
170+
return t.Body.Certificates()
171+
}
172+
169173
func (t AllegraTransaction) Metadata() *cbor.Value {
170174
return t.TxMetadata
171175
}

ledger/alonzo.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ func (t AlonzoTransaction) CollateralReturn() TransactionOutput {
276276
return t.Body.CollateralReturn()
277277
}
278278

279+
func (t AlonzoTransaction) Certificates() []Certificate {
280+
return t.Body.Certificates()
281+
}
282+
279283
func (t AlonzoTransaction) Metadata() *cbor.Value {
280284
return t.TxMetadata
281285
}

ledger/babbage.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ func (t BabbageTransaction) CollateralReturn() TransactionOutput {
448448
return t.Body.CollateralReturn()
449449
}
450450

451+
func (t BabbageTransaction) Certificates() []Certificate {
452+
return t.Body.Certificates()
453+
}
454+
451455
func (t BabbageTransaction) Metadata() *cbor.Value {
452456
return t.TxMetadata
453457
}

ledger/byron.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ func (t *ByronTransaction) CollateralReturn() TransactionOutput {
185185
return nil
186186
}
187187

188+
func (t *ByronTransaction) Certificates() []Certificate {
189+
// No certificates in Byron
190+
return nil
191+
}
192+
188193
func (t *ByronTransaction) Metadata() *cbor.Value {
189194
return t.Attributes
190195
}

0 commit comments

Comments
 (0)