cli icon indicating copy to clipboard operation
cli copied to clipboard

chore: deprecate BroadcastModeBlock

Open tbruyelle opened this issue 3 years ago • 0 comments

Is your feature request related to a problem or issue you encountered? Please describe. BroadcastModeBlock is planned for deprecation in the SDK (see https://github.com/cosmos/cosmos-sdk/issues/12167)

Describe the solution you'd like This mode is currently used in :

  • cosmosclient
  • cosmoscmd
  • the template tests of map, single and list.

We should switch to BroadcastModeSync. This requires a little bit of work since with BroadcastModeSync you don't receive the result of the transaction, but only its hash. When you need to read the result of the transaction, you must wait for the next block until you can request it.

For cosmosclient, this can be done in 2 ways :

  • adapt existing BroadcastTx so it waits for the TX to be included in a block, and then returns the parsed response.
  • change the return of BroadcastTx so it returns only the tx hash, then the user can call WaitForNextBlock and then request the tx. Or we could also introduce a new method WaitForTx(hash), that calls WaitForNextBlock internally and requests the tx.

Describe alternatives you've considered We can delay that but it will add additional work when we'll upgrade to the version of the SDK where BroadcastModeBlock will be removed.

tbruyelle avatar Aug 09 '22 10:08 tbruyelle