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
b3e4a93e
Commit
b3e4a93e
authored
Sep 03, 2019
by
linj
Committed by
vipwzw
Sep 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test
parent
56a6b283
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
test-rpc.sh
plugin/dapp/trade/cmd/build/test-rpc.sh
+4
-2
No files found.
plugin/dapp/trade/cmd/build/test-rpc.sh
View file @
b3e4a93e
...
...
@@ -102,7 +102,7 @@ function token_sendExec() {
}
function
trade_createSellTx
()
{
unsignedTx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"trade.CreateRawTradeSellTx","params":[{"tokenSymbol": "'
"
${
tokenSymbol
}
"
'", "amountPerBoardlot": 1000000, "minBoardlot": 1, "pricePerBoardlot": 100000000,"totalBoardlot":100, "fee": 10000000, "assetExec":"token"}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result"
)
unsignedTx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"trade.CreateRawTradeSellTx","params":[{"tokenSymbol": "'
"
${
tokenSymbol
}
"
'", "amountPerBoardlot": 1000000, "minBoardlot": 1, "pricePerBoardlot": 100000000,"totalBoardlot":100, "fee": 10000000, "assetExec":"token"
, "priceExec" : "coins", "priceSymbol" : "'
"
${
coinSymbol
}
"
'"
}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result"
)
if
[
"
${
unsignedTx
}
"
==
""
]
;
then
echo_rst
"trade createSellTx create tx"
1
return
...
...
@@ -194,7 +194,7 @@ function trade_statusTokenSellOrder() {
}
function
trade_buyLimit
()
{
res
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"trade.CreateRawTradeBuyLimitTx","params":[{"tokenSymbol":"'
"
${
tokenSymbol
}
"
'","amountPerBoardlot":1000000,"minBoardlot":1, "pricePerBoardlot":100000, "totalBoardlot":200, "fee": 1, "assetExec":"'
"
${
tokenExecName
}
"
'"}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".error | not"
)
res
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"trade.CreateRawTradeBuyLimitTx","params":[{"tokenSymbol":"'
"
${
tokenSymbol
}
"
'","amountPerBoardlot":1000000,"minBoardlot":1, "pricePerBoardlot":100000, "totalBoardlot":200, "fee": 1, "assetExec":"'
"
${
tokenExecName
}
"
'"
, "priceExec" : "coins", "priceSymbol" : "'
"
${
coinSymbol
}
"
'"
}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".error | not"
)
if
[
"
${
unsignedTx
}
"
==
""
]
;
then
echo_rst
"trade buyLimit create tx"
1
return
...
...
@@ -267,11 +267,13 @@ function init() {
tradeExecName
=
"trade"
local
trade_addr
=
""
if
[
"
$ispara
"
==
"true"
]
;
then
coinSymbol
=
"para"
tokenExecName
=
"user.p.para.token"
tradeExecName
=
"user.p.para.trade"
trade_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"'
"
${
tradeExecName
}
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
token_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"'
"
${
tokenExecName
}
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
else
coinSymbol
=
"bty"
trade_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"'
"
${
tradeExecName
}
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
token_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"'
"
${
tokenExecName
}
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
fi
...
...
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