autopilot: split channel definition into LocalChannel/ChannelEdge

Since non-local channels won't have a balance field, we split the
definitions in anticipation of adding one.
This commit is contained in:
Johan T. Halseth
2020-10-02 13:56:43 +02:00
parent 3e1755ee99
commit d40cf6b592
14 changed files with 66 additions and 72 deletions

View File

@@ -37,7 +37,7 @@ func TestConstraintsChannelBudget(t *testing.T) {
}
testCases := []struct {
channels []Channel
channels []LocalChannel
walletAmt btcutil.Amount
needMore bool
@@ -47,7 +47,7 @@ func TestConstraintsChannelBudget(t *testing.T) {
// Many available funds, but already have too many active open
// channels.
{
[]Channel{
[]LocalChannel{
{
ChanID: randChanID(),
Capacity: btcutil.Amount(prand.Int31()),
@@ -70,7 +70,7 @@ func TestConstraintsChannelBudget(t *testing.T) {
// Ratio of funds in channels and total funds meets the
// threshold.
{
[]Channel{
[]LocalChannel{
{
ChanID: randChanID(),
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
@@ -93,7 +93,7 @@ func TestConstraintsChannelBudget(t *testing.T) {
// recommended. We should also request 2 more channels as the
// limit is 3.
{
[]Channel{
[]LocalChannel{
{
ChanID: randChanID(),
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
@@ -113,7 +113,7 @@ func TestConstraintsChannelBudget(t *testing.T) {
// to be committed. We should only request a single additional
// channel as the limit is 3.
{
[]Channel{
[]LocalChannel{
{
ChanID: randChanID(),
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),
@@ -132,7 +132,7 @@ func TestConstraintsChannelBudget(t *testing.T) {
// Ratio of funds in channels and total funds is above the
// threshold.
{
[]Channel{
[]LocalChannel{
{
ChanID: randChanID(),
Capacity: btcutil.Amount(btcutil.SatoshiPerBitcoin),