fromJson method

  1. @override
ValidatorWeight fromJson(
  1. Map<String, dynamic> json
)

Implementation

@override
ValidatorWeight fromJson(Map<String, dynamic> json) {
  late ClPublicKey publicKey;
  if (json.containsKey("validator")) {
    publicKey = ClPublicKeyJsonConverter().fromJson(json["validator"]);
  } else if (json.containsKey("public_key")) {
    publicKey = ClPublicKeyJsonConverter().fromJson(json["public_key"]);
  }
  return ValidatorWeight(
    publicKey,
    json['weight'] == null ? null : BigInt.parse(json['weight']),
  );
}