Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
bc1f392a
Commit
bc1f392a
authored
May 14, 2019
by
mdj33
Committed by
33cn
May 14, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix paracross ut
parent
19116644
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
7 deletions
+15
-7
assettransfer_test.go
plugin/dapp/paracross/executor/assettransfer_test.go
+9
-2
assetwithdraw_test.go
plugin/dapp/paracross/executor/assetwithdraw_test.go
+2
-2
paracross_test.go
plugin/dapp/paracross/executor/paracross_test.go
+4
-3
No files found.
plugin/dapp/paracross/executor/assettransfer_test.go
View file @
bc1f392a
...
@@ -18,6 +18,7 @@ import (
...
@@ -18,6 +18,7 @@ import (
dbmock
"github.com/33cn/chain33/common/db/mocks"
dbmock
"github.com/33cn/chain33/common/db/mocks"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/33cn/plugin/plugin/dapp/paracross/testnode"
)
)
// para-exec addr on main 1HPkPopVe3ERfvaAgedDtJQ792taZFEHCe
// para-exec addr on main 1HPkPopVe3ERfvaAgedDtJQ792taZFEHCe
...
@@ -27,6 +28,12 @@ var (
...
@@ -27,6 +28,12 @@ var (
Amount
=
int64
(
1
*
types
.
Coin
)
Amount
=
int64
(
1
*
types
.
Coin
)
)
)
func
para_init
(
title
string
){
cfg
,
_
:=
types
.
InitCfgString
(
testnode
.
DefaultConfig
)
types
.
Init
(
title
,
cfg
)
}
// 构建跨链交易, 用1个节点即可, 不测试共识
// 构建跨链交易, 用1个节点即可, 不测试共识
// assetTransfer
// assetTransfer
// 分别测试在主链和平行链的情况
// 分别测试在主链和平行链的情况
...
@@ -156,7 +163,7 @@ func (suite *AssetTransferTestSuite) TestExecTransfer() {
...
@@ -156,7 +163,7 @@ func (suite *AssetTransferTestSuite) TestExecTransfer() {
}
}
func
(
suite
*
AssetTransferTestSuite
)
TestExecTransferInPara
()
{
func
(
suite
*
AssetTransferTestSuite
)
TestExecTransferInPara
()
{
types
.
Init
(
Title
,
nil
)
para_init
(
Title
)
toB
:=
Nodes
[
1
]
toB
:=
Nodes
[
1
]
tx
,
err
:=
createAssetTransferTx
(
suite
.
Suite
,
PrivKeyA
,
toB
)
tx
,
err
:=
createAssetTransferTx
(
suite
.
Suite
,
PrivKeyA
,
toB
)
...
@@ -260,7 +267,7 @@ func (suite *AssetTransferTestSuite) TestExecTransferToken() {
...
@@ -260,7 +267,7 @@ func (suite *AssetTransferTestSuite) TestExecTransferToken() {
}
}
func
(
suite
*
AssetTransferTestSuite
)
TestExecTransferTokenInPara
()
{
func
(
suite
*
AssetTransferTestSuite
)
TestExecTransferTokenInPara
()
{
types
.
Init
(
Title
,
nil
)
para_init
(
Title
)
toB
:=
Nodes
[
1
]
toB
:=
Nodes
[
1
]
tx
,
err
:=
createAssetTransferTokenTx
(
suite
.
Suite
,
PrivKeyA
,
toB
)
tx
,
err
:=
createAssetTransferTokenTx
(
suite
.
Suite
,
PrivKeyA
,
toB
)
...
...
plugin/dapp/paracross/executor/assetwithdraw_test.go
View file @
bc1f392a
...
@@ -106,7 +106,7 @@ func (suite *AssetWithdrawTestSuite) TestExecAssetWithdrawOnMainChain() {
...
@@ -106,7 +106,7 @@ func (suite *AssetWithdrawTestSuite) TestExecAssetWithdrawOnMainChain() {
// 平行链执行
// 平行链执行
func
(
suite
*
AssetWithdrawTestSuite
)
TestExecAssetWithdrawOnParaChain
()
{
func
(
suite
*
AssetWithdrawTestSuite
)
TestExecAssetWithdrawOnParaChain
()
{
types
.
Init
(
Title
,
nil
)
para_init
(
Title
)
// make coins for transfer
// make coins for transfer
total
:=
1000
*
types
.
Coin
total
:=
1000
*
types
.
Coin
...
@@ -212,7 +212,7 @@ func (suite *AssetWithdrawTestSuite) TestExecAssetWithdrawAfterPara() {
...
@@ -212,7 +212,7 @@ func (suite *AssetWithdrawTestSuite) TestExecAssetWithdrawAfterPara() {
}
}
func
(
suite
*
AssetWithdrawTestSuite
)
TestExecWithdrawFailedOnPara
()
{
func
(
suite
*
AssetWithdrawTestSuite
)
TestExecWithdrawFailedOnPara
()
{
types
.
Init
(
Title
,
nil
)
para_init
(
Title
)
// make coins for transfer
// make coins for transfer
acc
:=
account
.
NewCoinsAccount
()
acc
:=
account
.
NewCoinsAccount
()
acc
.
SetDB
(
suite
.
stateDB
)
acc
.
SetDB
(
suite
.
stateDB
)
...
...
plugin/dapp/paracross/executor/paracross_test.go
View file @
bc1f392a
...
@@ -452,14 +452,14 @@ type VoteTestSuite struct {
...
@@ -452,14 +452,14 @@ type VoteTestSuite struct {
}
}
func
(
s
*
VoteTestSuite
)
SetupSuite
()
{
func
(
s
*
VoteTestSuite
)
SetupSuite
()
{
types
.
Init
(
Title
,
nil
)
para_init
(
Title
)
s
.
exec
=
newParacross
()
.
(
*
Paracross
)
s
.
exec
=
newParacross
()
.
(
*
Paracross
)
}
}
func
(
s
*
VoteTestSuite
)
TestVoteTx
()
{
func
(
s
*
VoteTestSuite
)
TestVoteTx
()
{
status
:=
&
pt
.
ParacrossNodeStatus
{
status
:=
&
pt
.
ParacrossNodeStatus
{
MainBlockHash
:
MainBlockHash10
,
MainBlockHash
:
MainBlockHash10
,
MainBlockHeight
:
MainBlockHeight
,
MainBlockHeight
:
0
,
PreBlockHash
:
PerBlock
,
PreBlockHash
:
PerBlock
,
Height
:
CurHeight
,
Height
:
CurHeight
,
Title
:
Title
,
Title
:
Title
,
...
@@ -588,7 +588,8 @@ func (s *VoteTestSuite) TestVoteTxFork() {
...
@@ -588,7 +588,8 @@ func (s *VoteTestSuite) TestVoteTxFork() {
// s.T().Log("tx exec name","i",i,"name",string(tx.Execer))
// s.T().Log("tx exec name","i",i,"name",string(tx.Execer))
//}
//}
types
.
S
(
"config.consensus.sub.para.MainForkParacrossCommitTx"
,
int64
(
1
))
//types.S("config.consensus.sub.para.MainForkParacrossCommitTx", int64(1))
//val,_:=types.G("config.consensus.sub.para.MainForkParacrossCommitTx")
errlog
:=
&
types
.
ReceiptLog
{
Ty
:
types
.
TyLogErr
,
Log
:
[]
byte
(
""
)}
errlog
:=
&
types
.
ReceiptLog
{
Ty
:
types
.
TyLogErr
,
Log
:
[]
byte
(
""
)}
feelog
:=
&
types
.
Receipt
{}
feelog
:=
&
types
.
Receipt
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment