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
10722274
Commit
10722274
authored
Sep 18, 2019
by
pengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#484 update rpc_test
parent
3b210386
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
38 deletions
+28
-38
test-rpc.sh
plugin/dapp/evm/cmd/build/test-rpc.sh
+25
-0
test-rpc.sh
plugin/dapp/retrieve/cmd/build/test-rpc.sh
+2
-2
test-rpc.sh
plugin/dapp/token/cmd/build/test-rpc.sh
+1
-36
No files found.
plugin/dapp/evm/cmd/build/test-rpc.sh
View file @
10722274
...
@@ -270,6 +270,31 @@ function queryTransaction() {
...
@@ -270,6 +270,31 @@ function queryTransaction() {
function
init
()
{
function
init
()
{
ispara
=
$(
echo
'"'
"
${
MAIN_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
ispara
=
$(
echo
'"'
"
${
MAIN_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
echo
"ipara=
$ispara
"
echo
"ipara=
$ispara
"
local
main_ip
=
${
MAIN_HTTP
//8901/8801
}
#main chain import pri key
#1PTXh2EZ8aRUzpuoDRASV19K86Kx3qQiPt
chain33_ImportPrivkey
"0x4947ce3c4b845cfed59be2edf47320546116a3ff3af5715a7df094d116039b89"
"1PTXh2EZ8aRUzpuoDRASV19K86Kx3qQiPt"
"evm"
"
${
main_ip
}
"
local
ACCOUNT_A
=
"1PTXh2EZ8aRUzpuoDRASV19K86Kx3qQiPt"
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
"0x4947ce3c4b845cfed59be2edf47320546116a3ff3af5715a7df094d116039b89"
"1PTXh2EZ8aRUzpuoDRASV19K86Kx3qQiPt"
"evm"
"
$para_ip
"
chain33_applyCoins
"
$ACCOUNT_A
"
12000000000
"
${
para_ip
}
"
chain33_QueryBalance
"
${
ACCOUNT_A
}
"
"
$para_ip
"
fi
Chain33_SendToAddress
"
$ACCOUNT_A
"
"
$from
"
11000000000
from
=
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
from
=
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt"
local
evm_addr
=
""
local
evm_addr
=
""
if
[
"
$ispara
"
==
"true"
]
;
then
if
[
"
$ispara
"
==
"true"
]
;
then
...
...
plugin/dapp/retrieve/cmd/build/test-rpc.sh
View file @
10722274
...
@@ -110,7 +110,7 @@ init() {
...
@@ -110,7 +110,7 @@ init() {
local
main_ip
=
${
MAIN_HTTP
//8901/8801
}
local
main_ip
=
${
MAIN_HTTP
//8901/8801
}
#main chain import pri key
#main chain import pri key
#1PdaXiQU994gzh4RcjLir2AbyqcQ3TwnBL
#1PdaXiQU994gzh4RcjLir2AbyqcQ3TwnBL
chain33_ImportPrivkey
"0x
0316d5e33e7bce2455413156cb95209f8c641af352ee5d648c647f24383e4d94
"
"1PdaXiQU994gzh4RcjLir2AbyqcQ3TwnBL"
"retrieve1"
"
${
main_ip
}
"
chain33_ImportPrivkey
"0x
3665fa66d1a17d2fc319a45250c8c8b9302ae0c393c2e39f2ef3b2f6bc40a42d
"
"1PdaXiQU994gzh4RcjLir2AbyqcQ3TwnBL"
"retrieve1"
"
${
main_ip
}
"
#13t1hnMNHqQ5K4QPeqq5xmdg2kTbDPtrgx
#13t1hnMNHqQ5K4QPeqq5xmdg2kTbDPtrgx
chain33_ImportPrivkey
"0xed8a078ee44eac473bd1d5c971e231c255badf7f0c2fbdbe31ef34669c441d6f"
"13t1hnMNHqQ5K4QPeqq5xmdg2kTbDPtrgx"
"retrieve2"
"
$main_ip
"
chain33_ImportPrivkey
"0xed8a078ee44eac473bd1d5c971e231c255badf7f0c2fbdbe31ef34669c441d6f"
"13t1hnMNHqQ5K4QPeqq5xmdg2kTbDPtrgx"
"retrieve2"
"
$main_ip
"
...
@@ -132,7 +132,7 @@ init() {
...
@@ -132,7 +132,7 @@ init() {
chain33_QueryBalance
"
${
retrieve2
}
"
"
$main_ip
"
chain33_QueryBalance
"
${
retrieve2
}
"
"
$main_ip
"
local
para_ip
=
"
${
MAIN_HTTP
}
"
local
para_ip
=
"
${
MAIN_HTTP
}
"
#para chain import pri key
#para chain import pri key
chain33_ImportPrivkey
"0x
0316d5e33e7bce2455413156cb95209f8c641af352ee5d648c647f24383e4d94
"
"1PdaXiQU994gzh4RcjLir2AbyqcQ3TwnBL"
"retrieve1"
"
$para_ip
"
chain33_ImportPrivkey
"0x
3665fa66d1a17d2fc319a45250c8c8b9302ae0c393c2e39f2ef3b2f6bc40a42d
"
"1PdaXiQU994gzh4RcjLir2AbyqcQ3TwnBL"
"retrieve1"
"
$para_ip
"
chain33_ImportPrivkey
"0xed8a078ee44eac473bd1d5c971e231c255badf7f0c2fbdbe31ef34669c441d6f"
"13t1hnMNHqQ5K4QPeqq5xmdg2kTbDPtrgx"
"retrieve2"
"
$para_ip
"
chain33_ImportPrivkey
"0xed8a078ee44eac473bd1d5c971e231c255badf7f0c2fbdbe31ef34669c441d6f"
"13t1hnMNHqQ5K4QPeqq5xmdg2kTbDPtrgx"
"retrieve2"
"
$para_ip
"
chain33_applyCoins
"
$retrieve1
"
12000000000
"
${
para_ip
}
"
chain33_applyCoins
"
$retrieve1
"
12000000000
"
${
para_ip
}
"
...
...
plugin/dapp/token/cmd/build/test-rpc.sh
View file @
10722274
...
@@ -6,9 +6,7 @@ source ../dapp-test-common.sh
...
@@ -6,9 +6,7 @@ source ../dapp-test-common.sh
MAIN_HTTP
=
""
MAIN_HTTP
=
""
CASE_ERR
=
""
CASE_ERR
=
""
tokenAddr
=
"1Q8hGLfoGe63efeWa8fJ4Pnukhkngt6poK"
tokenAddr
=
"1CLrYLNhHfCfMUV7mtdqhbMSF6vGmtTvzq"
recvAddr
=
"1CLrYLNhHfCfMUV7mtdqhbMSF6vGmtTvzq"
superManager
=
"0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc"
tokenSymbol
=
"ABCDE"
tokenSymbol
=
"ABCDE"
token_addr
=
""
token_addr
=
""
execName
=
"token"
execName
=
"token"
...
@@ -28,34 +26,6 @@ function echo_rst() {
...
@@ -28,34 +26,6 @@ function echo_rst() {
fi
fi
}
}
function
chain33_ImportPrivkey
()
{
local
pri
=
$2
local
acc
=
$3
local
req
=
'"method":"Chain33.ImportPrivkey", "params":[{"privkey":"'
"
$pri
"
'", "label":"tokenAddr"}]'
echo
"#request:
$req
"
resp
=
$(
curl
-ksd
"{
$req
}"
"
$1
"
)
echo
"#response:
$resp
"
ok
=
$(
jq
'(.error|not) and (.result.label=="tokenAddr") and (.result.acc.addr == "'
"
$acc
"
'")'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
}
function
Chain33_SendToAddress
()
{
local
from
=
"
$1
"
local
to
=
"
$2
"
local
amount
=
$3
local
req
=
'"method":"Chain33.SendToAddress", "params":[{"from":"'
"
$from
"
'","to":"'
"
$to
"
'", "amount":'
"
$amount
"
', "note":"test\n"}]'
# echo "#request: $req"
resp
=
$(
curl
-ksd
"{
$req
}"
"
${
MAIN_HTTP
}
"
)
# echo "#response: $resp"
ok
=
$(
jq
'(.error|not) and (.result.hash|length==66)'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
hash
=
$(
jq
'(.result.hash)'
<<<
"
$resp
"
)
echo
"hash=
$hash
"
# query_tx "$hash"
}
function
chain33_unlock
()
{
function
chain33_unlock
()
{
ok
=
$(
curl
-k
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result.isOK"
)
ok
=
$(
curl
-k
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.UnLock","params":[{"passwd":"1314fuzamei","timeout":0}]}'
-H
'content-type:text/plain;'
${
MAIN_HTTP
}
| jq
-r
".result.isOK"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
...
@@ -116,7 +86,6 @@ function queryTransaction() {
...
@@ -116,7 +86,6 @@ function queryTransaction() {
function
init
()
{
function
init
()
{
ispara
=
$(
echo
'"'
"
${
MAIN_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
ispara
=
$(
echo
'"'
"
${
MAIN_HTTP
}
"
'"'
| jq
'.|contains("8901")'
)
echo
"ipara=
$ispara
"
echo
"ipara=
$ispara
"
chain33_ImportPrivkey
"
${
MAIN_HTTP
}
"
"
${
superManager
}
"
"
${
tokenAddr
}
"
local
main_ip
=
${
MAIN_HTTP
//8901/8801
}
local
main_ip
=
${
MAIN_HTTP
//8901/8801
}
#main chain import pri key
#main chain import pri key
...
@@ -142,14 +111,10 @@ function init() {
...
@@ -142,14 +111,10 @@ function init() {
if
[
"
$ispara
"
==
true
]
;
then
if
[
"
$ispara
"
==
true
]
;
then
execName
=
"user.p.para.token"
execName
=
"user.p.para.token"
token_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.token"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
token_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"user.p.para.token"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
Chain33_SendToAddress
"
$recvAddr
"
"
$tokenAddr
"
100000000000
block_wait 2
Chain33_SendToAddress
"
$tokenAddr
"
"
$token_addr
"
1000000000
Chain33_SendToAddress
"
$tokenAddr
"
"
$token_addr
"
1000000000
block_wait 2
block_wait 2
else
else
token_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"token"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
token_addr
=
$(
curl
-ksd
'{"method":"Chain33.ConvertExectoAddr","params":[{"execname":"token"}]}'
${
MAIN_HTTP
}
| jq
-r
".result"
)
Chain33_SendToAddress
"
$recvAddr
"
"
$tokenAddr
"
10000000000
block_wait 2
Chain33_SendToAddress
"
$tokenAddr
"
"
$token_addr
"
1000000000
Chain33_SendToAddress
"
$tokenAddr
"
"
$token_addr
"
1000000000
block_wait 2
block_wait 2
fi
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