FrostKeyWithDetails.fromReader constructor

FrostKeyWithDetails.fromReader(
  1. BytesReader reader
)

Implementation

factory FrostKeyWithDetails.fromReader(cl.BytesReader reader) {

  final keyInfo = ParticipantKeyInfo.fromReader(reader);

  return FrostKeyWithDetails(

    keyInfo: keyInfo,
    name: reader.readString(),
    description: reader.readString(),

    // Read ACKs, reusing the group key that was already read to keyInfo
    acks: Iterable.generate(
      reader.readUInt16(),
      (i) => SignedDkgAck(
        signer: reader.readIdentifier(),
        signed: Signed(
          obj: DkgAck(
            groupKey: keyInfo.groupKey,
            accepted: reader.readBool(),
          ),
          signature: reader.readSignature(),
        ),
      ),
    ).toSet(),

  );

}