36 lines
1014 B
Go
36 lines
1014 B
Go
package lpwindow_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"github.com/filecoin-project/go-state-types/dline"
|
|
|
|
"github.com/filecoin-project/lotus/chain/types"
|
|
"github.com/filecoin-project/lotus/lib/harmony/harmonydb"
|
|
"github.com/filecoin-project/lotus/lib/harmony/harmonytask"
|
|
"github.com/filecoin-project/lotus/node/config"
|
|
"github.com/filecoin-project/lotus/provider/lpwindow"
|
|
)
|
|
|
|
// test to create WDPostTask, invoke AddTask and check if the task is added to the DB
|
|
func TestAddTask(t *testing.T) {
|
|
db, err := harmonydb.NewFromConfig(config.HarmonyDB{
|
|
Hosts: []string{"localhost"},
|
|
Port: "5433",
|
|
Username: "yugabyte",
|
|
Password: "yugabyte",
|
|
Database: "yugabyte",
|
|
})
|
|
require.NoError(t, err)
|
|
wdPostTask, err := lpwindow.NewWdPostTask(db, nil, 0)
|
|
require.NoError(t, err)
|
|
taskEngine, err := harmonytask.New(db, []harmonytask.TaskInterface{wdPostTask}, "localhost:12300")
|
|
_ = taskEngine
|
|
ts := types.TipSet{}
|
|
deadline := dline.Info{}
|
|
|
|
require.NoError(t, err)
|
|
}
|