mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-04 06:53:06 +00:00
22 lines
407 B
Go
22 lines
407 B
Go
package swap
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/status-im/go-waku/waku/v2/utils"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestSwapCreditDebit(t *testing.T) {
|
|
swap := NewWakuSwap(utils.Logger().Sugar(), []SwapOption{
|
|
WithMode(SoftMode),
|
|
WithThreshold(0, 0),
|
|
}...)
|
|
|
|
swap.Credit("1", 1)
|
|
require.Equal(t, -1, swap.Accounting["1"])
|
|
|
|
swap.Debit("1", 2)
|
|
require.Equal(t, 1, swap.Accounting["1"])
|
|
}
|