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
f1252ce0
Commit
f1252ce0
authored
Sep 07, 2021
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix antonomy unit test
parent
ec973d22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
board_test.go
plugin/dapp/autonomy/executor/board_test.go
+0
-1
ruleaction_test.go
plugin/dapp/autonomy/executor/ruleaction_test.go
+16
-0
No files found.
plugin/dapp/autonomy/executor/board_test.go
View file @
f1252ce0
...
...
@@ -407,7 +407,6 @@ func checkExecLocalBoard(t *testing.T, kvdb db.KVDB, cur *auty.AutonomyProposalB
assert
.
Equal
(
t
,
prop
.
Address
,
cur
.
Address
)
assert
.
Equal
(
t
,
prop
.
Height
,
cur
.
Height
)
assert
.
Equal
(
t
,
prop
.
Index
,
cur
.
Index
)
}
func
saveKvs
(
sdb
db
.
DB
,
kvs
[]
*
types
.
KeyValue
)
{
...
...
plugin/dapp/autonomy/executor/ruleaction_test.go
View file @
f1252ce0
...
...
@@ -25,6 +25,8 @@ const (
testProposalAmount
=
minProposalAmount
*
types
.
DefaultCoinPrecision
*
2
testLargeProjectAmount
=
minLargeProjectAmount
*
2
*
types
.
DefaultCoinPrecision
testPublicPeriod
=
minPublicPeriod
testPubAttendRatio
int32
=
maxPubAttendRatio
testPubApproveRatio
int32
=
minPubApproveRatio
)
func
TestPropRule
(
t
*
testing
.
T
)
{
...
...
@@ -42,6 +44,8 @@ func TestPropRule(t *testing.T) {
ProposalAmount
:
maxProposalAmount
*
types
.
DefaultCoinPrecision
,
LargeProjectAmount
:
maxLargeProjectAmount
*
types
.
DefaultCoinPrecision
,
PublicPeriod
:
maxPublicPeriod
,
PubAttendRatio
:
maxPubAttendRatio
,
PubApproveRatio
:
maxPubApproveRatio
,
},
StartBlockHeight
:
env
.
blockHeight
+
5
,
EndBlockHeight
:
env
.
blockHeight
+
startEndBlockPeriod
+
10
,
...
...
@@ -53,6 +57,8 @@ func TestPropRule(t *testing.T) {
ProposalAmount
:
minProposalAmount
*
types
.
DefaultCoinPrecision
,
LargeProjectAmount
:
minLargeProjectAmount
*
types
.
DefaultCoinPrecision
,
PublicPeriod
:
minPublicPeriod
,
PubAttendRatio
:
minPubAttendRatio
,
PubApproveRatio
:
minPubApproveRatio
,
},
StartBlockHeight
:
env
.
blockHeight
+
5
,
EndBlockHeight
:
env
.
blockHeight
+
startEndBlockPeriod
+
10
,
...
...
@@ -64,6 +70,8 @@ func TestPropRule(t *testing.T) {
ProposalAmount
:
minProposalAmount
*
types
.
DefaultCoinPrecision
-
1
,
LargeProjectAmount
:
minLargeProjectAmount
*
types
.
DefaultCoinPrecision
-
1
,
PublicPeriod
:
minPublicPeriod
-
1
,
PubAttendRatio
:
minPubAttendRatio
-
1
,
PubApproveRatio
:
minPubApproveRatio
-
1
,
},
StartBlockHeight
:
env
.
blockHeight
+
5
,
EndBlockHeight
:
env
.
blockHeight
+
startEndBlockPeriod
+
10
,
...
...
@@ -75,6 +83,8 @@ func TestPropRule(t *testing.T) {
ProposalAmount
:
maxProposalAmount
*
types
.
DefaultCoinPrecision
+
1
,
LargeProjectAmount
:
maxLargeProjectAmount
*
types
.
DefaultCoinPrecision
+
1
,
PublicPeriod
:
maxPublicPeriod
+
1
,
PubAttendRatio
:
maxPubAttendRatio
+
1
,
PubApproveRatio
:
maxPubApproveRatio
+
1
,
},
StartBlockHeight
:
env
.
blockHeight
+
5
,
EndBlockHeight
:
env
.
blockHeight
+
startEndBlockPeriod
+
10
,
...
...
@@ -86,6 +96,8 @@ func TestPropRule(t *testing.T) {
ProposalAmount
:
minProposalAmount
*
types
.
DefaultCoinPrecision
+
1
,
LargeProjectAmount
:
minLargeProjectAmount
*
types
.
DefaultCoinPrecision
+
1
,
PublicPeriod
:
minPublicPeriod
+
1
,
PubAttendRatio
:
minPubAttendRatio
+
1
,
PubApproveRatio
:
minPubApproveRatio
+
1
,
},
StartBlockHeight
:
env
.
blockHeight
+
5
,
EndBlockHeight
:
env
.
blockHeight
+
startEndBlockPeriod
+
10
,
...
...
@@ -147,6 +159,8 @@ func testPropRule(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.K
ProposalAmount
:
testProposalAmount
,
LargeProjectAmount
:
testLargeProjectAmount
,
PublicPeriod
:
testPublicPeriod
,
PubAttendRatio
:
testPubAttendRatio
,
PubApproveRatio
:
testPubApproveRatio
,
},
StartBlockHeight
:
env
.
blockHeight
+
5
,
EndBlockHeight
:
env
.
blockHeight
+
startEndBlockPeriod
+
10
,
...
...
@@ -384,6 +398,8 @@ func voteProposalRule(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB d
assert
.
Equal
(
t
,
rule
.
ProposalAmount
,
testProposalAmount
)
assert
.
Equal
(
t
,
rule
.
LargeProjectAmount
,
testLargeProjectAmount
)
assert
.
Equal
(
t
,
rule
.
PublicPeriod
,
testPublicPeriod
)
assert
.
Equal
(
t
,
rule
.
PubAttendRatio
,
testPubAttendRatio
)
assert
.
Equal
(
t
,
rule
.
PubApproveRatio
,
testPubApproveRatio
)
}
func
voteProposalRuleTx
(
parm
*
auty
.
VoteProposalRule
)
(
*
types
.
Transaction
,
error
)
{
...
...
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