Merge pull request #1212 from cosmos/validatorDelegations-testing

Improve validatorDelegations testing
This commit is contained in:
Simon Warta 2022-07-07 10:25:15 +02:00 committed by GitHub
commit 372f942d7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -223,8 +223,17 @@ describe("StakingExtension", () => {
const [client, tmClient] = await makeClientWithStaking(simapp.tendermintUrl);
const response = await client.staking.validatorDelegations(validator.validatorAddress);
expect(response.delegationResponses).toBeDefined();
expect(response.delegationResponses).not.toBeNull();
expect(response.delegationResponses.length).toBeGreaterThanOrEqual(2);
// Find the self-delegation
expect(response.delegationResponses).toContain({
delegation: {
delegatorAddress: validator.delegatorAddress,
validatorAddress: validator.validatorAddress,
shares: "3000000000000000000000000",
},
balance: { denom: "ustake", amount: "3000000" },
});
expect(response.pagination?.total.toNumber()).toBeGreaterThanOrEqual(2);
tmClient.disconnect();
});