mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-15 08:14:33 +00:00
11d1f8fb0d
* feat: result aggregation in resume and enforce max page size * feat: add WithLogger option to wakunode (#184) * fix: rebase issues
22 lines
391 B
Go
22 lines
391 B
Go
package swap
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/status-im/go-waku/tests"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestSwapCreditDebit(t *testing.T) {
|
|
swap := NewWakuSwap(tests.Logger(), []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"])
|
|
}
|