Skip to content

Commit

Permalink
replace validator addr query
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Dec 5, 2023
1 parent dc95596 commit 8824c5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
13 changes: 0 additions & 13 deletions packages/ui/src/graphql/general/validators_address_list.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,3 @@ query ValidatorsAddressList {
}
}

query ValidatorAddresses {
validator(where: {validator_info: {operator_address: {_is_null: false}, consensus_address: {_is_null: false}, self_delegate_address: {_is_null: false}}}) {
validatorInfo: validator_info {
operatorAddress: operator_address
selfDelegateAddress: self_delegate_address
consensusAddress: consensus_address
}
validatorDescriptions: validator_descriptions(limit: 1, order_by: {height: desc}) {
moniker
avatarUrl: avatar_url
}
}
}
4 changes: 2 additions & 2 deletions packages/ui/src/recoil/validators/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect } from 'react';
import { useRecoilCallback } from 'recoil';
import { AtomState as ValidatorAtomState } from 'ui/recoil/validators';
import { useValidatorAddressesQuery } from '@/graphql/types/general_types';
import { useValidatorsAddressListQuery } from '@/graphql/types/general_types';
import { atomFamilyState as profileAtomFamilyState } from '@/recoil/profiles/atom';
import type { AtomState as ProfileAtomState } from '@/recoil/profiles/types';
import { atomFamilyState as validatorAtomState } from '@/recoil/validators/atom';

export const useValidatorRecoil = () => {
const { loading: loadingValidator, data } = useValidatorAddressesQuery();
const { loading: loadingValidator, data } = useValidatorsAddressListQuery();
const setValidatorAtomState = useRecoilCallback(
({ set }) =>
(consensusAddress: string, newState: ValidatorAtomState) =>
Expand Down

0 comments on commit 8824c5f

Please sign in to comment.