public int GetValidatorIndex(ECDSAPublicKey publicKey, long afterBlock) { return(GetValidatorsPublicKeys(afterBlock) .Select((key, index) => new { key, index }) .Where(arg => publicKey.Equals(arg.key)) .Select(arg => arg.index) .First()); }
public int GetValidatorIndex(ECDSAPublicKey publicKey) { return(EcdsaPublicKeySet .Select((key, index) => new { key, index }) .Where(arg => publicKey.Equals(arg.key)) .Select(arg => arg.index) .DefaultIfEmpty(-1) .First()); }