Commit d0bdb61f authored by jiangpeng's avatar jiangpeng Committed by vipwzw

add paracross autotest

parent bee936b0
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package autotest
import (
"reflect"
"github.com/33cn/chain33/cmd/autotest/types"
coinautotest "github.com/33cn/chain33/system/dapp/coins/autotest"
tokenautotest "github.com/33cn/plugin/plugin/dapp/token/autotest"
)
type paracrossAutoTest struct {
SimpleCaseArr []types.SimpleCase `toml:"SimpleCase,omitempty"`
TokenPreCreateCaseArr []tokenautotest.TokenPreCreateCase `toml:"TokenPreCreateCase,omitempty"`
TokenFinishCreateCaseArr []tokenautotest.TokenFinishCreateCase `toml:"TokenFinishCreateCase,omitempty"`
TransferCaseArr []coinautotest.TransferCase `toml:"TransferCase,omitempty"`
}
func init() {
types.RegisterAutoTest(paracrossAutoTest{})
}
func (config paracrossAutoTest) GetName() string {
return "paracross"
}
func (config paracrossAutoTest) GetTestConfigType() reflect.Type {
return reflect.TypeOf(config)
}
#paracross exec addr 1HPkPopVe3ERfvaAgedDtJQ792taZFEHCe
#user.p.test.paracross exec addr 16zsMh7mvNDKPG6E9NVrPhw6zL93gWsTpR
[[TokenPreCreateCase]]
id = "tokenPre"
command = "send token precreate -f 0.01 -i testToken -n testToken -s PT -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -t 100000 -p 0.1 -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
dep = ["transForPrecreate"]
[[TokenFinishCreateCase]]
id = "tokenFinish"
command = "send token finish -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -f 0.01 -s PT -k 0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc"
dep = ["tokenPre"]
#send to token for precreate
[[TransferCase]]
id = "transForPrecreate"
command = "send bty transfer -a 1 -t 12hpJBHybh1mSyCijQ2MQJPk7z7kZ7jnQa -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
to = "12hpJBHybh1mSyCijQ2MQJPk7z7kZ7jnQa"
amount = "1"
checkItem = ["balance"]
[[TransferCase]]
id = "btyToExec"
command = "send bty transfer -a 1 -t 1HPkPopVe3ERfvaAgedDtJQ792taZFEHCe -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
to = "1HPkPopVe3ERfvaAgedDtJQ792taZFEHCe"
amount = "1"
checkItem = ["balance"]
#send para asset bty
[[TransferCase]]
id = "btyParaTrans"
command = "send para asset_transfer --title user.p.test. -a 0.1 -t 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
#复用coins的transfer用例,此处to地址比较特殊,为平行链paracross合约的地址
to = "16zsMh7mvNDKPG6E9NVrPhw6zL93gWsTpR"
amount = "0.1"
checkItem = ["balance"]
dep = ["btyToExec"]
repeat = 10
#send token to paracross
[[TransferCase]]
id = "tokenToExec"
command = "send token send_exec -a 10 -s PT -e paracross -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
to = "1HPkPopVe3ERfvaAgedDtJQ792taZFEHCe"
amount = "10"
checkItem = ["balance"]
dep = ["tokenFinish"]
#send para asset token PT
[[TransferCase]]
id = "tokenParaTrans"
command = "send para asset_transfer --title user.p.test. -s PT -a 1 -t 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
from = "12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
#复用coins的transfer用例,此处to地址比较特殊,为平行链paracross合约的地址
to = "16zsMh7mvNDKPG6E9NVrPhw6zL93gWsTpR"
amount = "1"
checkItem = ["balance"]
dep = ["tokenToExec"]
repeat = 10
......@@ -6,6 +6,7 @@ package paracross
import (
"github.com/33cn/chain33/pluginmgr"
_ "github.com/33cn/plugin/plugin/dapp/paracross/autotest" // register autotest package
"github.com/33cn/plugin/plugin/dapp/paracross/commands"
"github.com/33cn/plugin/plugin/dapp/paracross/executor"
"github.com/33cn/plugin/plugin/dapp/paracross/rpc"
......
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