cosmjs
cosmjs copied to clipboard
Add redelegateTokens to singingstargateclient.ts
Nice, thanks. Do you need this released as 0.26.x any time soon?
Not necessarily. While building my tool I just realized it was missing and added it :)
Could you add a test for that? I would not require it for merge because we don't have tests for the other staking methods as well and writing a new test is not easy if there is no framework/examples. But it would be great to increase coverage.
Sure thing! Just checked that other tests are missing too so I skipped that :D Gimme some time, gonna add that
For inspiration: the query tests for staking and distribution might help for checking if the operation was successful:
- https://github.com/cosmos/cosmjs/blob/main/packages/stargate/src/queries/staking.spec.ts
- https://github.com/cosmos/cosmjs/blob/main/packages/stargate/src/queries/distribution.spec.ts
@webmaster128 To write a test for redelegation, I need 2 validators to test. But in packages/stargate/src/testutils.spec.ts there's only one defined. Do you want me to extend that?
Oh, good point. The problem is the validator does not only need to be added in the test file. Instead it need to exists in the test network which is running as a backend for the tests. The validator is created here: https://github.com/cosmos/cosmjs/blob/v0.26.4/scripts/simapp42/template/.simapp/config/genesis.json#L533-L558.
We can probably not run the network with multiple validators without massive overhead in the docker setups. But maybe we can register a second inactive validator?
We give up the idea of those wrapper function in general. We can never keep up with all the possible messages this way.