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
196101f2
Commit
196101f2
authored
May 15, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
3c24fab3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
testcase.sh
plugin/dapp/relay/cmd/build/testcase.sh
+4
-4
test-rpc.sh
plugin/dapp/relay/cmd/test/test-rpc.sh
+1
-1
No files found.
plugin/dapp/relay/cmd/build/testcase.sh
View file @
196101f2
...
@@ -234,10 +234,10 @@ function relay_test() {
...
@@ -234,10 +234,10 @@ function relay_test() {
fi
fi
echo
"=========== # accept buy order ============="
echo
"=========== # accept buy order ============="
buy_hash
=
$(${
1
}
send relay accept
-o
"
${
buy_id
}
"
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
buy_hash
=
$(${
1
}
send relay accept
-o
"
${
buy_id
}
"
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
echo
"
${
buy_hash
}
"
echo
"
${
buy_hash
}
"
echo
"=========== # accept real buy order ============="
echo
"=========== # accept real buy order ============="
realbuy_hash
=
$(${
1
}
send relay accept
-o
"
${
realbuy_id
}
"
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-k
"
${
real_buy_addr
}
"
)
realbuy_hash
=
$(${
1
}
send relay accept
-o
"
${
realbuy_id
}
"
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-k
"
${
real_buy_addr
}
"
)
echo
"
${
realbuy_hash
}
"
echo
"
${
realbuy_hash
}
"
echo
"=========== # accept sell order ============="
echo
"=========== # accept sell order ============="
sell_hash
=
$(${
1
}
send relay accept
-o
"
${
sell_id
}
"
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
sell_hash
=
$(${
1
}
send relay accept
-o
"
${
sell_id
}
"
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
...
@@ -294,7 +294,7 @@ function relay_test() {
...
@@ -294,7 +294,7 @@ function relay_test() {
wait_btc_height
"
${
1
}
"
$((
acceptHeight
+
72
))
wait_btc_height
"
${
1
}
"
$((
acceptHeight
+
72
))
revoke_hash
=
$(${
1
}
send relay revoke
-a
0
-t
1
-i
"
${
buy_id
}
"
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
revoke_hash
=
$(${
1
}
send relay revoke
-a
0
-t
1
-i
"
${
buy_id
}
"
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
echo
"
${
revoke_hash
}
"
echo
"
${
revoke_hash
}
"
echo
"=========== # confirm real buy order ============="
echo
"=========== # confirm real buy order ============="
confirm_hash
=
$(${
1
}
send relay confirm
-t
"
${
btc_tx_hash
}
"
-o
"
${
realbuy_id
}
"
-k
"
${
real_buy_addr
}
"
)
confirm_hash
=
$(${
1
}
send relay confirm
-t
"
${
btc_tx_hash
}
"
-o
"
${
realbuy_id
}
"
-k
"
${
real_buy_addr
}
"
)
...
@@ -338,7 +338,7 @@ function relay_test() {
...
@@ -338,7 +338,7 @@ function relay_test() {
wait_btc_height
"
${
1
}
"
$((
confirmHeight
+
288
))
wait_btc_height
"
${
1
}
"
$((
confirmHeight
+
288
))
revoke_hash
=
$(${
1
}
send relay revoke
-a
0
-t
0
-i
"
${
sell_id
}
"
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
revoke_hash
=
$(${
1
}
send relay revoke
-a
0
-t
0
-i
"
${
sell_id
}
"
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
echo
"
${
revoke_hash
}
"
echo
"
${
revoke_hash
}
"
echo
"=========== # test cancel create order ==="
echo
"=========== # test cancel create order ==="
cancel_hash
=
$(${
1
}
send relay create
-m
2.99
-o
0
-c
BTC
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-b
200
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
cancel_hash
=
$(${
1
}
send relay create
-m
2.99
-o
0
-c
BTC
-a
1Am9UTGfdnxabvcywYG2hvzr6qK8T3oUZT
-b
200
-k
14KEKbYtKKQm4wMthSK9J4La4nAiidGozt
)
...
...
plugin/dapp/relay/cmd/test/test-rpc.sh
View file @
196101f2
...
@@ -84,7 +84,7 @@ chain33_ImportPrivkey() {
...
@@ -84,7 +84,7 @@ chain33_ImportPrivkey() {
local
req
=
'"method":"Chain33.ImportPrivkey", "params":[{"privkey":"'
"
$pri
"
'", "label":"relayimportkey1"}]'
local
req
=
'"method":"Chain33.ImportPrivkey", "params":[{"privkey":"'
"
$pri
"
'", "label":"relayimportkey1"}]'
echo
"#request:
$req
"
echo
"#request:
$req
"
resp
=
$(
curl
-ksd
"{
$req
}"
"
$1
"
)
resp
=
$(
curl
-ksd
"{
$req
}"
"
$1
"
)
echo
"#response:
$resp
"
echo
"#response:
$resp
"
ok
=
$(
jq
'(.error|not) and (.result.label=="relayimportkey1") and (.result.acc.addr == "'
"
$acc
"
'")'
<<<
"
$resp
"
)
ok
=
$(
jq
'(.error|not) and (.result.label=="relayimportkey1") and (.result.acc.addr == "'
"
$acc
"
'")'
<<<
"
$resp
"
)
[
"
$ok
"
==
true
]
[
"
$ok
"
==
true
]
echo_rst
"
$FUNCNAME
"
"
$?
"
echo_rst
"
$FUNCNAME
"
"
$?
"
...
...
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