Skip to content

Commit

Permalink
feat: pool id extraction functions (#621)
Browse files Browse the repository at this point in the history
Copy the get list of pool ID from (de)registration certificates functions
from https://github.com/cardano-foundation/cardano-ibc-incubator with minimal
modifications.

Signed-off-by: Chris Gianelloni <[email protected]>
  • Loading branch information
wolf31o2 authored May 14, 2024
1 parent 25008d4 commit d217dd2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ledger/verify_block_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,23 @@ type DeRegisCert struct {
DeRegisEpoch string
TxIndex int
}

func GetListRegisCertPoolId(regisCerts []RegisCert) []string {
poolId := make([]string, 0)
if len(regisCerts) > 0 {
for _, cert := range regisCerts {
poolId = append(poolId, cert.RegisPoolId)
}
}
return poolId
}

func GetListUnregisCertPoolId(deRegisCerts []DeRegisCert) []string {
poolId := make([]string, 0)
if len(deRegisCerts) > 0 {
for _, cert := range deRegisCerts {
poolId = append(poolId, cert.DeRegisPoolId)
}
}
return poolId
}

0 comments on commit d217dd2

Please sign in to comment.