Skip to content

Commit c70c116

Browse files
tbruyelleAlex Johnson
andauthored
chore(cosmosclient): switch to BroadcastModeSync (ignite#2850)
* wip: switch to broadcastMode sync TODO: update BroadcastTx calls so they can actually get the response of the transaction. * refac(cosmosclient): remove timeout param from Wait* funcs Consumer can pass a ctx with a timeout to get the exact same behavior with a better level of customization. * feat: cosmosclient.WaitForTx func This func will be handy once we'll switch to BroadcastMode Sync. * test: add integration test for network publish The test works in BroadcastModeBlock, but not any more in BroadcastTxSync, it will serve as a proof that the transition is OK. * chore: make BroadcastTx works with BroadcastTxSync * test: clean go/bin/appBinary after serve * fix test and remove --broadcastmode flag * when you realize you were requesting the wrong chain... * refac: stop calling faucet on BroadcastTx This is already done in `CreateTx` so if it's no longer done in BroadcastTx, this should have very limited impacts. The good part is that removes complexity. * add CL * test: try with http url * revert changing broadcast mode in chain test * test: ensure the correct spn version is used * test: use env.Ctx() in waitForNextBlock * fix CL * Update changelog.md Co-authored-by: Alex Johnson <alex@shmeeload.xyz> Co-authored-by: Alex Johnson <alex@shmeeload.xyz>
1 parent 147af29 commit c70c116

38 files changed

+545
-273
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Changes
66

7+
- Switch to broadcast mode sync in `cosmosclient`
78
- Updated `nodetime`: `ts-proto` to `v1.123.0`, `protobufjs` to `v7.1.1`, `swagger-typescript-api` to `v9.2.0`
89
- Switched codegen client to use `axios` instead of `fetch`
910
- nodetime built with `vercel/pkg@5.6.0`

go.mod

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/emicklei/proto v1.9.0
2020
github.com/fatih/color v1.13.0
2121
github.com/ghodss/yaml v1.0.0
22-
github.com/go-git/go-git/v5 v5.1.0
22+
github.com/go-git/go-git/v5 v5.4.2
2323
github.com/gobuffalo/genny v0.6.0
2424
github.com/gobuffalo/logger v1.0.6
2525
github.com/gobuffalo/packd v1.0.1
@@ -79,10 +79,12 @@ require (
7979
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect
8080
github.com/GaijinEntertainment/go-exhaustruct/v2 v2.3.0 // indirect
8181
github.com/Masterminds/semver v1.5.0 // indirect
82-
github.com/Microsoft/go-winio v0.5.2 // indirect
82+
github.com/Microsoft/go-winio v0.6.0 // indirect
8383
github.com/Microsoft/hcsshim v0.9.3 // indirect
8484
github.com/OpenPeeDeeP/depguard v1.1.0 // indirect
85+
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
8586
github.com/Workiva/go-datastructures v1.0.53 // indirect
87+
github.com/acomagu/bufpipe v1.0.3 // indirect
8688
github.com/alecthomas/chroma v0.8.2 // indirect
8789
github.com/alexkohler/prealloc v1.0.0 // indirect
8890
github.com/alingse/asasalint v0.0.11 // indirect
@@ -141,7 +143,7 @@ require (
141143
github.com/docker/go-units v0.4.0 // indirect
142144
github.com/dustin/go-humanize v1.0.1-0.20200219035652-afde56e7acac // indirect
143145
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
144-
github.com/emirpasic/gods v1.12.0 // indirect
146+
github.com/emirpasic/gods v1.18.1 // indirect
145147
github.com/esimonov/ifshort v1.0.4 // indirect
146148
github.com/ettle/strcase v0.1.1 // indirect
147149
github.com/fatih/structs v1.1.0 // indirect
@@ -152,7 +154,7 @@ require (
152154
github.com/fzipp/gocyclo v0.6.0 // indirect
153155
github.com/go-critic/go-critic v0.6.4 // indirect
154156
github.com/go-git/gcfg v1.5.0 // indirect
155-
github.com/go-git/go-billy/v5 v5.0.0 // indirect
157+
github.com/go-git/go-billy/v5 v5.3.1 // indirect
156158
github.com/go-kit/kit v0.12.0 // indirect
157159
github.com/go-kit/log v0.2.1 // indirect
158160
github.com/go-logfmt/logfmt v0.5.1 // indirect
@@ -228,7 +230,7 @@ require (
228230
github.com/jpillora/sizestr v1.0.0 // indirect
229231
github.com/julz/importas v0.1.0 // indirect
230232
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
231-
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
233+
github.com/kevinburke/ssh_config v1.2.0 // indirect
232234
github.com/kisielk/errcheck v1.6.2 // indirect
233235
github.com/kisielk/gotool v1.0.0 // indirect
234236
github.com/klauspost/compress v1.15.9 // indirect
@@ -338,7 +340,7 @@ require (
338340
github.com/ultraware/funlen v0.0.3 // indirect
339341
github.com/ultraware/whitespace v0.0.5 // indirect
340342
github.com/uudashr/gocognit v1.0.6 // indirect
341-
github.com/xanzy/ssh-agent v0.2.1 // indirect
343+
github.com/xanzy/ssh-agent v0.3.2 // indirect
342344
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
343345
github.com/yagipy/maintidx v1.0.0 // indirect
344346
github.com/yeya24/promlinter v0.2.0 // indirect
@@ -350,11 +352,11 @@ require (
350352
go.uber.org/atomic v1.9.0 // indirect
351353
go.uber.org/multierr v1.8.0 // indirect
352354
go.uber.org/zap v1.21.0 // indirect
353-
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
355+
golang.org/x/crypto v0.0.0-20220924013350-4ba4fb4dd9e7 // indirect
354356
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
355357
golang.org/x/exp/typeparams v0.0.0-20220613132600-b0d781184e0d // indirect
356-
golang.org/x/net v0.0.0-20220726230323-06994584191e // indirect
357-
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
358+
golang.org/x/net v0.0.0-20220923203811-8be639271d50 // indirect
359+
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // indirect
358360
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
359361
google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc // indirect
360362
gopkg.in/ini.v1 v1.66.6 // indirect

go.sum

Lines changed: 35 additions & 27 deletions
Large diffs are not rendered by default.

ignite/cmd/network_campaign_publish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func networkCampaignPublishHandler(cmd *cobra.Command, args []string) error {
4848
}
4949

5050
metadata, _ := cmd.Flags().GetString(flagMetadata)
51-
campaignID, err := n.CreateCampaign(args[0], metadata, totalSupply)
51+
campaignID, err := n.CreateCampaign(cmd.Context(), args[0], metadata, totalSupply)
5252
if err != nil {
5353
return err
5454
}

ignite/cmd/network_campaign_update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func networkCampaignUpdateHandler(cmd *cobra.Command, args []string) error {
8686
proposals = append(proposals, network.WithCampaignTotalSupply(totalSupply))
8787
}
8888

89-
if err = n.UpdateCampaign(campaignID, proposals...); err != nil {
89+
if err = n.UpdateCampaign(cmd.Context(), campaignID, proposals...); err != nil {
9090
return err
9191
}
9292

ignite/cmd/network_chain_publish.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ func networkChainPublishHandler(cmd *cobra.Command, args []string) error {
262262
}
263263

264264
if !rewardCoins.IsZero() && rewardDuration > 0 {
265-
if err := n.SetReward(launchID, rewardDuration, rewardCoins); err != nil {
265+
if err := n.SetReward(cmd.Context(), launchID, rewardDuration, rewardCoins); err != nil {
266266
return err
267267
}
268268
}
269269

270270
if !amountCoins.IsZero() {
271-
if err := n.SendAccountRequestForCoordinator(launchID, amountCoins); err != nil {
271+
if err := n.SendAccountRequestForCoordinator(cmd.Context(), launchID, amountCoins); err != nil {
272272
return err
273273
}
274274
}

ignite/cmd/network_chain_revert_launch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ func networkChainRevertLaunchHandler(cmd *cobra.Command, args []string) error {
5555
return err
5656
}
5757

58-
return n.RevertLaunch(launchID, c)
58+
return n.RevertLaunch(cmd.Context(), launchID, c)
5959
}

ignite/cmd/network_request_approve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func networkRequestApproveHandler(cmd *cobra.Command, args []string) error {
8484
for _, id := range ids {
8585
reviewals = append(reviewals, network.ApproveRequest(id))
8686
}
87-
if err := n.SubmitRequest(launchID, reviewals...); err != nil {
87+
if err := n.SubmitRequest(cmd.Context(), launchID, reviewals...); err != nil {
8888
return err
8989
}
9090

ignite/cmd/network_request_reject.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func networkRequestRejectHandler(cmd *cobra.Command, args []string) error {
5757
for _, id := range ids {
5858
reviewals = append(reviewals, network.RejectRequest(id))
5959
}
60-
if err := n.SubmitRequest(launchID, reviewals...); err != nil {
60+
if err := n.SubmitRequest(cmd.Context(), launchID, reviewals...); err != nil {
6161
return err
6262
}
6363

ignite/cmd/network_reward_release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func createClient(
229229

230230
spnRelayer, err := n.RewardIBCInfo(cmd.Context(), launchID)
231231
if errors.Is(err, network.ErrObjectNotFound) {
232-
spnRelayer.ClientID, err = n.CreateClient(launchID, unboundingTime, rewardsInfo)
232+
spnRelayer.ClientID, err = n.CreateClient(cmd.Context(), launchID, unboundingTime, rewardsInfo)
233233
}
234234
if err != nil {
235235
return networktypes.RewardIBCInfo{}, networktypes.RewardIBCInfo{}, err

0 commit comments

Comments
 (0)