Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/staking-v3/hooks/useVote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useDappStakingNavigation } from './useDappStakingNavigation';

export function useVote(dapps: Ref<DappVote[]>, dappToMoveTokensFromAddress?: string) {
const { currentAccount } = useAccount();
const { useableBalance, lockedInDemocracy } = useBalance(currentAccount);
const { useableBalance } = useBalance(currentAccount);
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment explaining why lockedInDemocracy was removed to prevent future confusion about the reasoning behind this change.

Copilot uses AI. Check for mistakes.
const {
ledger,
totalStake,
Expand All @@ -28,7 +28,7 @@ export function useVote(dapps: Ref<DappVote[]>, dappToMoveTokensFromAddress?: st
let remainingLockedTokensInitial = BigInt(0);

const lockedInDappStaking = computed<bigint>(() => ledger?.value?.locked ?? BigInt(0));
const locked = computed<bigint>(() => max(lockedInDappStaking.value, lockedInDemocracy.value));
const locked = computed<bigint>(() => lockedInDappStaking.value);

const totalStakeAmount = computed<bigint>(() =>
ethers.utils
Expand Down
8 changes: 6 additions & 2 deletions src/v2/repositories/implementations/IdentityRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ export class IdentityRepository implements IIdentityRepository {
if (!api.query.identity) {
return undefined;
}
const result = await api.query.identity.identityOf<Option<Tuple>>(address);
const result = await api.query.identity.identityOf<Option<PalletIdentityRegistration>>(address);

if (result.isNone) {
return undefined;
}

const unwrappedResult = result.unwrapOrDefault();
const identity = <PalletIdentityRegistration>unwrappedResult[0];
const identity = <PalletIdentityRegistration>unwrappedResult;
Comment on lines +38 to +45
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type change from Option to Option should be verified against the actual API response structure to ensure compatibility across different runtime versions.

Copilot uses AI. Check for mistakes.
if (!identity || !identity.info) {
return undefined;
}

const data = new IdentityData(u8aToString(identity.info.display.asRaw), []);
identity.info.additional.forEach((x) => {
// Seems dirty. The problem here is that some raw data is treated as ASCII and some as bytes
Expand Down
Loading