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
2f116650
Commit
2f116650
authored
Dec 24, 2021
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up shell
parent
0728e1aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
37 deletions
+37
-37
dockerRelayerTest.sh
plugin/dapp/cross2eth/cmd/build/dockerRelayerTest.sh
+37
-37
No files found.
plugin/dapp/cross2eth/cmd/build/dockerRelayerTest.sh
View file @
2f116650
...
@@ -46,7 +46,7 @@ function TestETH2Chain33Assets_proxy() {
...
@@ -46,7 +46,7 @@ function TestETH2Chain33Assets_proxy() {
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethBridgeBankBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
| jq
-r
".balance"
)
ethBridgeBankBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
...
@@ -57,14 +57,14 @@ function TestETH2Chain33Assets_proxy() {
...
@@ -57,14 +57,14 @@ function TestETH2Chain33Assets_proxy() {
echo
-e
"
${
IYellow
}
lock
${
NOC
}
"
echo
-e
"
${
IYellow
}
lock
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
result
=
$(${
CLI
A
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
# eth 等待 2 个区块
sleep
4
sleep
4
echo
-e
"
${
IYellow
}
ethBridgeBank lock 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethBridgeBank lock 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
# shellcheck disable=SC2219
# shellcheck disable=SC2219
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
...
@@ -86,21 +86,21 @@ function TestETH2Chain33Assets_proxy() {
...
@@ -86,21 +86,21 @@ function TestETH2Chain33Assets_proxy() {
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethT2Balancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
ethT2Balancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethPBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
ethPBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
result
=
$(${
CLI
A
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
result
=
$(${
CLI
P
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"withdraw"
cli_ret
"
${
result
}
"
"withdraw"
sleep
"
${
maturityDegree
}
"
sleep
"
${
maturityDegree
}
"
# 查询 ETH 这端 bridgeBank 地址 0
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
...
@@ -114,13 +114,13 @@ function TestETH2Chain33Assets_proxy() {
...
@@ -114,13 +114,13 @@ function TestETH2Chain33Assets_proxy() {
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
# shellcheck disable=SC2219
# shellcheck disable=SC2219
let
ethT2BalanceEnd
=
${
ethT2Balancebf
}
+
${
lockAmount1
}
-1
let
ethT2BalanceEnd
=
${
ethT2Balancebf
}
+
${
lockAmount1
}
-1
is_equal
"
${
result
}
"
"
${
ethT2BalanceEnd
}
"
is_equal
"
${
result
}
"
"
${
ethT2BalanceEnd
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
if
[[
$(
echo
"
${
ethPBalancebf
}
-
${
lockAmount1
}
+1 <
$result
"
| bc
)
]]
;
then
if
[[
$(
echo
"
${
ethPBalancebf
}
-
${
lockAmount1
}
+1 <
$result
"
| bc
)
]]
;
then
echo
-e
"
${
RED
}
error
$ethPBalanceEnd
小于
$result
, 应该大于
$ethPBalanceEnd
扣了一点点手续费
${
NOC
}
"
echo
-e
"
${
RED
}
error
$ethPBalanceEnd
小于
$result
, 应该大于
$ethPBalanceEnd
扣了一点点手续费
${
NOC
}
"
...
@@ -140,7 +140,7 @@ function TestETH2Chain33Assets_proxy_excess() {
...
@@ -140,7 +140,7 @@ function TestETH2Chain33Assets_proxy_excess() {
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethBridgeBankBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
| jq
-r
".balance"
)
ethBridgeBankBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
...
@@ -151,14 +151,14 @@ function TestETH2Chain33Assets_proxy_excess() {
...
@@ -151,14 +151,14 @@ function TestETH2Chain33Assets_proxy_excess() {
echo
-e
"
${
IYellow
}
lock
${
NOC
}
"
echo
-e
"
${
IYellow
}
lock
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
result
=
$(${
CLI
A
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
# eth 等待 2 个区块
sleep
4
sleep
4
echo
-e
"
${
IYellow
}
ethBridgeBank lock 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethBridgeBank lock 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
# shellcheck disable=SC2219
# shellcheck disable=SC2219
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
...
@@ -180,21 +180,21 @@ function TestETH2Chain33Assets_proxy_excess() {
...
@@ -180,21 +180,21 @@ function TestETH2Chain33Assets_proxy_excess() {
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethT2Balancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
ethT2Balancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethPBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
ethPBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
result
=
$(${
CLI
A
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
result
=
$(${
CLI
P
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"withdraw"
cli_ret
"
${
result
}
"
"withdraw"
sleep
"
${
maturityDegree
}
"
sleep
"
${
maturityDegree
}
"
# 查询 ETH 这端 bridgeBank 地址 0
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
...
@@ -208,11 +208,11 @@ function TestETH2Chain33Assets_proxy_excess() {
...
@@ -208,11 +208,11 @@ function TestETH2Chain33Assets_proxy_excess() {
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
| jq
-r
".balance"
)
is_equal
"
${
result
}
"
"
${
ethT2Balancebf
}
"
is_equal
"
${
result
}
"
"
${
ethT2Balancebf
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
| jq
-r
".balance"
)
is_equal
"
${
result
}
"
"
${
ethPBalancebf
}
"
is_equal
"
${
result
}
"
"
${
ethPBalancebf
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
...
@@ -227,7 +227,7 @@ function TestETH2Chain33USDT_proxy() {
...
@@ -227,7 +227,7 @@ function TestETH2Chain33USDT_proxy() {
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethBridgeBankBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
ethBridgeBankBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
...
@@ -237,14 +237,14 @@ function TestETH2Chain33USDT_proxy() {
...
@@ -237,14 +237,14 @@ function TestETH2Chain33USDT_proxy() {
chain33VspBalancebf
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33Validatorsp
}
)"
)
chain33VspBalancebf
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33Validatorsp
}
)"
)
echo
-e
"
${
IYellow
}
ETH 这端 lock
$lockAmount1
个 USDT
${
NOC
}
"
echo
-e
"
${
IYellow
}
ETH 这端 lock
$lockAmount1
个 USDT
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
# eth 等待 2 个区块
sleep
4
sleep
4
echo
-e
"
${
IYellow
}
查询 ETH 这端 ethBridgeBank lock 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
查询 ETH 这端 ethBridgeBank lock 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
# shellcheck disable=SC2219
# shellcheck disable=SC2219
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
...
@@ -265,20 +265,20 @@ function TestETH2Chain33USDT_proxy() {
...
@@ -265,20 +265,20 @@ function TestETH2Chain33USDT_proxy() {
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethT2Balancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
ethT2Balancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethPBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
ethPBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
result
=
$(${
CLI
A
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USDTBridgeTokenAddr
}
"
)
result
=
$(${
CLI
P
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USDTBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"withdraw"
cli_ret
"
${
result
}
"
"withdraw"
sleep
"
${
maturityDegree
}
"
sleep
"
${
maturityDegree
}
"
# 查询 ETH 这端 bridgeBank 地址 0
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
...
@@ -292,13 +292,13 @@ function TestETH2Chain33USDT_proxy() {
...
@@ -292,13 +292,13 @@ function TestETH2Chain33USDT_proxy() {
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
# shellcheck disable=SC2219
# shellcheck disable=SC2219
let
ethT2BalanceEnd
=
${
ethT2Balancebf
}
+
${
lockAmount1
}
-1
let
ethT2BalanceEnd
=
${
ethT2Balancebf
}
+
${
lockAmount1
}
-1
is_equal
"
${
result
}
"
"
${
ethT2BalanceEnd
}
"
is_equal
"
${
result
}
"
"
${
ethT2BalanceEnd
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
# shellcheck disable=SC2219
# shellcheck disable=SC2219
let
ethPBalanceEnd
=
${
ethPBalancebf
}
-
${
lockAmount1
}
+1
let
ethPBalanceEnd
=
${
ethPBalancebf
}
-
${
lockAmount1
}
+1
is_equal
"
${
result
}
"
"
${
ethPBalanceEnd
}
"
is_equal
"
${
result
}
"
"
${
ethPBalanceEnd
}
"
...
@@ -315,7 +315,7 @@ function TestETH2Chain33USDT_proxy_excess() {
...
@@ -315,7 +315,7 @@ function TestETH2Chain33USDT_proxy_excess() {
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethBridgeBank 初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethBridgeBankBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
ethBridgeBankBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
...
@@ -325,14 +325,14 @@ function TestETH2Chain33USDT_proxy_excess() {
...
@@ -325,14 +325,14 @@ function TestETH2Chain33USDT_proxy_excess() {
chain33VspBalancebf
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33Validatorsp
}
)"
)
chain33VspBalancebf
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33Validatorsp
}
)"
)
echo
-e
"
${
IYellow
}
ETH 这端 lock
$lockAmount1
个 USDT
${
NOC
}
"
echo
-e
"
${
IYellow
}
ETH 这端 lock
$lockAmount1
个 USDT
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum lock
-m
"
${
lockAmount1
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
# eth 等待 2 个区块
sleep
4
sleep
4
echo
-e
"
${
IYellow
}
查询 ETH 这端 ethBridgeBank lock 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
查询 ETH 这端 ethBridgeBank lock 后金额
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
# shellcheck disable=SC2219
# shellcheck disable=SC2219
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
let
ethBridgeBankBalanceEnd
=
${
ethBridgeBankBalancebf
}
+
${
lockAmount1
}
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
...
@@ -353,20 +353,20 @@ function TestETH2Chain33USDT_proxy_excess() {
...
@@ -353,20 +353,20 @@ function TestETH2Chain33USDT_proxy_excess() {
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethT2Balancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
ethT2Balancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址初始金额
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
ethPBalancebf
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
ethPBalancebf
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
echo
-e
"
${
IYellow
}
withdraw
${
NOC
}
"
result
=
$(${
CLI
A
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USDTBridgeTokenAddr
}
"
)
result
=
$(${
CLI
P
}
chain33 withdraw
-m
"
${
lockAmount1
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USDTBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"withdraw"
cli_ret
"
${
result
}
"
"withdraw"
sleep
"
${
maturityDegree
}
"
sleep
"
${
maturityDegree
}
"
# 查询 ETH 这端 bridgeBank 地址 0
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
ethBridgeBankBalanceEnd
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
echo
-e
"
${
IYellow
}
chain33ReceiverAddr chain33 端 lock 后接收地址 withdraw 后金额
${
NOC
}
"
...
@@ -380,11 +380,11 @@ function TestETH2Chain33USDT_proxy_excess() {
...
@@ -380,11 +380,11 @@ function TestETH2Chain33USDT_proxy_excess() {
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
is_equal
"
${
result
}
"
"
${
chain33VspBalancewithdraw
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
is_equal
"
${
result
}
"
"
${
ethT2Balancebf
}
"
is_equal
"
${
result
}
"
"
${
ethT2Balancebf
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
echo
-e
"
${
IYellow
}
ethValidatorAddrp ethereum 代理地址 withdraw 后金额 超额了金额跟之前一样
${
NOC
}
"
result
=
$(${
CLI
A
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
result
=
$(${
CLI
P
}
ethereum balance
-o
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
| jq
-r
".balance"
)
is_equal
"
${
result
}
"
"
${
ethPBalancebf
}
"
is_equal
"
${
result
}
"
"
${
ethPBalancebf
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
...
@@ -399,7 +399,7 @@ function TestRelayerProxy() {
...
@@ -399,7 +399,7 @@ function TestRelayerProxy() {
TestETH2Chain33Assets_proxy_excess 100
TestETH2Chain33Assets_proxy_excess 100
# shellcheck disable=SC2154
# shellcheck disable=SC2154
${
CLI
A
}
ethereum token token_transfer
-k
"
${
ethTestAddrKey1
}
"
-m
500
-r
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
${
CLI
P
}
ethereum token token_transfer
-k
"
${
ethTestAddrKey1
}
"
-m
500
-r
"
${
ethValidatorAddrp
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
TestETH2Chain33USDT_proxy 20
TestETH2Chain33USDT_proxy 20
TestETH2Chain33USDT_proxy 40
TestETH2Chain33USDT_proxy 40
TestETH2Chain33USDT_proxy_excess 100
TestETH2Chain33USDT_proxy_excess 100
...
...
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