getEntityVks method

  1. @override
List<String>? getEntityVks(
  1. String fellowship,
  2. String contract
)

Get the list of verification keys associated to the given pair of fellowship and contract

fellowship A String label of the fellowship to get the verification keys for contract A String label of the contract to get the verification keys for Returns the list of verification keys in base58 format associated to the given fellowship and contract if possible. Else null. It is possible that the list of entities is empty.

Implementation

@override
List<String>? getEntityVks(String fellowship, String contract) {
  final fellowshipResult = fellowshipsStore.findFirstSync(_instance,
      finder: Finder(filter: Filter.equals("name", fellowship)));

  final contractResult = contractsStore.findFirstSync(_instance,
      finder: Finder(filter: Filter.equals("contract", contract)));

  if (fellowshipResult != null && contractResult != null) {
    final verificationKeyResult =
        verificationKeysStore.findFirstSync(_instance,
            finder: Finder(
              filter: Filter.and([
                Filter.equals("xFellowship", fellowshipResult["xFellowship"]),
                Filter.equals("yContract", contractResult.key),
              ]),
            ));

    if (verificationKeyResult != null) {
      return (verificationKeyResult["vks"]! as List).cast<String>();
    }
  }

  return null;
}