fromBytes static method

Future<LegacyKeyshare> fromBytes(
  1. Uint8List bytes
)

Implementation

static Future<LegacyKeyshare> fromBytes(Uint8List bytes) async {
  await silentShardMigrationInit();
  final rustLegacyKeyshare = await rust_legacy_keyshare
      .legacyKeyshareFromBytes(bytes: bytes);
  if (rustLegacyKeyshare == null) {
    throw Exception('Failed to parse legacy keyshare');
  }

  final legacyKeyshare = LegacyKeyshare._fromRustLegacyKeyshare(
    rustLegacyKeyshare,
  );

  return legacyKeyshare;
}