irl testing pass

This commit is contained in:
41666 2025-03-26 14:03:50 -07:00
parent dfbb9e2bca
commit 02f5075d3b
5 changed files with 21 additions and 8 deletions

View file

@ -13,14 +13,14 @@ import (
type Interactions struct {
PublicKey ed25519.PublicKey
Guilds discord.IGuildService
Guilds *discord.GuildService
Router *InteractionRouter
// if interactions are able to be used
OK bool
}
func NewInteractions(publicKey string, guildsService discord.IGuildService) *Interactions {
func NewInteractions(publicKey string, guildsService *discord.GuildService) *Interactions {
return &Interactions{
PublicKey: ed25519.PublicKey(publicKey),
Guilds: guildsService,

View file

@ -19,9 +19,9 @@ func TestNewInteractions(t *testing.T) {
pub, _, _ := ed25519.GenerateKey(nil)
key := hex.EncodeToString(pub)
gsm := &discord.GuildServiceMock{}
gs := &discord.GuildService{}
i := interactions.NewInteractions(key, gsm)
i := interactions.NewInteractions(key, gs)
assert.True(t, i.OK, "interactions OK")
assert.Equal(t, string(i.PublicKey), key, "public key accepted from args")
}

View file

@ -16,13 +16,13 @@ import (
"github.com/stretchr/testify/assert"
)
func makeInteractions(t *testing.T) (*interactions.Interactions, *discord.GuildServiceMock, ed25519.PrivateKey) {
func makeInteractions(t *testing.T) (*interactions.Interactions, *discord.GuildService, ed25519.PrivateKey) {
pub, priv, err := ed25519.GenerateKey(nil)
if err != nil {
t.Errorf("makeInteractions: failed to generate key: %v", err)
}
gs := &discord.GuildServiceMock{}
gs := &discord.GuildService{}
i := &interactions.Interactions{
PublicKey: pub,