Skip to content

Commit

Permalink
feat: ledger support for TX certificates (#620)
Browse files Browse the repository at this point in the history
This adds support for decoding the various certificate types available
in Shelley through Babbage for things like state pool registration and
delegation

Fixes #331
  • Loading branch information
agaffney authored May 14, 2024
1 parent d217dd2 commit cf212da
Show file tree
Hide file tree
Showing 11 changed files with 524 additions and 103 deletions.
4 changes: 4 additions & 0 deletions ledger/allegra.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func (t AllegraTransaction) CollateralReturn() TransactionOutput {
return t.Body.CollateralReturn()
}

func (t AllegraTransaction) Certificates() []Certificate {
return t.Body.Certificates()
}

func (t AllegraTransaction) Metadata() *cbor.Value {
return t.TxMetadata
}
Expand Down
4 changes: 4 additions & 0 deletions ledger/alonzo.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ func (t AlonzoTransaction) CollateralReturn() TransactionOutput {
return t.Body.CollateralReturn()
}

func (t AlonzoTransaction) Certificates() []Certificate {
return t.Body.Certificates()
}

func (t AlonzoTransaction) Metadata() *cbor.Value {
return t.TxMetadata
}
Expand Down
4 changes: 4 additions & 0 deletions ledger/babbage.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ func (t BabbageTransaction) CollateralReturn() TransactionOutput {
return t.Body.CollateralReturn()
}

func (t BabbageTransaction) Certificates() []Certificate {
return t.Body.Certificates()
}

func (t BabbageTransaction) Metadata() *cbor.Value {
return t.TxMetadata
}
Expand Down
5 changes: 5 additions & 0 deletions ledger/byron.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ func (t *ByronTransaction) CollateralReturn() TransactionOutput {
return nil
}

func (t *ByronTransaction) Certificates() []Certificate {
// No certificates in Byron
return nil
}

func (t *ByronTransaction) Metadata() *cbor.Value {
return t.Attributes
}
Expand Down
Loading

0 comments on commit cf212da

Please sign in to comment.