Commit dbf7ffbe authored by liuyuhang's avatar liuyuhang

modify paracross dapp test and relay test

parent b6105c0a
......@@ -7,26 +7,17 @@ import (
_ "github.com/33cn/chain33/system"
_ "github.com/33cn/plugin/plugin"
"github.com/33cn/chain33/util/testnode"
"github.com/33cn/chain33/types"
"strings"
)
func TestParaNode(t *testing.T) {
cfg := types.NewChain33Config(strings.Replace(types.GetDefaultCfgstring(), "Title=\"local\"", "Title=\"chain33\"" , 1))
cfg.GetModuleConfig().Consensus.Name = "ticket"
main := testnode.NewWithConfig(cfg, nil)
main.Listen()
para := NewParaNode(main, nil)
para := NewParaNode(nil, nil)
paraCfg := para.Para.GetAPI().GetConfig()
defer para.Close()
//通过rpc 发生信息
tx := util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.guodun.none")
tx := util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.test.none")
para.Para.SendTxRPC(tx)
para.Para.WaitHeight(1)
tx = util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.guodun.none")
tx = util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.test.none")
para.Para.SendTxRPC(tx)
para.Para.WaitHeight(2)
}
......@@ -32,10 +32,10 @@ func TestParaQuery(t *testing.T) {
para.Para.GetAPI().WalletLock()
//通过rpc 发生信息
tx := util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.guodun.none")
tx := util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.test.none")
para.Para.SendTxRPC(tx)
para.Para.WaitHeight(1)
tx = util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.guodun.none")
tx = util.CreateTxWithExecer(paraCfg, para.Para.GetGenesisKey(), "user.p.test.none")
para.Para.SendTxRPC(tx)
para.Para.WaitHeight(2)
......
......@@ -11,7 +11,6 @@ import (
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/common/db/mocks"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/util/testnode"
ty "github.com/33cn/plugin/plugin/dapp/relay/types"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite"
......@@ -23,8 +22,6 @@ import (
var chainTestCfg = types.NewChain33Config(types.GetDefaultCfgstring())
func init() {
//init some config param
testnode.New("", nil)
Init(ty.RelayX, chainTestCfg, nil)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment