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
c09fc0ee
Commit
c09fc0ee
authored
May 29, 2019
by
lyn
Committed by
vipwzw
May 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update linter
parent
098d0214
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
71 deletions
+18
-71
test-rpc.sh
plugin/dapp/token/cmd/build/test-rpc.sh
+18
-71
No files found.
plugin/dapp/token/cmd/build/test-rpc.sh
View file @
c09fc0ee
...
@@ -254,26 +254,15 @@ function token_burn() {
...
@@ -254,26 +254,15 @@ function token_burn() {
fi
fi
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
if
[
$?
-ne
0
]
;
then
echo_rst
"token burn signRawTx"
"
$?
"
rst
=
$?
echo_rst
"token burn signRawTx"
"
$rst
"
return
fi
sendSignedTx
sendSignedTx
if
[
$?
-ne
0
]
;
then
echo_rst
"token burn sendSignedTx"
"
$?
"
rst
=
$?
echo_rst
"token burn sendSignedTx"
"
$rst
"
return
fi
block_wait 1
block_wait 1
queryTransaction
".error | not"
"true"
queryTransaction
".error | not"
"true"
if
[
$?
-ne
0
]
;
then
echo_rst
"token burn queryExecRes"
"
$?
"
rst
=
$?
echo_rst
"token burn queryExecRes"
"
$rst
"
fi
}
}
function
token_mint
()
{
function
token_mint
()
{
...
@@ -284,26 +273,15 @@ function token_mint() {
...
@@ -284,26 +273,15 @@ function token_mint() {
fi
fi
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
if
[
$?
-ne
0
]
;
then
echo_rst
"token mint signRawTx"
"
$?
"
rst
=
$?
echo_rst
"token mint signRawTx"
"
$rst
"
return
fi
sendSignedTx
sendSignedTx
if
[
$?
-ne
0
]
;
then
echo_rst
"token mint sendSignedTx"
"
$?
"
rst
=
$?
echo_rst
"token mint sendSignedTx"
"
$rst
"
return
fi
block_wait 1
block_wait 1
queryTransaction
".error | not"
"true"
queryTransaction
".error | not"
"true"
if
[
$?
-ne
0
]
;
then
echo_rst
"token mint queryExecRes"
"
$?
"
rst
=
$?
echo_rst
"token mint queryExecRes"
"
$rst
"
fi
}
}
function
token_transfer
()
{
function
token_transfer
()
{
unsignedTx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "'
"
${
execName
}
"
'","actionName":"Transfer","payload": {"cointoken":"'
"
${
tokenSymbol
}
"
'", "amount": "1000000000", "note": "", "to": "'
"
${
recvAddr
}
"
'"}}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result"
)
unsignedTx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "'
"
${
execName
}
"
'","actionName":"Transfer","payload": {"cointoken":"'
"
${
tokenSymbol
}
"
'", "amount": "1000000000", "note": "", "to": "'
"
${
recvAddr
}
"
'"}}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result"
)
...
@@ -313,26 +291,15 @@ function token_transfer() {
...
@@ -313,26 +291,15 @@ function token_transfer() {
fi
fi
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
if
[
$?
-ne
0
]
;
then
echo_rst
"token transfer signRawTx"
"
$?
"
rst
=
$?
echo_rst
"token transfer signRawTx"
"
$rst
"
return
fi
sendSignedTx
sendSignedTx
if
[
$?
-ne
0
]
;
then
echo_rst
"token transfer sendSignedTx"
"
$?
"
rst
=
$?
echo_rst
"token transfer sendSignedTx"
"
$rst
"
return
fi
block_wait 1
block_wait 1
queryTransaction
".error | not"
"true"
queryTransaction
".error | not"
"true"
if
[
$?
-ne
0
]
;
then
echo_rst
"token transfer queryExecRes"
"
$?
"
rst
=
$?
echo_rst
"token transfer queryExecRes"
"
$rst
"
fi
}
}
function
token_sendExec
()
{
function
token_sendExec
()
{
...
@@ -343,28 +310,18 @@ function token_sendExec() {
...
@@ -343,28 +310,18 @@ function token_sendExec() {
fi
fi
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
if
[
$?
-ne
0
]
;
then
echo_rst
"token sendExec signRawTx"
"
$?
"
rst
=
$?
echo_rst
"token sendExec signRawTx"
"
$rst
"
return
fi
sendSignedTx
sendSignedTx
if
[
$?
-ne
0
]
;
then
echo_rst
"token sendExec sendSignedTx"
"
$?
"
rst
=
$?
echo_rst
"token sendExec sendSignedTx"
"
$rst
"
return
fi
block_wait 1
block_wait 1
queryTransaction
".error | not"
"true"
queryTransaction
".error | not"
"true"
if
[
$?
-ne
0
]
;
then
echo_rst
"token sendExec queryExecRes"
"
$?
"
rst
=
$?
echo_rst
"token sendExec queryExecRes"
"
$rst
"
fi
}
}
function
token_withdraw
()
{
function
token_withdraw
()
{
unsignedTx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "'
"
${
execName
}
"
'","actionName":"Withdraw","payload": {"cointoken":"'
"
${
tokenSymbol
}
"
'", "amount": "10", "note": "", "to": "'
"
${
token_addr
}
"
'", "execName": "'
"
${
execName
}
"
'"}}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result"
)
unsignedTx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer": "'
"
${
execName
}
"
'","actionName":"Withdraw","payload": {"cointoken":"'
"
${
tokenSymbol
}
"
'", "amount": "10", "note": "", "to": "'
"
${
token_addr
}
"
'", "execName": "'
"
${
execName
}
"
'"}}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result"
)
if
[
"
${
unsignedTx
}
"
==
""
]
;
then
if
[
"
${
unsignedTx
}
"
==
""
]
;
then
...
@@ -373,26 +330,15 @@ function token_withdraw() {
...
@@ -373,26 +330,15 @@ function token_withdraw() {
fi
fi
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
signRawTx
"
${
unsignedTx
}
"
"
${
tokenAddr
}
"
if
[
$?
-ne
0
]
;
then
echo_rst
"token withdraw signRawTx"
"
$?
"
rst
=
$?
echo_rst
"token withdraw signRawTx"
"
$rst
"
return
fi
sendSignedTx
sendSignedTx
if
[
$?
-ne
0
]
;
then
echo_rst
"token withdraw sendSignedTx"
"
$?
"
rst
=
$?
echo_rst
"token withdraw sendSignedTx"
"
$rst
"
return
fi
block_wait 1
block_wait 1
queryTransaction
".error | not"
"true"
queryTransaction
".error | not"
"true"
if
[
$?
-ne
0
]
;
then
echo_rst
"token withdraw queryExecRes"
"
$?
"
rst
=
$?
echo_rst
"token withdraw queryExecRes"
"
$rst
"
fi
}
}
function
run_test
()
{
function
run_test
()
{
...
@@ -429,4 +375,4 @@ function main() {
...
@@ -429,4 +375,4 @@ function main() {
fi
fi
}
}
main
"
$1
"
main
"
$1
"
\ No newline at end of file
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