package wallet

import (
	"context"
	"testing"
)

func TestRegisterAndLookupWalletConnectSession(t *testing.T) {
	sessionID := "wc-test-topic-123"
	address := "0x4A666F96fC8764181194447A7dFdb7d471b301C8"

	registered := RegisterClientSession(sessionID, address, 138)
	if registered == nil || !registered.Connected {
		t.Fatalf("expected connected session, got %#v", registered)
	}

	wc := NewWalletConnect(138)
	session, err := wc.GetSession(context.Background(), sessionID)
	if err != nil {
		t.Fatalf("GetSession: %v", err)
	}
	if session.Address != address {
		t.Fatalf("expected address %s, got %s", address, session.Address)
	}
}
