sign method

Future<SignedBlock> sign(
  1. Signer signer
)

Implementation

Future<SignedBlock> sign(Signer signer) async {
  final proto = toProto();
  final typeUrl = 'dev.celest/${proto.info_.qualifiedMessageName}';
  await signer.sign(utf8.encode(typeUrl));
  final bytes = proto.writeToBuffer();
  final signature = await signer.sign(bytes);
  return SignedBlock(
    block: bytes,
    typeUrl: typeUrl,
    signature: signature,
  );
}