getIndicesBySignature method

  1. @override
Indices? getIndicesBySignature(
  1. Proposition_DigitalSignature signatureProposition
)

Get the indices associated to a signature proposition

signatureProposition The signature proposition to get the indices for Returns the indices associated to the signature proposition if it exists. Else null

Implementation

@override
Indices? getIndicesBySignature(
    Proposition_DigitalSignature signatureProposition) {
  final result = cartesiansStore.findSync(_instance,
      finder: Finder(
          filter: Filter.and([
        Filter.equals("routine", signatureProposition.routine),
        Filter.equals(
            "vk",
            Encoding().encodeToBase58Check(
                signatureProposition.verificationKey.writeToBuffer())),
      ])));

  if (result.isEmpty) return null;
  return Indices(
    x: result.first["xFellowship"] as int?,
    y: result.first["yContract"] as int?,
    z: result.first["zState"] as int?,
  );
}