Skip to content

Commit

Permalink
chore: use waku-org/waku-proto repository for protobuffer definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Oct 24, 2023
1 parent 9b9fc63 commit 3ed204f
Show file tree
Hide file tree
Showing 25 changed files with 982 additions and 1,036 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "libs/waku-rln-contract"]
path = libs/waku-rln-contract
url = https://github.com/waku-org/waku-rln-contract.git
[submodule "waku/v2/protocol/waku-proto"]
path = waku/v2/protocol/waku-proto
url = git@github.com:waku-org/waku-proto.git
8 changes: 6 additions & 2 deletions waku/v2/protocol/filter/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func (wf *WakuFilterLightNode) onRequest(ctx context.Context) func(s network.Str

reader := pbio.NewDelimitedReader(s, math.MaxInt32)

messagePush := &pb.MessagePushV2{}
messagePush := &pb.MessagePush{}
err := reader.ReadMsg(messagePush)
if err != nil {
logger.Error("reading message push", zap.Error(err))
Expand Down Expand Up @@ -207,7 +207,11 @@ func (wf *WakuFilterLightNode) request(ctx context.Context, params *FilterSubscr

if filterSubscribeResponse.StatusCode != http.StatusOK {
wf.metrics.RecordError(errorResponse)
err := NewFilterError(int(filterSubscribeResponse.StatusCode), filterSubscribeResponse.StatusDesc)
errMessage := ""
if filterSubscribeResponse.StatusDesc != nil {
errMessage = *filterSubscribeResponse.StatusDesc
}
err := NewFilterError(int(filterSubscribeResponse.StatusCode), errMessage)
return &err
}

Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion waku/v2/protocol/filter/pb/generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package pb

//go:generate protoc -I./../../pb/. -I. --go_opt=paths=source_relative --go_opt=Mwaku_filter_v2.proto=github.com/waku-org/go-waku/waku/v2/protocol/filter/pb --go_opt=Mwaku_message.proto=github.com/waku-org/go-waku/waku/v2/protocol/pb --go_out=. ./waku_filter_v2.proto
//go:generate protoc -I./../../waku-proto/waku/filter/v2/. -I./../../waku-proto/ --go_opt=paths=source_relative --go_opt=Mfilter.proto=github.com/waku-org/go-waku/waku/v2/protocol/filter/pb --go_opt=Mwaku/message/v1/message.proto=github.com/waku-org/go-waku/waku/v2/protocol/pb --go_out=. ./../../waku-proto/waku/filter/v2/filter.proto
36 changes: 0 additions & 36 deletions waku/v2/protocol/filter/pb/waku_filter_v2.proto

This file was deleted.

7 changes: 4 additions & 3 deletions waku/v2/protocol/filter/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ func (wf *WakuFilterFullNode) reply(ctx context.Context, s network.Stream, reque
}

if len(description) != 0 {
response.StatusDesc = description[0]
response.StatusDesc = &description[0]
} else {
response.StatusDesc = http.StatusText(statusCode)
desc := http.StatusText(statusCode)
response.StatusDesc = &desc
}

writer := pbio.NewDelimitedWriter(s)
Expand Down Expand Up @@ -271,7 +272,7 @@ func (wf *WakuFilterFullNode) pushMessage(ctx context.Context, peerID peer.ID, e
zap.String("contentTopic", env.Message().ContentTopic),
)
pubSubTopic := env.PubsubTopic()
messagePush := &pb.MessagePushV2{
messagePush := &pb.MessagePush{
PubsubTopic: &pubSubTopic,
WakuMessage: env.Message(),
}
Expand Down
Loading

0 comments on commit 3ed204f

Please sign in to comment.