@polkadot/types/interfaces#RegistrationJudgement TypeScript Examples

The following examples show how to use @polkadot/types/interfaces#RegistrationJudgement. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: utils.ts    From polkadot-registrar-watcher with Apache License 2.0 7 votes vote down vote up
isClaimChallengeCompliant = (judgements: Vec<RegistrationJudgement>, registrarIndex: number, info: IdentityInfo): boolean =>{
  let isCompliant = false
  for (const judgement of judgements) {
    if(_isOurRegistrarTargetted(judgement,registrarIndex) && !_isAlreadyJudged(judgement)) isCompliant = true
  }
  if(!_isInfoChallengeCompliant(info)) {
    // isCompliant = false // DISABLED Filtering, now it is a challenger task
  }
  
  return isCompliant
}
Example #2
Source File: utils.ts    From polkadot-registrar-watcher with Apache License 2.0 7 votes vote down vote up
extractRegistrationEntry = (key: StorageKey, exposure: Option<Registration>): {accountId: string; judgements: Vec<RegistrationJudgement>; info: IdentityInfo} => {
  const registration = exposure as Option<Registration>
  const accountId = key.args.map((k) => k.toHuman()).toString()
  const judgements = registration.unwrap().judgements
  const info = registration.unwrap().info 
  
  return {
    accountId: accountId,
    judgements: judgements,
    info: info
  }
}
Example #3
Source File: utils.ts    From polkadot-registrar-watcher with Apache License 2.0 6 votes vote down vote up
_isErroneousJudgement = (judgement: RegistrationJudgement): boolean => {
  if(!judgement[1]) return false
  return judgement[1].isErroneous
}
Example #4
Source File: utils.ts    From polkadot-registrar-watcher with Apache License 2.0 6 votes vote down vote up
_isAlreadyJudged = (judgement: RegistrationJudgement): boolean => {
  if(!judgement[1]) return false
  return judgement[1].isErroneous || judgement[1].isReasonable || judgement[1].isKnownGood || judgement[1].isLowQuality || judgement[1].isOutOfDate
}
Example #5
Source File: utils.ts    From polkadot-registrar-watcher with Apache License 2.0 6 votes vote down vote up
isJudgementsFieldDisplayNamesCompliant = (judgements: Vec<RegistrationJudgement>): boolean =>{
  let isCompliant = false
  for (const judgement of judgements) {
    if(_isAlreadyJudged(judgement) && !_isErroneousJudgement(judgement)) isCompliant = true 
  }
  return isCompliant
}
Example #6
Source File: utils.ts    From polkadot-registrar-watcher with Apache License 2.0 6 votes vote down vote up
_isOurRegistrarTargetted = (judgement: RegistrationJudgement, registrarIndex: number): boolean => {
  if(!judgement[0]) return false
  return judgement[0].toNumber() == registrarIndex
}
Example #7
Source File: identity.ts    From commonwealth with GNU General Public License v3.0 5 votes vote down vote up
private _judgements: RegistrationJudgement[];