mirror of
https://github.com/AthanorLabs/atomic-swap.git
synced 2026-01-09 14:18:03 -05:00
30 lines
611 B
Go
30 lines
611 B
Go
// Copyright 2023 The AthanorLabs/atomic-swap Authors
|
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
|
|
package net
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/athanorlabs/atomic-swap/common/types"
|
|
)
|
|
|
|
func TestHost_Query(t *testing.T) {
|
|
ha := newHost(t, basicTestConfig(t))
|
|
err := ha.Start()
|
|
require.NoError(t, err)
|
|
|
|
hb := newHost(t, basicTestConfig(t))
|
|
err = hb.Start()
|
|
require.NoError(t, err)
|
|
|
|
err = ha.h.Connect(ha.ctx, hb.h.AddrInfo())
|
|
require.NoError(t, err)
|
|
|
|
resp, err := ha.Query(hb.h.PeerID())
|
|
require.NoError(t, err)
|
|
require.Equal(t, []*types.Offer{}, resp.Offers)
|
|
}
|