Skip to content

Commit

Permalink
fix client
Browse files Browse the repository at this point in the history
  • Loading branch information
AnomalRoil committed Jul 5, 2024
1 parent 9984cb6 commit d957ac2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion gossip-relay/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,24 @@ var clientCmd = &cli.Command{
Action: func(cctx *cli.Context) error {
lg := log.New(nil, log.DefaultLevel, false)
cctx.Context = log.ToContext(cctx.Context, lg)
if cctx.IsSet(lib.GroupConfListFlag.Name) {
groupConfs := cctx.StringSlice(lib.GroupConfListFlag.Name)
if len(groupConfs) != 1 {
return fmt.Errorf("please specify a single valid chain using the --%s flag with the client command")

Check failure on line 209 in gossip-relay/main.go

View workflow job for this annotation

GitHub Actions / test

fmt.Errorf format %s reads arg #1, but call has 0 args
}

if cctx.IsSet(lib.GroupConfFlag.Name) {
return fmt.Errorf("please do not use both --%s and --%s at the same time", lib.GroupConfFlag.Name, lib.GroupConfListFlag.Name)
}
cctx.Set(lib.GroupConfFlag.Name, groupConfs[0])
}
c, err := lib.Create(cctx, false)
if err != nil {
return fmt.Errorf("constructing client: %w", err)
}

for rand := range c.Watch(cctx.Context) {
lg.Infow("", "client", "got randomness", "round", rand.GetRound(), "signature", rand.GetSignature()[:16])
lg.Infow("", "client", "got randomness", "round", rand.GetRound(), "signature", hex.EncodeToString(rand.GetSignature()))
}

return nil
Expand Down

0 comments on commit d957ac2

Please sign in to comment.