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
c638029a
Commit
c638029a
authored
Sep 22, 2019
by
pengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#484 update rpc_test trade
parent
7d45dae0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
8 deletions
+30
-8
test-rpc.sh
plugin/dapp/lottery/cmd/build/test-rpc.sh
+2
-2
test-rpc.sh
plugin/dapp/trade/cmd/build/test-rpc.sh
+28
-6
No files found.
plugin/dapp/lottery/cmd/build/test-rpc.sh
View file @
c638029a
...
...
@@ -18,8 +18,8 @@ gID=""
lottExecAddr
=
""
luckyNumber
=
""
purNum
=
1
00
drawNum
=
11
0
purNum
=
2
00
drawNum
=
22
0
opRatio
=
5
devRatio
=
5
...
...
plugin/dapp/trade/cmd/build/test-rpc.sh
View file @
c638029a
...
...
@@ -8,7 +8,7 @@ MAIN_HTTP=""
CASE_ERR
=
""
trade_addr
=
""
tradeAddr
=
"12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
tradeBuyerAddr
=
"1
4KEKbYtKKQm4wMthSK9J4La4nAiidGozt
"
tradeBuyerAddr
=
"1
CvLe1qNaC7tCf5xmfAqJ9UJkMhtmhUKNg
"
tokenSymbol
=
"TOKEN"
#color
...
...
@@ -132,7 +132,7 @@ function trade_createBuyTx() {
return
fi
chain33_SignRawTx
"
${
unsignedTx
}
"
"0x
CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944
"
"
${
MAIN_HTTP
}
"
chain33_SignRawTx
"
${
unsignedTx
}
"
"0x
0xaeef1ad76d43a2056d0dcb57d5bf1ba96471550614ab9e7f611ef9c5ca403f42
"
"
${
MAIN_HTTP
}
"
queryTransaction
".error | not"
"true"
echo_rst
"trade createBuyTx queryExecRes"
"
$?
"
...
...
@@ -200,7 +200,7 @@ function trade_buyLimit() {
return
fi
chain33_SignRawTx
"
${
unsignedTx
}
"
"
CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944
"
"
${
MAIN_HTTP
}
"
chain33_SignRawTx
"
${
unsignedTx
}
"
"
0xaeef1ad76d43a2056d0dcb57d5bf1ba96471550614ab9e7f611ef9c5ca403f42
"
"
${
MAIN_HTTP
}
"
queryTransaction
".error | not"
"true"
echo_rst
"trade buyLimit queryExecRes"
"
$?
"
...
...
@@ -278,7 +278,29 @@ function init() {
token_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"'
"
${
tokenExecName
}
"
'"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
fi
chain33_SendToAddress
"
$tradeAddr
"
"
$tradeBuyerAddr
"
10000000000
"
${
MAIN_HTTP
}
"
local
main_ip
=
${
MAIN_HTTP
//8901/8801
}
#main chain import pri key
#1CvLe1qNaC7tCf5xmfAqJ9UJkMhtmhUKNg
chain33_ImportPrivkey
"0xaeef1ad76d43a2056d0dcb57d5bf1ba96471550614ab9e7f611ef9c5ca403f42"
"1CvLe1qNaC7tCf5xmfAqJ9UJkMhtmhUKNg"
"trade1"
"
${
main_ip
}
"
local
ACCOUNT_A
=
"1CvLe1qNaC7tCf5xmfAqJ9UJkMhtmhUKNg"
if
[
"
$ispara
"
==
false
]
;
then
chain33_applyCoins
"
$ACCOUNT_A
"
12000000000
"
${
main_ip
}
"
chain33_QueryBalance
"
${
ACCOUNT_A
}
"
"
$main_ip
"
else
# tx fee
chain33_applyCoins
"
$ACCOUNT_A
"
1000000000
"
${
main_ip
}
"
chain33_QueryBalance
"
${
ACCOUNT_A
}
"
"
$main_ip
"
local
para_ip
=
"
${
MAIN_HTTP
}
"
#para chain import pri key
chain33_ImportPrivkey
"0xaeef1ad76d43a2056d0dcb57d5bf1ba96471550614ab9e7f611ef9c5ca403f42"
"1CvLe1qNaC7tCf5xmfAqJ9UJkMhtmhUKNg"
"trade1"
"
$para_ip
"
chain33_applyCoins
"
$ACCOUNT_A
"
12000000000
"
${
para_ip
}
"
chain33_QueryBalance
"
${
ACCOUNT_A
}
"
"
$para_ip
"
fi
chain33_SendToAddress
"
$tradeAddr
"
"
$trade_addr
"
10000000000
"
${
MAIN_HTTP
}
"
chain33_SendToAddress
"
$tradeAddr
"
"
$token_addr
"
10000000000
"
${
MAIN_HTTP
}
"
chain33_BlockWait 2
"
${
MAIN_HTTP
}
"
...
...
@@ -293,7 +315,7 @@ function init() {
token_balance
token_transfer
"
${
tradeBuyerAddr
}
"
token_sendExec
"0x4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c721ced01"
token_sendExec
"
CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944
"
token_sendExec
"
0xaeef1ad76d43a2056d0dcb57d5bf1ba96471550614ab9e7f611ef9c5ca403f42
"
}
function
run_test
()
{
...
...
@@ -303,7 +325,7 @@ function run_test() {
trade_getSellOrder
trade_createBuyTx
trade_getBuyOrder
trade_statusBuyOrder
#
trade_statusBuyOrder
trade_statusOrder
trade_statusSellOrder
...
...
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