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
0dfc5b84
Commit
0dfc5b84
authored
Dec 21, 2021
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
up test.sh
parent
4178a770
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
20 deletions
+7
-20
mainPubilcRelayerTest.sh
.../dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
+7
-20
No files found.
plugin/dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
View file @
0dfc5b84
...
...
@@ -256,69 +256,56 @@ function TestChain33ToEthAssets() {
function
TestETH2Chain33Assets
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
=========== eth to chain33 在以太坊上锁定 ETH 资产,然后在 chain33 上 burn ===========
${
NOC
}
"
# 查询 ETH 这端 bridgeBank 地址原来是 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# ETH 这端 lock 11个
result
=
$(${
CLIA
}
ethereum lock
-m
11
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
result
=
$(${
CLIA
}
ethereum lock
-m
0.002
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
sleep
4
# 查询 ETH 这端 bridgeBank 地址 11
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
11
"
cli_ret
"
${
result
}
"
"balance"
".balance"
"
0.002
"
sleep
${
maturityDegree
}
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 11 * le8
is_equal
"
${
result
}
"
"1100000000"
# is_equal "${result}" "2000000000000000"
# 原来的数额
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
echo
'#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum'
result
=
$(${
CLIA
}
chain33 burn
-m
5
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
result
=
$(${
CLIA
}
chain33 burn
-m
0.0003
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
${
maturityDegree
}
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 11-5 * le8
is_equal
"
${
result
}
"
"600000000"
# is_equal "${result}" "1700000000000000"
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"6"
# 比之前多 5
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1005"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0.0017"
echo
'#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum 6'
result
=
$(${
CLIA
}
chain33 burn
-m
6
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
result
=
$(${
CLIA
}
chain33 burn
-m
0.0017
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethTestAddr2
}
"
-t
"
${
chain33EthBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
${
maturityDegree
}
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33EthBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 11-5 * le8
is_equal
"
${
result
}
"
"0"
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# 比之前多 5
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethTestAddr2
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1011"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
...
...
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