refactor: convert multisig tests to kit2

This commit is contained in:
Dirk McCormick 2021-06-14 14:03:08 +02:00
parent d94a19ff65
commit 86cca7303d

View File

@ -12,26 +12,26 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/cli"
"github.com/filecoin-project/lotus/itests/kit"
"github.com/filecoin-project/lotus/itests/kit2"
"github.com/stretchr/testify/require"
)
// TestMultisig does a basic test to exercise the multisig CLI commands
func TestMultisig(t *testing.T) {
_ = os.Setenv("BELLMAN_NO_GPU", "1")
kit.QuietMiningLogs()
kit2.QuietMiningLogs()
blocktime := 5 * time.Millisecond
ctx := context.Background()
clientNode, _ := kit.StartOneNodeOneMiner(ctx, t, blocktime)
blockTime := 5 * time.Millisecond
client, _, ens := kit2.EnsembleMinimal(t, kit2.MockProofs())
ens.InterconnectAll().BeginMining(blockTime)
runMultisigTests(t, clientNode)
runMultisigTests(t, *client)
}
func runMultisigTests(t *testing.T, clientNode kit.TestFullNode) {
func runMultisigTests(t *testing.T, clientNode kit2.TestFullNode) {
// Create mock CLI
ctx := context.Background()
mockCLI := kit.NewMockCLI(ctx, t, cli.Commands)
mockCLI := kit2.NewMockCLI(ctx, t, cli.Commands)
clientCLI := mockCLI.Client(clientNode.ListenAddr)
// Create some wallets on the node to use for testing multisig
@ -42,7 +42,7 @@ func runMultisigTests(t *testing.T, clientNode kit.TestFullNode) {
walletAddrs = append(walletAddrs, addr)
kit.SendFunds(ctx, t, clientNode, addr, types.NewInt(1e15))
kit2.SendFunds(ctx, t, clientNode, addr, types.NewInt(1e15))
}
// Create an msig with three of the addresses and threshold of two sigs