Skip to content

Commit d217dd2

Browse files
authored
feat: pool id extraction functions (#621)
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]>
1 parent 25008d4 commit d217dd2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ledger/verify_block_body.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,23 @@ type DeRegisCert struct {
304304
DeRegisEpoch string
305305
TxIndex int
306306
}
307+
308+
func GetListRegisCertPoolId(regisCerts []RegisCert) []string {
309+
poolId := make([]string, 0)
310+
if len(regisCerts) > 0 {
311+
for _, cert := range regisCerts {
312+
poolId = append(poolId, cert.RegisPoolId)
313+
}
314+
}
315+
return poolId
316+
}
317+
318+
func GetListUnregisCertPoolId(deRegisCerts []DeRegisCert) []string {
319+
poolId := make([]string, 0)
320+
if len(deRegisCerts) > 0 {
321+
for _, cert := range deRegisCerts {
322+
poolId = append(poolId, cert.DeRegisPoolId)
323+
}
324+
}
325+
return poolId
326+
}

0 commit comments

Comments
 (0)