mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-28 14:34:49 +00:00
21 lines
337 B
Go
21 lines
337 B
Go
|
package swap
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/require"
|
||
|
)
|
||
|
|
||
|
func TestSwapCreditDebit(t *testing.T) {
|
||
|
swap := NewWakuSwap([]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"])
|
||
|
}
|