mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 11:41:38 +00:00
Fix senderID/key conversion unit tests
This commit is contained in:
parent
3f4df25b31
commit
8cf6c381e2
@ -183,7 +183,7 @@ func TestUserRoomKeys(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
wantKeys := map[spec.RoomID]map[string]string{
|
wantKeys := map[spec.RoomID]map[string]string{
|
||||||
*roomID: {
|
*roomID: {
|
||||||
string(key.Public().(ed25519.PublicKey)): userID.String(),
|
spec.Base64Bytes(key.Public().(ed25519.PublicKey)).Encode(): userID.String(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
assert.Equal(t, wantKeys, userIDs)
|
assert.Equal(t, wantKeys, userIDs)
|
||||||
|
@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/matrix-org/dendrite/roomserver/types"
|
"github.com/matrix-org/dendrite/roomserver/types"
|
||||||
"github.com/matrix-org/dendrite/setup/config"
|
"github.com/matrix-org/dendrite/setup/config"
|
||||||
"github.com/matrix-org/dendrite/test"
|
"github.com/matrix-org/dendrite/test"
|
||||||
|
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
ed255192 "golang.org/x/crypto/ed25519"
|
ed255192 "golang.org/x/crypto/ed25519"
|
||||||
)
|
)
|
||||||
@ -101,8 +102,8 @@ func TestUserRoomKeysTable(t *testing.T) {
|
|||||||
assert.NotNil(t, gotKeys)
|
assert.NotNil(t, gotKeys)
|
||||||
|
|
||||||
wantKeys := map[string]types.UserRoomKeyPair{
|
wantKeys := map[string]types.UserRoomKeyPair{
|
||||||
string(key2.Public().(ed25519.PublicKey)): {RoomNID: roomNID, EventStateKeyNID: userNID},
|
string(spec.Base64Bytes(key2.Public().(ed25519.PublicKey)).Encode()): {RoomNID: roomNID, EventStateKeyNID: userNID},
|
||||||
string(key3.Public().(ed25519.PublicKey)): {RoomNID: roomNID, EventStateKeyNID: userNID2},
|
string(spec.Base64Bytes(key3.Public().(ed25519.PublicKey)).Encode()): {RoomNID: roomNID, EventStateKeyNID: userNID2},
|
||||||
}
|
}
|
||||||
assert.Equal(t, wantKeys, gotKeys)
|
assert.Equal(t, wantKeys, gotKeys)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user