Skip to content

Commit

Permalink
docs: adding notes to queryCalculateStakeFrom (i think it's wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
steinerkelvin committed Oct 12, 2024
1 parent 75f3411 commit c345638
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/subspace/queries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ export async function queryStakeFrom(
return stakeOutData;
}

/**
* NOTE: This function might be wrong.
*/
export async function queryCalculateStakeFrom(api: Api) {
// Stake From is the list of keys that the key has staked to.

Expand All @@ -390,7 +393,7 @@ export async function queryCalculateStakeFrom(api: Api) {
const perAddr = new Map<string, bigint>();

for (const [storageKey, value] of stakeFromQuery) {
const addr = storageKey.toString();
const addr = storageKey.toString(); // NOTE: this key should have two values like in `queryCalculateStakeOut`

const staked = BigInt(value.toString());

Expand Down

0 comments on commit c345638

Please sign in to comment.