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
233bd4d3
Unverified
Commit
233bd4d3
authored
Jan 20, 2020
by
vipwzw
Committed by
GitHub
Jan 20, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #780 from lyh169/autonomy_rpc_test
Autonomy rpc test
parents
754b2b90
d22327c7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
2 deletions
+26
-2
dapp-test-common.sh
build/dapp-test-common.sh
+8
-0
docker-compose.sh
build/docker-compose.sh
+12
-0
test-rpc.sh
plugin/dapp/autonomy/cmd/test/test-rpc.sh
+0
-0
autonomy.go
plugin/dapp/autonomy/executor/autonomy.go
+2
-0
boardaction.go
plugin/dapp/autonomy/executor/boardaction.go
+1
-1
testcase.sh
plugin/dapp/paracross/cmd/build/testcase.sh
+3
-1
No files found.
build/dapp-test-common.sh
View file @
233bd4d3
...
...
@@ -2,6 +2,7 @@
RAW_TX_HASH
=
""
LAST_BLOCK_HASH
=
""
LAST_BLOCK_HEIGHT
=
0
CASE_ERR
=
""
RETURN_RESP
=
""
...
...
@@ -191,6 +192,13 @@ chain33_LastBlockhash() {
echo
-e
"######
\\
n last blockhash is
$LAST_BLOCK_HASH
\\
n######"
}
chain33_LastBlockHeight
()
{
local
MAIN_HTTP
=
$1
result
=
$(
curl
-ksd
'{"method":"Chain33.GetLastHeader","params":[{}]}'
-H
'content-type:text/plain;'
"
${
MAIN_HTTP
}
"
| jq
-r
".result.height"
)
LAST_BLOCK_HEIGHT
=
$result
echo
-e
"######
\\
n last blockheight is
$LAST_BLOCK_HEIGHT
\\
n######"
}
chain33_applyCoins
()
{
echo
"chain33_getMainChainCoins"
if
[
"$#"
-lt
3
]
;
then
...
...
build/docker-compose.sh
View file @
233bd4d3
...
...
@@ -112,6 +112,9 @@ function base_init() {
#relay genesis
sed
-i
$sedfix
's/^genesis="12qyocayNF7.*/genesis="1G5Cjy8LuQex2fuYv3gzb7B8MxAnxLEqt3"/g'
chain33.toml
#autonomy
sed
-i
$sedfix
's/^useBalance=.*/useBalance=true/g'
chain33.toml
sed
-i
$sedfix
's/^total="16htvcBNS.*/total="1Q9sQwothzM1gKSzkVZ8Dt1tqKX1uzSagx"/g'
chain33.toml
}
function
start
()
{
...
...
@@ -433,6 +436,15 @@ function dapp_test_address() {
# block_wait "${1}" 1
tx_wait
"
${
1
}
"
"
${
hash
}
"
#autonomy allocation for rpc test 1Q9sQwothzM1gKSzkVZ8Dt1tqKX1uzSagx
result
=
$(${
1
}
account import_key
-k
1c3e6cac2f887e1ab9180e2d5772dc4ba01accb8d4df434faba097003eb35482
-l
autonomytest | jq
".label"
)
echo
"
${
result
}
"
if
[
-z
"
${
result
}
"
]
;
then
exit
1
fi
hash
=
$(${
1
}
send coins transfer
-a
6300
-n
transfer
-t
1Q9sQwothzM1gKSzkVZ8Dt1tqKX1uzSagx
-k
4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01
)
echo
"
${
hash
}
"
}
function
base_config
()
{
...
...
plugin/dapp/autonomy/cmd/test/test-rpc.sh
View file @
233bd4d3
This diff is collapsed.
Click to expand it.
plugin/dapp/autonomy/executor/autonomy.go
View file @
233bd4d3
...
...
@@ -22,6 +22,7 @@ var (
driverName
=
auty
.
AutonomyX
autonomyAddr
string
subcfg
subConfig
ticketName
=
auty
.
TicketX
)
// Init 重命名执行器名称
...
...
@@ -30,6 +31,7 @@ func Init(name string, cfg *types.Chain33Config, sub []byte) {
types
.
MustDecode
(
sub
,
&
subcfg
)
}
autonomyAddr
=
address
.
ExecAddress
(
cfg
.
ExecName
(
auty
.
AutonomyX
))
ticketName
=
cfg
.
ExecName
(
auty
.
TicketX
)
drivers
.
Register
(
cfg
,
GetName
(),
newAutonomy
,
cfg
.
GetDappFork
(
driverName
,
"Enable"
))
InitExecType
()
}
...
...
plugin/dapp/autonomy/executor/boardaction.go
View file @
233bd4d3
...
...
@@ -457,7 +457,7 @@ func (a *action) batchGetAddressVotes(addrs []string, height int64) (int32, erro
}
func
(
a
*
action
)
getAddressVotes
(
addr
string
,
height
int64
)
(
int32
,
error
)
{
account
,
err
:=
a
.
getStartHeightVoteAccount
(
addr
,
auty
.
TicketX
,
height
)
account
,
err
:=
a
.
getStartHeightVoteAccount
(
addr
,
ticketName
,
height
)
if
err
!=
nil
{
return
0
,
err
}
...
...
plugin/dapp/paracross/cmd/build/testcase.sh
View file @
233bd4d3
...
...
@@ -61,7 +61,9 @@ function para_set_toml() {
"1GCzJDS6HbgTQ2emade7mEJGGWFfA15pS9",\
"1JYB8sxi4He5pZWHCd3Zi2nypQ4JMB6AxN",\
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv",]/g'
"
${
1
}
"
#autonomy
sed
-i
$xsedfix
's/^useBalance=.*/useBalance=true/g'
"
${
1
}
"
sed
-i
$xsedfix
's/^total="16htvcBNS.*/total="1EZrEKPPC36SLRoLQBwLDjzcheiLRZJg49"/g'
"
${
1
}
"
}
function
para_set_wallet
()
{
...
...
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