go-waku/waku/v2/protocol/swap/waku_swap_option_test.go
Anthony Laibe 3571f0bab9 feat: init swap protocol
* Add proto files
* Add options
* Add credit/debit for soft mode
2021-11-24 13:58:35 +01:00

25 lines
407 B
Go

package swap
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestSwapOption(t *testing.T) {
options := []SwapOption{
WithMode(SoftMode),
WithThreshold(10, 0),
}
params := &SwapParameters{}
for _, opt := range options {
opt(params)
}
require.Equal(t, SoftMode, params.mode)
require.Equal(t, 10, params.paymentThreshold)
require.Equal(t, 0, params.disconnectThreshold)
}