public static bool TryParse(string fullName, out EventFullName?evt) { if (fullName == null) { throw new ArgumentNullException(nameof(fullName)); } fullName = fullName.Trim(); evt = null; var i = fullName.IndexOf('/'); if (i == -1) { return(false); } evt = new EventFullName(fullName.Substring(0, i), fullName.Substring(i + 1)); return(true); }
public async Task <OracleInfo?> GetEventId(EventFullName eventFullName) { var oracleId = await NameRepository.AsOracleNameRepository().GetId(eventFullName.OracleName); if (oracleId is null) { return(null); } var id = await NameRepository.GetId(Scopes.Events, GetEventFullName(oracleId, eventFullName.Name)); if (id is null) { return(null); } if (!SchnorrNonce.TryParse(id, out var nonce)) { return(null); } return(new OracleInfo(oracleId.PubKey, nonce)); }