Skip to content

Commit

Permalink
Merge branch 'main' into nm/identity-db-overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed May 29, 2024
2 parents 9f35c55 + b0064d6 commit edaa59f
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 2 deletions.
1 change: 1 addition & 0 deletions dev/generate
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -e

go generate ./...

# Generate mocks
mockery
rm -rf pkg/proto/**/*.pb.go pkg/proto/**/*.pb.gw.go pkg/proto/**/*.swagger.json
if ! buf generate https://github.com/xmtp/proto.git#branch=main,subdir=proto; then
Expand Down
2 changes: 1 addition & 1 deletion pkg/mls/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (s *Store) PublishIdentityUpdate(ctx context.Context, req *identity.Publish
return errors.New("inbox log is full")
}

updates := make([]*associations.IdentityUpdate, 0, len(inboxLogEntries)+1)
updates := make([]*associations.IdentityUpdate, 0, len(inboxLogEntries))
for _, log := range inboxLogEntries {
identityUpdate := &associations.IdentityUpdate{}
if err := proto.Unmarshal(log.IdentityUpdateProto, identityUpdate); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion pkg/mls/store/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/xmtp/xmtp-node-go/pkg/proto/identity/associations"
mlsv1 "github.com/xmtp/xmtp-node-go/pkg/proto/mls/api/v1"
test "github.com/xmtp/xmtp-node-go/pkg/testing"
testutils "github.com/xmtp/xmtp-node-go/pkg/testing"
"github.com/xmtp/xmtp-node-go/pkg/utils"
)

Expand All @@ -44,7 +45,7 @@ func TestPublishIdentityUpdateParallel(t *testing.T) {
// Create a mapping of inboxes to addresses
inboxes := make(map[string]string)
for i := 0; i < 50; i++ {
inboxes[utils.HexEncode([]byte(fmt.Sprintf("inbox_%d", i)))] = fmt.Sprintf("address_%d", i)
inboxes[testutils.RandomInboxId()] = fmt.Sprintf("address_%d", i)
}

mockMlsValidation := mocks.NewMockMLSValidationService(t)
Expand Down
142 changes: 142 additions & 0 deletions pkg/mlsvalidate/mocks/mock.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit edaa59f

Please sign in to comment.