mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-15 08:14:33 +00:00
3571f0bab9
* Add proto files * Add options * Add credit/debit for soft mode
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"])
|
|
}
|