getLockByIndex method

  1. @override
Lock_Predicate? getLockByIndex(
  1. Indices indices
)

Get the lock predicate associated to the given indices

indices The indices to get the lock predicate for Returns the lock predicate for the given indices if possible. Else null

Implementation

@override
m.Lock_Predicate? getLockByIndex(m.Indices indices) {
  final result = cartesiansStore.findSync(_instance,
      finder: Finder(
          filter: Filter.and([
        Filter.equals("x", indices.x),
        Filter.equals("y", indices.y),
        Filter.equals("z", indices.z),
      ])));

  if (result.isEmpty) return null;
  return m.Lock_Predicate.fromBuffer(Encoding()
      .decodeFromBase58Check(result.first["lockPredicate"]! as String)
      .get());
}