Voter.deserialize constructor
      
      Voter.deserialize(
    
    
- CborListValue<CborObject> cbor
Implementation
factory Voter.deserialize(CborListValue cbor) {
  final type = VoterType.deserialize(cbor.elementAt<CborIntValue>(0).value);
  return switch (type) {
    VoterType.constitutionalCommitteeHotKeyHash =>
      VoterConstitutionalCommitteeHotKeyHash.deserialize(cbor),
    VoterType.constitutionalCommitteeHotScriptHash =>
      VoterConstitutionalCommitteeHotScriptHash.deserialize(cbor),
    VoterType.drepKeyHash => VoterDRepKeyHash.deserialize(cbor),
    VoterType.drepScriptHash => VoterDRepScriptHash.deserialize(cbor),
    VoterType.stakingPoolKeyHash => VoterStakingPoolKeyHash.deserialize(cbor),
    _ => throw UnimplementedError("Invalid voter type.")
  };
}