You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A common use case for Certificate data will be to only operate on specific certificate types. It would greatly simplify downstream if we had a way to access the type from the Certificate interface.
The text was updated successfully, but these errors were encountered:
The idea is to use Go's type switch/assertion for determining the cert type, since multiple types are returned using the ledger.Certificate interface. However, we have the information readily available to also return the integer value for the cert type, so adding a .Type() function wouldn't be difficult.
Type switch example:
switch v := myCert.(type) {
case ledger.StakeDelegationCertificate:
// you can access v.StakeCredential and v.PoolKeyHash directly here
case ledger.PoolRegistrationCertificate:
// you can access v.Operator, v.Pledge, v.Margin, etc. directly here
}
A common use case for Certificate data will be to only operate on specific certificate types. It would greatly simplify downstream if we had a way to access the type from the Certificate interface.
The text was updated successfully, but these errors were encountered: