mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
All the structs defined in the `channeldb/models` package are graph related. So once we move all the graph CRUD code to the graph package, it makes sense to have the schema structs there too. So this just moves the `models` package over to `graph/db/models`.
33 lines
518 B
Go
33 lines
518 B
Go
package models
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestInboundFee(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
// Test positive fee.
|
|
i := InboundFee{
|
|
Base: 5,
|
|
Rate: 500000,
|
|
}
|
|
|
|
require.Equal(t, int64(6), i.CalcFee(2))
|
|
|
|
// Expect fee to be rounded down.
|
|
require.Equal(t, int64(6), i.CalcFee(3))
|
|
|
|
// Test negative fee.
|
|
i = InboundFee{
|
|
Base: -5,
|
|
Rate: -500000,
|
|
}
|
|
|
|
require.Equal(t, int64(-6), i.CalcFee(2))
|
|
|
|
// Expect fee to be rounded up.
|
|
require.Equal(t, int64(-6), i.CalcFee(3))
|
|
}
|