Capitalisk / ldpos-commander

CLI client for LDPoS blockchains
MIT License
3 stars 2 forks source link

delegate list by-vote-weight should show non-forging delegates with 0 vote weight too #54

Closed jondubois closed 3 years ago

jondubois commented 3 years ago

Right now it only seems to show delegates who already have votes.

maarteNNNN commented 3 years ago

@jondubois Isn't this related to ldpos-client?

const listDelegatesByVoteWeight = async function (
  client,
  pageInfo = { offset: 0, limit: 1, pageNumber: 1, order: 'desc' }
) {
  let delegates = await client.getDelegatesByVoteWeight(
    pageInfo.offset,
    pageInfo.limit,
    pageInfo.order
  );

  delegates = delegates.map((delegate) => ({
    ...delegate,
    voteWeight: _integerToDecimal(delegate.voteWeight),
  }));

  await this.pagination(delegates, pageInfo, 1, listDelegatesByVoteWeight, [
    client,
    pageInfo,
  ]);
};