getLock method
Using the template associated the given template, the verification keys associated to the fellowship and template pair, and the z state given by nextState, build a Lock
fellowship A String label of the fellowship to get the Lock verification keys for
template A String label of the template to get the verification keys and template for
nextState The z index state to build the lock for
Returns a built lock, if possible. Else null
Implementation
@override
m.Lock? getLock(String fellowship, String template, int nextState) {
final lockTemplate = getLockTemplate(template);
final entityVks = getEntityVks(fellowship, template);
if (lockTemplate == null || entityVks == null) return null;
final childVks = entityVks.map((vk) {
final fullKey = m.VerificationKey.fromBuffer(
Encoding().decodeFromBase58Check(vk).get());
return api.deriveChildVerificationKey(fullKey, nextState);
});
final res = lockTemplate.build(childVks.toList());
return res.isRight ? res.right! : null;
}