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
fc3dafc5
Commit
fc3dafc5
authored
May 20, 2020
by
whisker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix refactor bug
parent
b1a0fb3e
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
540 additions
and
288 deletions
+540
-288
RopstenTest.sh
plugin/dapp/x2Ethereum/cmd/build/RopstenTest.sh
+21
-21
allRelayerTest.sh
plugin/dapp/x2Ethereum/cmd/build/allRelayerTest.sh
+22
-22
perf_test.sh
plugin/dapp/x2Ethereum/cmd/build/perf_test.sh
+9
-9
commands.go
plugin/dapp/x2Ethereum/commands/commands.go
+5
-11
query.go
plugin/dapp/x2Ethereum/commands/query.go
+0
-1
ethereumRelayerCmd.go
plugin/dapp/x2Ethereum/ebcli/ethereumRelayerCmd.go
+32
-3
parser.go
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/parser.go
+1
-1
queryFromEth.go
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/queryFromEth.go
+12
-0
relayToChain33.go
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/relayToChain33.go
+2
-4
relayToEthereum.go
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/relayToEthereum.go
+1
-1
types.go
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/types.go
+2
-2
events.go
plugin/dapp/x2Ethereum/ebrelayer/events/events.go
+1
-1
ethereum.go
...in/dapp/x2Ethereum/ebrelayer/relayer/ethereum/ethereum.go
+4
-0
manager.go
plugin/dapp/x2Ethereum/ebrelayer/relayer/manager.go
+28
-3
config.pb.go
plugin/dapp/x2Ethereum/ebrelayer/types/config.pb.go
+1
-2
relayer.pb.go
plugin/dapp/x2Ethereum/ebrelayer/types/relayer.pb.go
+1
-2
exec.go
plugin/dapp/x2Ethereum/executor/exec.go
+9
-4
exec_local.go
plugin/dapp/x2Ethereum/executor/exec_local.go
+4
-4
query.go
plugin/dapp/x2Ethereum/executor/query.go
+2
-3
x2ethereumaction.go
plugin/dapp/x2Ethereum/executor/x2ethereumaction.go
+7
-9
x2ethereumdb.go
plugin/dapp/x2Ethereum/executor/x2ethereumdb.go
+1
-1
x2ethereum.proto
plugin/dapp/x2Ethereum/proto/x2ethereum.proto
+5
-5
allRelayerTest.sh
plugin/dapp/x2Ethereum/testsh/allRelayerTest.sh
+195
-5
bridgeBankTest.sh
plugin/dapp/x2Ethereum/testsh/bridgeBankTest.sh
+24
-24
ebrelayerTest.sh
plugin/dapp/x2Ethereum/testsh/ebrelayerTest.sh
+7
-7
x2ethereumTest.sh
plugin/dapp/x2Ethereum/testsh/x2ethereumTest.sh
+3
-3
const.go
plugin/dapp/x2Ethereum/types/const.go
+4
-4
x2ethereum.go
plugin/dapp/x2Ethereum/types/x2ethereum.go
+9
-9
x2ethereum.pb.go
plugin/dapp/x2Ethereum/types/x2ethereum.pb.go
+128
-127
No files found.
plugin/dapp/x2Ethereum/cmd/build/RopstenTest.sh
View file @
fc3dafc5
...
@@ -206,14 +206,14 @@ function EthImportKey() {
...
@@ -206,14 +206,14 @@ function EthImportKey() {
function
TestChain33ToEthAssets
()
{
function
TestChain33ToEthAssets
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
tokenSymbol
=
"bty"
tokenSymbol
=
"
coins.
bty"
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
"
${
tokenSymbol
}
"
)
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
"
${
tokenSymbol
}
"
)
tokenAddrBty
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
tokenAddrBty
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
#tokenAddrBty="0xE79142B3171019fcfcA838f0792edB08d4F2a94F"
#tokenAddrBty="0xE79142B3171019fcfcA838f0792edB08d4F2a94F"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
AddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# chain33 lock bty
# chain33 lock bty
...
@@ -226,14 +226,14 @@ function TestChain33ToEthAssets() {
...
@@ -226,14 +226,14 @@ function TestChain33ToEthAssets() {
eth_block_wait
$((
maturityDegree
+
3
))
https://ropsten-rpc.linkpool.io/
eth_block_wait
$((
maturityDegree
+
3
))
https://ropsten-rpc.linkpool.io/
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
AddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
# eth burn
# eth burn
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"burn"
cli_ret
"
${
result
}
"
"burn"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
AddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -305,23 +305,23 @@ function TestETH2Chain33Erc20() {
...
@@ -305,23 +305,23 @@ function TestETH2Chain33Erc20() {
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# lock 100
# lock 100
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -340,10 +340,10 @@ function TestETH2Chain33Erc20() {
...
@@ -340,10 +340,10 @@ function TestETH2Chain33Erc20() {
eth_block_wait 2 https://ropsten-rpc.linkpool.io/
eth_block_wait 2 https://ropsten-rpc.linkpool.io/
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
...
@@ -352,7 +352,7 @@ function TestETH2Chain33Erc20() {
...
@@ -352,7 +352,7 @@ function TestETH2Chain33Erc20() {
function
TestChain33ToEthAssetsKill
()
{
function
TestChain33ToEthAssetsKill
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
tokenSymbol
=
"bty"
tokenSymbol
=
"
coins.
bty"
if
[
"
${
tokenAddrBty
}
"
==
""
]
;
then
if
[
"
${
tokenAddrBty
}
"
==
""
]
;
then
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
"
${
tokenSymbol
}
"
)
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
"
${
tokenSymbol
}
"
)
...
@@ -361,7 +361,7 @@ function TestChain33ToEthAssetsKill() {
...
@@ -361,7 +361,7 @@ function TestChain33ToEthAssetsKill() {
# tokenAddrBty="0xE79142B3171019fcfcA838f0792edB08d4F2a94F"
# tokenAddrBty="0xE79142B3171019fcfcA838f0792edB08d4F2a94F"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
AddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
kill_ebrelayerC
kill_ebrelayerC
...
@@ -374,19 +374,19 @@ function TestChain33ToEthAssetsKill() {
...
@@ -374,19 +374,19 @@ function TestChain33ToEthAssetsKill() {
eth_block_wait
$((
maturityDegree
+
3
))
https://ropsten-rpc.linkpool.io/
eth_block_wait
$((
maturityDegree
+
3
))
https://ropsten-rpc.linkpool.io/
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
AddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
start_ebrelayerC
start_ebrelayerC
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
AddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1.41"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1.41"
# eth burn
# eth burn
result
=
$(${
CLIA
}
relayer ethereum burn
-m
1.41
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum burn
-m
1.41
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"burn"
cli_ret
"
${
result
}
"
"burn"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
AddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -477,13 +477,13 @@ function TestETH2Chain33Erc20Kill() {
...
@@ -477,13 +477,13 @@ function TestETH2Chain33Erc20Kill() {
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
kill_ebrelayerC
kill_ebrelayerC
...
@@ -493,10 +493,10 @@ function TestETH2Chain33Erc20Kill() {
...
@@ -493,10 +493,10 @@ function TestETH2Chain33Erc20Kill() {
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -526,10 +526,10 @@ function TestETH2Chain33Erc20Kill() {
...
@@ -526,10 +526,10 @@ function TestETH2Chain33Erc20Kill() {
start_ebrelayerC
start_ebrelayerC
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
...
...
plugin/dapp/x2Ethereum/cmd/build/allRelayerTest.sh
View file @
fc3dafc5
...
@@ -221,14 +221,14 @@ function InitChain33Vilators() {
...
@@ -221,14 +221,14 @@ function InitChain33Vilators() {
function
TestChain33ToEthAssets
()
{
function
TestChain33ToEthAssets
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
bty
)
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
coins.
bty
)
tokenAddrBty
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
tokenAddrBty
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# chain33 lock bty
# chain33 lock bty
hash
=
$(${
Chain33Cli
}
send x2ethereum lock
-a
5
-t
bty
-r
${
ethReceiverAddr1
}
-q
${
tokenAddrBty
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
hash
=
$(${
Chain33Cli
}
send x2ethereum lock
-a
5
-t
coins.
bty
-r
${
ethReceiverAddr1
}
-q
${
tokenAddrBty
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
...
@@ -237,14 +237,14 @@ function TestChain33ToEthAssets() {
...
@@ -237,14 +237,14 @@ function TestChain33ToEthAssets() {
eth_block_wait
$((
maturityDegree
+
2
))
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
# eth burn
# eth burn
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"burn"
cli_ret
"
${
result
}
"
"burn"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -315,23 +315,23 @@ function TestETH2Chain33Erc20() {
...
@@ -315,23 +315,23 @@ function TestETH2Chain33Erc20() {
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# lock 100
# lock 100
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -350,10 +350,10 @@ function TestETH2Chain33Erc20() {
...
@@ -350,10 +350,10 @@ function TestETH2Chain33Erc20() {
eth_block_wait 2
eth_block_wait 2
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
...
@@ -364,11 +364,11 @@ function TestChain33ToEthAssetsKill() {
...
@@ -364,11 +364,11 @@ function TestChain33ToEthAssetsKill() {
if
[
"
${
tokenAddrBty
}
"
==
""
]
;
then
if
[
"
${
tokenAddrBty
}
"
==
""
]
;
then
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
bty
)
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
coins.
bty
)
tokenAddrBty
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
tokenAddrBty
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
fi
fi
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
kill_ebrelayerC
kill_ebrelayerC
...
@@ -381,19 +381,19 @@ function TestChain33ToEthAssetsKill() {
...
@@ -381,19 +381,19 @@ function TestChain33ToEthAssetsKill() {
eth_block_wait
$((
maturityDegree
+
2
))
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
start_ebrelayerC
start_ebrelayerC
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
# eth burn
# eth burn
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"burn"
cli_ret
"
${
result
}
"
"burn"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddrBty
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -484,13 +484,13 @@ function TestETH2Chain33Erc20Kill() {
...
@@ -484,13 +484,13 @@ function TestETH2Chain33Erc20Kill() {
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
kill_ebrelayerC
kill_ebrelayerC
...
@@ -500,10 +500,10 @@ function TestETH2Chain33Erc20Kill() {
...
@@ -500,10 +500,10 @@ function TestETH2Chain33Erc20Kill() {
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -533,10 +533,10 @@ function TestETH2Chain33Erc20Kill() {
...
@@ -533,10 +533,10 @@ function TestETH2Chain33Erc20Kill() {
start_ebrelayerC
start_ebrelayerC
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
...
...
plugin/dapp/x2Ethereum/cmd/build/perf_test.sh
View file @
fc3dafc5
...
@@ -104,8 +104,8 @@ loop_send_lock_bty() {
...
@@ -104,8 +104,8 @@ loop_send_lock_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddrBty
}
"
| jq
-r
".balance"
)
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
coins.bty
"
| jq
-r
".balance"
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum lock
-q
"
${
tokenAddrBty
}
"
-a
1
-r
${
ethAddress
[i]
}
-t
bty
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum lock
-q
"
${
tokenAddrBty
}
"
-a
1
-r
${
ethAddress
[i]
}
-t
coins.
bty
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
echo
${
i
}
"lock chain33 tx hash:"
${
ethTxHash
}
echo
${
i
}
"lock chain33 tx hash:"
${
ethTxHash
}
let
i++
let
i++
done
done
...
@@ -114,7 +114,7 @@ loop_send_lock_bty() {
...
@@ -114,7 +114,7 @@ loop_send_lock_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddrBty
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
coins.bty
"
| jq
-r
".balance"
)
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
res
}
"
1
check_number
"
${
res
}
"
1
...
@@ -136,7 +136,7 @@ loop_send_burn_bty() {
...
@@ -136,7 +136,7 @@ loop_send_burn_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddrBty
}
"
| jq
-r
".balance"
)
preEthBalance[
$i
]=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
coins.bty
"
| jq
-r
".balance"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
1
-k
"
${
privateKeys
[i]
}
"
-t
"
${
tokenAddrBty
}
"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
1
-k
"
${
privateKeys
[i]
}
"
-t
"
${
tokenAddrBty
}
"
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum burn-async
-m
1
-k
"
${
privateKeys
[i]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
tokenAddrBty
}
"
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum burn-async
-m
1
-k
"
${
privateKeys
[i]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
tokenAddrBty
}
"
)
echo
${
i
}
"burn-async tx hash:"
${
ethTxHash
}
echo
${
i
}
"burn-async tx hash:"
${
ethTxHash
}
...
@@ -147,7 +147,7 @@ loop_send_burn_bty() {
...
@@ -147,7 +147,7 @@ loop_send_burn_bty() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddrBty
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
coins.bty
"
| jq
-r
".balance"
)
res
=
$((
preEthBalance[i]
-
nowEthBalance
))
res
=
$((
preEthBalance[i]
-
nowEthBalance
))
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
res
}
"
1
check_number
"
${
res
}
"
1
...
@@ -167,7 +167,7 @@ loop_send_lock_erc20() {
...
@@ -167,7 +167,7 @@ loop_send_lock_erc20() {
preChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
testc | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
preChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
testc | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
i
=
0
i
=
0
preEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
preEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
testc
"
| jq
-r
".balance"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
10
-k
"
${
privateKeys
[5]
}
"
-t
"
${
tokenAddr
}
"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
10
-k
"
${
privateKeys
[5]
}
"
-t
"
${
tokenAddr
}
"
)
echo
${
i
}
"lock-async erc20 approve tx hash:"
${
approveTxHash
}
echo
${
i
}
"lock-async erc20 approve tx hash:"
${
approveTxHash
}
...
@@ -180,7 +180,7 @@ loop_send_lock_erc20() {
...
@@ -180,7 +180,7 @@ loop_send_lock_erc20() {
eth_block_wait
$((
maturityDegree
+
2
))
eth_block_wait
$((
maturityDegree
+
2
))
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
testc
"
| jq
-r
".balance"
)
res
=
$((
preEthBalance
-
nowEthBalance
))
res
=
$((
preEthBalance
-
nowEthBalance
))
echo
${
i
}
"preBalance"
${
preEthBalance
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
diff
}
"
7
check_number
"
${
diff
}
"
7
...
@@ -200,7 +200,7 @@ loop_send_burn_erc20() {
...
@@ -200,7 +200,7 @@ loop_send_burn_erc20() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[i]
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
preEthBalance[i]
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
testc
"
| jq
-r
".balance"
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum burn
-a
1
-r
${
ethAddress
[i]
}
-t
testc
-q
"
${
tokenAddr
}
"
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum burn
-a
1
-r
${
ethAddress
[i]
}
-t
testc
-q
"
${
tokenAddr
}
"
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
echo
${
i
}
"burn chain33 tx hash:"
${
ethTxHash
}
echo
${
i
}
"burn chain33 tx hash:"
${
ethTxHash
}
let
i++
let
i++
...
@@ -210,7 +210,7 @@ loop_send_burn_erc20() {
...
@@ -210,7 +210,7 @@ loop_send_burn_erc20() {
i
=
0
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethAddress
[i]
}
"
-t
"
testc
"
| jq
-r
".balance"
)
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
res
}
"
1
check_number
"
${
res
}
"
1
...
...
plugin/dapp/x2Ethereum/commands/commands.go
View file @
fc3dafc5
...
@@ -143,9 +143,6 @@ func CreateRawWithdrawEthTxCmd() *cobra.Command {
...
@@ -143,9 +143,6 @@ func CreateRawWithdrawEthTxCmd() *cobra.Command {
addEth2Chain33Flags
(
cmd
)
addEth2Chain33Flags
(
cmd
)
cmd
.
Flags
()
.
StringP
(
"exec"
,
"e"
,
""
,
"exec name token or coins"
)
_
=
cmd
.
MarkFlagRequired
(
"exec"
)
return
cmd
return
cmd
}
}
...
@@ -203,7 +200,7 @@ func CreateRawWithdrawChain33TxCmd() *cobra.Command {
...
@@ -203,7 +200,7 @@ func CreateRawWithdrawChain33TxCmd() *cobra.Command {
func
addChain33ToEthFlags
(
cmd
*
cobra
.
Command
)
{
func
addChain33ToEthFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"contract"
,
"q"
,
""
,
"token contract address,nil for ETH"
)
cmd
.
Flags
()
.
StringP
(
"contract"
,
"q"
,
""
,
"token contract address,nil for ETH"
)
cmd
.
Flags
()
.
StringP
(
"symbol"
,
"t"
,
""
,
"token symbol in chain33"
)
cmd
.
Flags
()
.
StringP
(
"symbol"
,
"t"
,
""
,
"token symbol in chain33
,coins.bty etc.
"
)
_
=
cmd
.
MarkFlagRequired
(
"symbol"
)
_
=
cmd
.
MarkFlagRequired
(
"symbol"
)
cmd
.
Flags
()
.
StringP
(
"receiver"
,
"r"
,
""
,
"ethereum receiver address"
)
cmd
.
Flags
()
.
StringP
(
"receiver"
,
"r"
,
""
,
"ethereum receiver address"
)
...
@@ -221,16 +218,16 @@ func burn(cmd *cobra.Command, args []string) {
...
@@ -221,16 +218,16 @@ func burn(cmd *cobra.Command, args []string) {
amount
,
_
:=
cmd
.
Flags
()
.
GetFloat64
(
"amount"
)
amount
,
_
:=
cmd
.
Flags
()
.
GetFloat64
(
"amount"
)
nodeAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"node_addr"
)
nodeAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"node_addr"
)
if
contract
==
""
{
contract
=
"0x0000000000000000000000000000000000000000"
}
decimal
,
err
:=
utils
.
GetDecimalsFromNode
(
contract
,
nodeAddr
)
decimal
,
err
:=
utils
.
GetDecimalsFromNode
(
contract
,
nodeAddr
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
"get decimal error"
)
fmt
.
Println
(
"get decimal error"
)
return
return
}
}
if
contract
==
""
{
contract
=
"0x0000000000000000000000000000000000000000"
}
params
:=
&
types3
.
Chain33ToEth
{
params
:=
&
types3
.
Chain33ToEth
{
TokenContract
:
contract
,
TokenContract
:
contract
,
EthereumReceiver
:
receiver
,
EthereumReceiver
:
receiver
,
...
@@ -254,9 +251,6 @@ func CreateRawChain33ToEthTxCmd() *cobra.Command {
...
@@ -254,9 +251,6 @@ func CreateRawChain33ToEthTxCmd() *cobra.Command {
addChain33ToEthFlags
(
cmd
)
addChain33ToEthFlags
(
cmd
)
cmd
.
Flags
()
.
StringP
(
"exec"
,
"e"
,
""
,
"exec name token or coins"
)
_
=
cmd
.
MarkFlagRequired
(
"exec"
)
return
cmd
return
cmd
}
}
...
...
plugin/dapp/x2Ethereum/commands/query.go
View file @
fc3dafc5
...
@@ -26,7 +26,6 @@ func queryCmd() *cobra.Command {
...
@@ -26,7 +26,6 @@ func queryCmd() *cobra.Command {
queryConsensusCmd
(),
queryConsensusCmd
(),
queryTotalPowerCmd
(),
queryTotalPowerCmd
(),
querySymbolTotalAmountByTxTypeCmd
(),
querySymbolTotalAmountByTxTypeCmd
(),
queryRelayerBalanceCmd
(),
)
)
return
cmd
return
cmd
}
}
...
...
plugin/dapp/x2Ethereum/ebcli/ethereumRelayerCmd.go
View file @
fc3dafc5
...
@@ -49,6 +49,7 @@ func EthereumRelayerCmd() *cobra.Command {
...
@@ -49,6 +49,7 @@ func EthereumRelayerCmd() *cobra.Command {
ShowBridgeRegistryAddrCmd
(),
ShowBridgeRegistryAddrCmd
(),
StaticsCmd
(),
StaticsCmd
(),
TransferTokenCmd
(),
TransferTokenCmd
(),
GetToken2addressCmd
(),
)
)
return
cmd
return
cmd
...
@@ -683,17 +684,17 @@ func GetBalanceCmd() *cobra.Command {
...
@@ -683,17 +684,17 @@ func GetBalanceCmd() *cobra.Command {
func
GetBalanceFlags
(
cmd
*
cobra
.
Command
)
{
func
GetBalanceFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"owner"
,
"o"
,
""
,
"owner address"
)
cmd
.
Flags
()
.
StringP
(
"owner"
,
"o"
,
""
,
"owner address"
)
_
=
cmd
.
MarkFlagRequired
(
"owner"
)
_
=
cmd
.
MarkFlagRequired
(
"owner"
)
cmd
.
Flags
()
.
StringP
(
"token
Addr"
,
"t"
,
""
,
"token address, optional,
nil for Eth"
)
cmd
.
Flags
()
.
StringP
(
"token
"
,
"t"
,
""
,
"token symbol,
nil for Eth"
)
}
}
func
GetBalance
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
func
GetBalance
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
owner
,
_
:=
cmd
.
Flags
()
.
GetString
(
"owner"
)
owner
,
_
:=
cmd
.
Flags
()
.
GetString
(
"owner"
)
token
Addr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"tokenAddr
"
)
token
,
_
:=
cmd
.
Flags
()
.
GetString
(
"token
"
)
para
:=
ebTypes
.
BalanceAddr
{
para
:=
ebTypes
.
BalanceAddr
{
Owner
:
owner
,
Owner
:
owner
,
TokenAddr
:
token
Addr
,
TokenAddr
:
token
,
}
}
var
res
ebTypes
.
ReplyBalance
var
res
ebTypes
.
ReplyBalance
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"RelayerManager.GetBalance"
,
para
,
&
res
)
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"RelayerManager.GetBalance"
,
para
,
&
res
)
...
@@ -772,3 +773,31 @@ func TransferToken(cmd *cobra.Command, args []string) {
...
@@ -772,3 +773,31 @@ func TransferToken(cmd *cobra.Command, args []string) {
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"RelayerManager.TransferToken"
,
para
,
&
res
)
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"RelayerManager.TransferToken"
,
para
,
&
res
)
ctx
.
Run
()
ctx
.
Run
()
}
}
func
GetToken2addressCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"tokenaddr"
,
Short
:
"get token address by symbol"
,
Run
:
GetToken2address
,
}
GetToken2addressFlags
(
cmd
)
return
cmd
}
func
GetToken2addressFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"token"
,
"t"
,
""
,
"token symbol"
)
_
=
cmd
.
MarkFlagRequired
(
"token"
)
}
func
GetToken2address
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
tokenSymbol
,
_
:=
cmd
.
Flags
()
.
GetString
(
"token"
)
para
:=
ebTypes
.
TokenStatics
{
TokenAddr
:
tokenSymbol
,
}
var
res
ebTypes
.
ReplyAddr
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"RelayerManager.ShowTokenAddrBySymbol"
,
para
,
&
res
)
ctx
.
Run
()
}
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/parser.go
View file @
fc3dafc5
...
@@ -99,7 +99,7 @@ func ParseBurnLockTxReceipt(claimType events.Event, receipt *chain33Types.Receip
...
@@ -99,7 +99,7 @@ func ParseBurnLockTxReceipt(claimType events.Event, receipt *chain33Types.Receip
chain33Sender
=
[]
byte
(
chain33ToEth
.
Chain33Sender
)
chain33Sender
=
[]
byte
(
chain33ToEth
.
Chain33Sender
)
ethereumReceiver
=
common
.
HexToAddress
(
chain33ToEth
.
EthereumReceiver
)
ethereumReceiver
=
common
.
HexToAddress
(
chain33ToEth
.
EthereumReceiver
)
tokenContractAddress
=
common
.
HexToAddress
(
chain33ToEth
.
TokenContract
)
tokenContractAddress
=
common
.
HexToAddress
(
chain33ToEth
.
TokenContract
)
symbol
=
chain33ToEth
.
Eth
Symbol
symbol
=
chain33ToEth
.
IssuerDot
Symbol
chain33ToEth
.
Amount
=
types
.
TrimZeroAndDot
(
chain33ToEth
.
Amount
)
chain33ToEth
.
Amount
=
types
.
TrimZeroAndDot
(
chain33ToEth
.
Amount
)
amount
=
big
.
NewInt
(
1
)
amount
=
big
.
NewInt
(
1
)
amount
,
_
=
amount
.
SetString
(
chain33ToEth
.
Amount
,
10
)
amount
,
_
=
amount
.
SetString
(
chain33ToEth
.
Amount
,
10
)
...
...
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/queryFromEth.go
View file @
fc3dafc5
...
@@ -135,3 +135,15 @@ func GetDepositFunds(client *ethclient.Client, tokenAddrStr string) (string, err
...
@@ -135,3 +135,15 @@ func GetDepositFunds(client *ethclient.Client, tokenAddrStr string) (string, err
}
}
return
supply
.
String
(),
nil
return
supply
.
String
(),
nil
}
}
func
GetToken2address
(
bridgeBank
*
generated
.
BridgeBank
,
tokenSymbol
string
)
(
string
,
error
)
{
opts
:=
&
bind
.
CallOpts
{
Pending
:
true
,
Context
:
context
.
Background
(),
}
tokenAddr
,
err
:=
bridgeBank
.
GetToken2address
(
opts
,
tokenSymbol
)
if
nil
!=
err
{
return
""
,
err
}
return
tokenAddr
.
String
(),
nil
}
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/relayToChain33.go
View file @
fc3dafc5
...
@@ -27,8 +27,7 @@ func RelayLockToChain33(privateKey chain33Crypto.PrivKey, claim *ebrelayerTypes.
...
@@ -27,8 +27,7 @@ func RelayLockToChain33(privateKey chain33Crypto.PrivKey, claim *ebrelayerTypes.
EthereumChainID
:
claim
.
EthereumChainID
,
EthereumChainID
:
claim
.
EthereumChainID
,
BridgeContractAddress
:
claim
.
BridgeBrankAddr
,
BridgeContractAddress
:
claim
.
BridgeBrankAddr
,
Nonce
:
claim
.
Nonce
,
Nonce
:
claim
.
Nonce
,
LocalCoinSymbol
:
claim
.
Symbol
,
IssuerDotSymbol
:
claim
.
Symbol
,
LocalCoinExec
:
X2Eth
,
TokenContractAddress
:
claim
.
TokenAddr
,
TokenContractAddress
:
claim
.
TokenAddr
,
EthereumSender
:
claim
.
EthereumSender
,
EthereumSender
:
claim
.
EthereumSender
,
Chain33Receiver
:
claim
.
Chain33Receiver
,
Chain33Receiver
:
claim
.
Chain33Receiver
,
...
@@ -84,8 +83,7 @@ func RelayBurnToChain33(privateKey chain33Crypto.PrivKey, claim *ebrelayerTypes.
...
@@ -84,8 +83,7 @@ func RelayBurnToChain33(privateKey chain33Crypto.PrivKey, claim *ebrelayerTypes.
EthereumChainID
:
claim
.
EthereumChainID
,
EthereumChainID
:
claim
.
EthereumChainID
,
BridgeContractAddress
:
claim
.
BridgeBrankAddr
,
BridgeContractAddress
:
claim
.
BridgeBrankAddr
,
Nonce
:
claim
.
Nonce
,
Nonce
:
claim
.
Nonce
,
LocalCoinSymbol
:
claim
.
Symbol
,
IssuerDotSymbol
:
claim
.
Symbol
,
LocalCoinExec
:
X2Eth
,
TokenContractAddress
:
claim
.
TokenAddr
,
TokenContractAddress
:
claim
.
TokenAddr
,
EthereumSender
:
claim
.
EthereumSender
,
EthereumSender
:
claim
.
EthereumSender
,
Chain33Receiver
:
claim
.
Chain33Receiver
,
Chain33Receiver
:
claim
.
Chain33Receiver
,
...
...
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/relayToEthereum.go
View file @
fc3dafc5
...
@@ -32,7 +32,7 @@ func RelayOracleClaimToEthereum(oracleInstance *generated.Oracle, client *ethcli
...
@@ -32,7 +32,7 @@ func RelayOracleClaimToEthereum(oracleInstance *generated.Oracle, client *ethcli
}
}
auth
.
GasLimit
=
GasLimit
auth
.
GasLimit
=
GasLimit
claimID
:=
crypto
.
Keccak256Hash
(
chain33TxHash
,
claim
.
Chain33Sender
,
claim
.
EthereumReceiver
.
Bytes
(),
claim
.
TokenContractAddress
.
Bytes
(
),
claim
.
Amount
.
Bytes
())
claimID
:=
crypto
.
Keccak256Hash
(
chain33TxHash
,
claim
.
Chain33Sender
,
claim
.
EthereumReceiver
.
Bytes
(),
[]
byte
(
claim
.
Symbol
),
claim
.
Amount
.
Bytes
())
// Sign the hash using the active validator's private key
// Sign the hash using the active validator's private key
signature
,
err
:=
SignClaim4Eth
(
claimID
,
privateKey
)
signature
,
err
:=
SignClaim4Eth
(
claimID
,
privateKey
)
...
...
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/types.go
View file @
fc3dafc5
...
@@ -9,8 +9,8 @@ import (
...
@@ -9,8 +9,8 @@ import (
const
(
const
(
X2Eth
=
"x2ethereum"
X2Eth
=
"x2ethereum"
BurnAction
=
"
WithdrawChain33
"
BurnAction
=
"
Chain33ToEthBurn
"
LockAction
=
"Chain33ToEth"
LockAction
=
"Chain33ToEth
Lock
"
)
)
// OracleClaim : contains data required to make an OracleClaim
// OracleClaim : contains data required to make an OracleClaim
...
...
plugin/dapp/x2Ethereum/ebrelayer/events/events.go
View file @
fc3dafc5
...
@@ -31,7 +31,7 @@ const (
...
@@ -31,7 +31,7 @@ const (
// String : returns the event type as a string
// String : returns the event type as a string
func
(
d
Event
)
String
()
string
{
func
(
d
Event
)
String
()
string
{
return
[
...
]
string
{
"unknown-x2ethereum"
,
"
WithdrawChain33-burn"
,
"Chain33ToEth-l
ock"
,
"LogLock"
,
"LogChain33TokenBurn"
,
"LogNewProphecyClaim"
}[
d
]
return
[
...
]
string
{
"unknown-x2ethereum"
,
"
Chain33ToEthBurn"
,
"Chain33ToEthL
ock"
,
"LogLock"
,
"LogChain33TokenBurn"
,
"LogNewProphecyClaim"
}[
d
]
}
}
// Chain33MsgAttributeKey : enum containing supported attribute keys
// Chain33MsgAttributeKey : enum containing supported attribute keys
...
...
plugin/dapp/x2Ethereum/ebrelayer/relayer/ethereum/ethereum.go
View file @
fc3dafc5
...
@@ -257,6 +257,10 @@ func (ethRelayer *EthereumRelayer) ShowDepositStatics(tokenAddr string) (string,
...
@@ -257,6 +257,10 @@ func (ethRelayer *EthereumRelayer) ShowDepositStatics(tokenAddr string) (string,
return
ethtxs
.
GetDepositFunds
(
ethRelayer
.
client
,
tokenAddr
)
return
ethtxs
.
GetDepositFunds
(
ethRelayer
.
client
,
tokenAddr
)
}
}
func
(
ethRelayer
*
EthereumRelayer
)
ShowTokenAddrBySymbol
(
tokenSymbol
string
)
(
string
,
error
)
{
return
ethtxs
.
GetToken2address
(
ethRelayer
.
x2EthContracts
.
BridgeBank
,
tokenSymbol
)
}
func
(
ethRelayer
*
EthereumRelayer
)
IsProphecyPending
(
claimID
[
32
]
byte
)
(
bool
,
error
)
{
func
(
ethRelayer
*
EthereumRelayer
)
IsProphecyPending
(
claimID
[
32
]
byte
)
(
bool
,
error
)
{
return
ethtxs
.
IsProphecyPending
(
claimID
,
ethRelayer
.
ethValidator
,
ethRelayer
.
x2EthContracts
.
Chain33Bridge
)
return
ethtxs
.
IsProphecyPending
(
claimID
,
ethRelayer
.
ethValidator
,
ethRelayer
.
x2EthContracts
.
Chain33Bridge
)
}
}
...
...
plugin/dapp/x2Ethereum/ebrelayer/relayer/manager.go
View file @
fc3dafc5
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"fmt"
"fmt"
"math/big"
"math/big"
"strconv"
"strconv"
"strings"
"sync"
"sync"
"sync/atomic"
"sync/atomic"
...
@@ -507,16 +508,25 @@ func (manager *RelayerManager) IsProphecyPending(claimID [32]byte, result *inter
...
@@ -507,16 +508,25 @@ func (manager *RelayerManager) IsProphecyPending(claimID [32]byte, result *inter
func
(
manager
*
RelayerManager
)
GetBalance
(
balanceAddr
relayerTypes
.
BalanceAddr
,
result
*
interface
{})
error
{
func
(
manager
*
RelayerManager
)
GetBalance
(
balanceAddr
relayerTypes
.
BalanceAddr
,
result
*
interface
{})
error
{
manager
.
mtx
.
Lock
()
manager
.
mtx
.
Lock
()
defer
manager
.
mtx
.
Unlock
()
defer
manager
.
mtx
.
Unlock
()
balance
,
err
:=
manager
.
ethRelayer
.
GetBalance
(
balanceAddr
.
TokenAddr
,
balanceAddr
.
Owner
)
var
addr
string
var
err
error
if
balanceAddr
.
TokenAddr
!=
""
{
addr
,
err
=
manager
.
ethRelayer
.
ShowTokenAddrBySymbol
(
balanceAddr
.
TokenAddr
)
if
nil
!=
err
{
return
err
}
}
balance
,
err
:=
manager
.
ethRelayer
.
GetBalance
(
addr
,
balanceAddr
.
Owner
)
if
nil
!=
err
{
if
nil
!=
err
{
return
err
return
err
}
}
var
d
int64
var
d
int64
if
balanceAddr
.
TokenAddr
==
""
||
balanceAddr
.
TokenAddr
==
"0x0000000000000000000000000000000000000000
"
{
if
balanceAddr
.
TokenAddr
==
""
||
strings
.
ToLower
(
balanceAddr
.
TokenAddr
)
==
"eth
"
{
d
=
18
d
=
18
}
else
{
}
else
{
d
,
err
=
manager
.
GetDecimals
(
balanceAddr
.
TokenA
ddr
)
d
,
err
=
manager
.
GetDecimals
(
a
ddr
)
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
New
(
"get decimals error"
)
return
errors
.
New
(
"get decimals error"
)
}
}
...
@@ -601,6 +611,21 @@ func (manager *RelayerManager) ShowDepositStatics(token relayerTypes.TokenStatic
...
@@ -601,6 +611,21 @@ func (manager *RelayerManager) ShowDepositStatics(token relayerTypes.TokenStatic
return
nil
return
nil
}
}
func
(
manager
*
RelayerManager
)
ShowTokenAddrBySymbol
(
token
relayerTypes
.
TokenStatics
,
result
*
interface
{})
error
{
manager
.
mtx
.
Lock
()
defer
manager
.
mtx
.
Unlock
()
addr
,
err
:=
manager
.
ethRelayer
.
ShowTokenAddrBySymbol
(
token
.
TokenAddr
)
if
nil
!=
err
{
return
err
}
*
result
=
relayerTypes
.
ReplyAddr
{
IsOK
:
true
,
Addr
:
addr
,
}
return
nil
}
func
(
manager
*
RelayerManager
)
ShowTxReceipt
(
txhash
string
,
result
*
interface
{})
error
{
func
(
manager
*
RelayerManager
)
ShowTxReceipt
(
txhash
string
,
result
*
interface
{})
error
{
manager
.
mtx
.
Lock
()
manager
.
mtx
.
Lock
()
defer
manager
.
mtx
.
Unlock
()
defer
manager
.
mtx
.
Unlock
()
...
...
plugin/dapp/x2Ethereum/ebrelayer/types/config.pb.go
View file @
fc3dafc5
...
@@ -5,9 +5,8 @@ package types
...
@@ -5,9 +5,8 @@ package types
import
(
import
(
fmt
"fmt"
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
)
// Reference imports to suppress errors if they are not otherwise used.
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/x2Ethereum/ebrelayer/types/relayer.pb.go
View file @
fc3dafc5
...
@@ -5,9 +5,8 @@ package types
...
@@ -5,9 +5,8 @@ package types
import
(
import
(
fmt
"fmt"
fmt
"fmt"
math
"math"
proto
"github.com/golang/protobuf/proto"
proto
"github.com/golang/protobuf/proto"
math
"math"
)
)
// Reference imports to suppress errors if they are not otherwise used.
// Reference imports to suppress errors if they are not otherwise used.
...
...
plugin/dapp/x2Ethereum/executor/exec.go
View file @
fc3dafc5
...
@@ -20,7 +20,7 @@ import (
...
@@ -20,7 +20,7 @@ import (
// Eth2Chain33类型的交易是Ethereum侧锁定一定金额的eth或者erc20到合约中
// Eth2Chain33类型的交易是Ethereum侧锁定一定金额的eth或者erc20到合约中
// 然后relayer端订阅到该消息后向chain33发送该类型消息
// 然后relayer端订阅到该消息后向chain33发送该类型消息
// 本端在验证该类型的请求合理后铸币,并生成相同数额的token
// 本端在验证该类型的请求合理后铸币,并生成相同数额的token
func
(
x
*
x2ethereum
)
Exec_Eth2Chain33
_l
ock
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
func
(
x
*
x2ethereum
)
Exec_Eth2Chain33
L
ock
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
if
action
==
nil
{
if
action
==
nil
{
return
nil
,
errors
.
New
(
"Create Action Error"
)
return
nil
,
errors
.
New
(
"Create Action Error"
)
...
@@ -33,7 +33,7 @@ func (x *x2ethereum) Exec_Eth2Chain33_lock(payload *x2eTy.Eth2Chain33, tx *types
...
@@ -33,7 +33,7 @@ func (x *x2ethereum) Exec_Eth2Chain33_lock(payload *x2eTy.Eth2Chain33, tx *types
//---------------- Chain33(eth/erc20)------> Ethereum -------------------//
//---------------- Chain33(eth/erc20)------> Ethereum -------------------//
// WithdrawChain33类型的交易是将Eth端因Chain33端锁定所生成的token返还给Chain33端(Burn)
// WithdrawChain33类型的交易是将Eth端因Chain33端锁定所生成的token返还给Chain33端(Burn)
func
(
x
*
x2ethereum
)
Exec_Chain33ToEth
_b
urn
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
func
(
x
*
x2ethereum
)
Exec_Chain33ToEth
B
urn
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
if
action
==
nil
{
if
action
==
nil
{
return
nil
,
errors
.
New
(
"Create Action Error"
)
return
nil
,
errors
.
New
(
"Create Action Error"
)
...
@@ -44,7 +44,7 @@ func (x *x2ethereum) Exec_Chain33ToEth_burn(payload *x2eTy.Chain33ToEth, tx *typ
...
@@ -44,7 +44,7 @@ func (x *x2ethereum) Exec_Chain33ToEth_burn(payload *x2eTy.Chain33ToEth, tx *typ
//---------------- Chain33(eth/erc20) --> Ethereum-------------------//
//---------------- Chain33(eth/erc20) --> Ethereum-------------------//
// 将因ethereum端锁定的eth或者erc20而在chain33端生成的token返还
// 将因ethereum端锁定的eth或者erc20而在chain33端生成的token返还
func
(
x
*
x2ethereum
)
Exec_Eth2Chain33
_b
urn
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
func
(
x
*
x2ethereum
)
Exec_Eth2Chain33
B
urn
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
if
action
==
nil
{
if
action
==
nil
{
return
nil
,
errors
.
New
(
"Create Action Error"
)
return
nil
,
errors
.
New
(
"Create Action Error"
)
...
@@ -57,7 +57,7 @@ func (x *x2ethereum) Exec_Eth2Chain33_burn(payload *x2eTy.Eth2Chain33, tx *types
...
@@ -57,7 +57,7 @@ func (x *x2ethereum) Exec_Eth2Chain33_burn(payload *x2eTy.Eth2Chain33, tx *types
// Chain33ToEth类型的交易是Chain33侧在本端发出申请
// Chain33ToEth类型的交易是Chain33侧在本端发出申请
// 在本端锁定一定数额的token,然后在ethereum端生成相同数额的token
// 在本端锁定一定数额的token,然后在ethereum端生成相同数额的token
func
(
x
*
x2ethereum
)
Exec_Chain33ToEth
_l
ock
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
func
(
x
*
x2ethereum
)
Exec_Chain33ToEth
L
ock
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
index
int
)
(
*
types
.
Receipt
,
error
)
{
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
action
:=
newAction
(
x
,
tx
,
int32
(
index
))
if
action
==
nil
{
if
action
==
nil
{
return
nil
,
errors
.
New
(
"Create Action Error"
)
return
nil
,
errors
.
New
(
"Create Action Error"
)
...
@@ -156,10 +156,15 @@ func (x *x2ethereum) Exec_SetConsensusThreshold(payload *x2eTy.MsgConsensusThres
...
@@ -156,10 +156,15 @@ func (x *x2ethereum) Exec_SetConsensusThreshold(payload *x2eTy.MsgConsensusThres
func
checkTxSignBySpecificAddr
(
tx
*
types
.
Transaction
,
addrs
[]
string
)
error
{
func
checkTxSignBySpecificAddr
(
tx
*
types
.
Transaction
,
addrs
[]
string
)
error
{
signAddr
:=
address
.
PubKeyToAddr
(
tx
.
Signature
.
Pubkey
)
signAddr
:=
address
.
PubKeyToAddr
(
tx
.
Signature
.
Pubkey
)
var
exist
bool
for
_
,
addr
:=
range
addrs
{
for
_
,
addr
:=
range
addrs
{
if
signAddr
==
addr
{
if
signAddr
==
addr
{
exist
=
true
continue
continue
}
}
}
if
!
exist
{
return
x2eTy
.
ErrInvalidAdminAddress
return
x2eTy
.
ErrInvalidAdminAddress
}
}
...
...
plugin/dapp/x2Ethereum/executor/exec_local.go
View file @
fc3dafc5
...
@@ -12,7 +12,7 @@ import (
...
@@ -12,7 +12,7 @@ import (
* 非关键数据,本地存储(localDB), 用于辅助查询,效率高
* 非关键数据,本地存储(localDB), 用于辅助查询,效率高
*/
*/
func
(
x
*
x2ethereum
)
ExecLocal_Eth2Chain33
_l
ock
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
x
*
x2ethereum
)
ExecLocal_Eth2Chain33
L
ock
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
set
,
err
:=
x
.
execLocal
(
receiptData
)
set
,
err
:=
x
.
execLocal
(
receiptData
)
if
err
!=
nil
{
if
err
!=
nil
{
return
set
,
err
return
set
,
err
...
@@ -20,7 +20,7 @@ func (x *x2ethereum) ExecLocal_Eth2Chain33_lock(payload *x2eTy.Eth2Chain33, tx *
...
@@ -20,7 +20,7 @@ func (x *x2ethereum) ExecLocal_Eth2Chain33_lock(payload *x2eTy.Eth2Chain33, tx *
return
x
.
addAutoRollBack
(
tx
,
set
.
KV
),
nil
return
x
.
addAutoRollBack
(
tx
,
set
.
KV
),
nil
}
}
func
(
x
*
x2ethereum
)
ExecLocal_Eth2Chain33
_b
urn
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
x
*
x2ethereum
)
ExecLocal_Eth2Chain33
B
urn
(
payload
*
x2eTy
.
Eth2Chain33
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
set
,
err
:=
x
.
execLocal
(
receiptData
)
set
,
err
:=
x
.
execLocal
(
receiptData
)
if
err
!=
nil
{
if
err
!=
nil
{
return
set
,
err
return
set
,
err
...
@@ -28,7 +28,7 @@ func (x *x2ethereum) ExecLocal_Eth2Chain33_burn(payload *x2eTy.Eth2Chain33, tx *
...
@@ -28,7 +28,7 @@ func (x *x2ethereum) ExecLocal_Eth2Chain33_burn(payload *x2eTy.Eth2Chain33, tx *
return
x
.
addAutoRollBack
(
tx
,
set
.
KV
),
nil
return
x
.
addAutoRollBack
(
tx
,
set
.
KV
),
nil
}
}
func
(
x
*
x2ethereum
)
ExecLocal_Chain33ToEth
_b
urn
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
x
*
x2ethereum
)
ExecLocal_Chain33ToEth
B
urn
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
set
,
err
:=
x
.
execLocal
(
receiptData
)
set
,
err
:=
x
.
execLocal
(
receiptData
)
if
err
!=
nil
{
if
err
!=
nil
{
return
set
,
err
return
set
,
err
...
@@ -36,7 +36,7 @@ func (x *x2ethereum) ExecLocal_Chain33ToEth_burn(payload *x2eTy.Chain33ToEth, tx
...
@@ -36,7 +36,7 @@ func (x *x2ethereum) ExecLocal_Chain33ToEth_burn(payload *x2eTy.Chain33ToEth, tx
return
x
.
addAutoRollBack
(
tx
,
set
.
KV
),
nil
return
x
.
addAutoRollBack
(
tx
,
set
.
KV
),
nil
}
}
func
(
x
*
x2ethereum
)
ExecLocal_Chain33ToEth
_l
ock
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
x
*
x2ethereum
)
ExecLocal_Chain33ToEth
L
ock
(
payload
*
x2eTy
.
Chain33ToEth
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
set
,
err
:=
x
.
execLocal
(
receiptData
)
set
,
err
:=
x
.
execLocal
(
receiptData
)
if
err
!=
nil
{
if
err
!=
nil
{
return
set
,
err
return
set
,
err
...
...
plugin/dapp/x2Ethereum/executor/query.go
View file @
fc3dafc5
...
@@ -5,7 +5,6 @@ import (
...
@@ -5,7 +5,6 @@ import (
"strings"
"strings"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
x2eTy
"github.com/33cn/plugin/plugin/dapp/x2Ethereum/types"
x2eTy
"github.com/33cn/plugin/plugin/dapp/x2Ethereum/types"
)
)
...
@@ -166,7 +165,7 @@ func (x *x2ethereum) Query_GetRelayerBalance(in *x2eTy.QueryRelayerBalance) (typ
...
@@ -166,7 +165,7 @@ func (x *x2ethereum) Query_GetRelayerBalance(in *x2eTy.QueryRelayerBalance) (typ
return
nil
,
err
return
nil
,
err
}
}
acc
:=
accDB
.
Load
ExecAccount
(
in
.
Address
,
address
.
ExecAddress
(
x2eTy
.
X2ethereumX
)
)
acc
:=
accDB
.
Load
Account
(
in
.
Address
)
res
:=
new
(
x2eTy
.
ReceiptQueryRelayerBalanceForOneToken
)
res
:=
new
(
x2eTy
.
ReceiptQueryRelayerBalanceForOneToken
)
res
.
TokenAddr
=
in
.
TokenAddr
res
.
TokenAddr
=
in
.
TokenAddr
res
.
TokenSymbol
=
in
.
TokenSymbol
res
.
TokenSymbol
=
in
.
TokenSymbol
...
@@ -191,7 +190,7 @@ func (x *x2ethereum) Query_GetRelayerBalance(in *x2eTy.QueryRelayerBalance) (typ
...
@@ -191,7 +190,7 @@ func (x *x2ethereum) Query_GetRelayerBalance(in *x2eTy.QueryRelayerBalance) (typ
return
nil
,
err
return
nil
,
err
}
}
acc
:=
accDB
.
Load
ExecAccount
(
in
.
Address
,
address
.
ExecAddress
(
x2eTy
.
X2ethereumX
)
)
acc
:=
accDB
.
Load
Account
(
in
.
Address
)
res
:=
new
(
x2eTy
.
ReceiptQueryRelayerBalanceForOneToken
)
res
:=
new
(
x2eTy
.
ReceiptQueryRelayerBalanceForOneToken
)
res
.
TokenAddr
=
addr
res
.
TokenAddr
=
addr
res
.
TokenSymbol
=
in
.
TokenSymbol
res
.
TokenSymbol
=
in
.
TokenSymbol
...
...
plugin/dapp/x2Ethereum/executor/x2ethereumaction.go
View file @
fc3dafc5
...
@@ -72,13 +72,12 @@ func (a *action) procEth2Chain33_lock(ethBridgeClaim *x2eTy.Eth2Chain33) (*types
...
@@ -72,13 +72,12 @@ func (a *action) procEth2Chain33_lock(ethBridgeClaim *x2eTy.Eth2Chain33) (*types
if
status
.
Text
==
x2eTy
.
EthBridgeStatus_SuccessStatusText
{
if
status
.
Text
==
x2eTy
.
EthBridgeStatus_SuccessStatusText
{
// mavl-x2ethereum-eth+tokenAddress
// mavl-x2ethereum-eth+tokenAddress
// 这里为了区分相同tokensymbol不同tokenAddress做了级联处理
// 这里为了区分相同tokensymbol不同tokenAddress做了级联处理
_
,
symbol
,
_
:=
x2eTy
.
DivideDot
(
ethBridgeClaim
.
IssuerDotSymbol
)
accDB
,
err
:=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
x2eTy
.
X2ethereumX
,
strings
.
ToLower
(
ethBridgeClaim
.
IssuerDotSymbol
+
ethBridgeClaim
.
TokenContractAddress
),
a
.
db
)
accDB
,
err
:=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
x2eTy
.
X2ethereumX
,
strings
.
ToLower
(
symbol
+
ethBridgeClaim
.
TokenContractAddress
),
a
.
db
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"relay procMsgEth2Chain33,exec=%s,sym=%s"
,
x2eTy
.
X2ethereumX
,
s
ymbol
)
return
nil
,
errors
.
Wrapf
(
err
,
"relay procMsgEth2Chain33,exec=%s,sym=%s"
,
x2eTy
.
X2ethereumX
,
ethBridgeClaim
.
IssuerDotS
ymbol
)
}
}
r
,
err
:=
a
.
oracle
.
ProcessSuccessfulClaimForLock
(
status
.
FinalClaim
,
a
.
execaddr
,
symbol
,
accDB
)
r
,
err
:=
a
.
oracle
.
ProcessSuccessfulClaimForLock
(
status
.
FinalClaim
,
a
.
execaddr
,
accDB
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
...
@@ -122,10 +121,9 @@ func (a *action) procChain33ToEth_burn(msgBurn *x2eTy.Chain33ToEth) (*types.Rece
...
@@ -122,10 +121,9 @@ func (a *action) procChain33ToEth_burn(msgBurn *x2eTy.Chain33ToEth) (*types.Rece
return
nil
,
err
return
nil
,
err
}
}
_
,
symbol
,
_
:=
x2eTy
.
DivideDot
(
msgBurn
.
IssuerDotSymbol
)
accDB
,
err
:=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
x2eTy
.
X2ethereumX
,
strings
.
ToLower
(
msgBurn
.
IssuerDotSymbol
+
msgBurn
.
TokenContract
),
a
.
db
)
accDB
,
err
:=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
x2eTy
.
X2ethereumX
,
strings
.
ToLower
(
symbol
+
msgBurn
.
TokenContract
),
a
.
db
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
errors
.
Wrapf
(
err
,
"relay procMsgBurn,exec=%s,sym=%s"
,
x2eTy
.
X2ethereumX
,
s
ymbol
)
return
nil
,
errors
.
Wrapf
(
err
,
"relay procMsgBurn,exec=%s,sym=%s"
,
x2eTy
.
X2ethereumX
,
msgBurn
.
IssuerDotS
ymbol
)
}
}
r
,
err
:=
a
.
oracle
.
ProcessBurn
(
a
.
fromaddr
,
a
.
execaddr
,
msgBurn
.
Amount
,
msgBurn
.
TokenContract
,
msgBurn
.
Decimals
,
accDB
)
r
,
err
:=
a
.
oracle
.
ProcessBurn
(
a
.
fromaddr
,
a
.
execaddr
,
msgBurn
.
Amount
,
msgBurn
.
TokenContract
,
msgBurn
.
Decimals
,
accDB
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -162,7 +160,7 @@ func (a *action) procChain33ToEth_lock(msgLock *x2eTy.Chain33ToEth) (*types.Rece
...
@@ -162,7 +160,7 @@ func (a *action) procChain33ToEth_lock(msgLock *x2eTy.Chain33ToEth) (*types.Rece
var
accDB
*
account
.
DB
var
accDB
*
account
.
DB
exec
,
symbol
,
_
:=
x2eTy
.
DivideDot
(
msgLock
.
IssuerDotSymbol
)
exec
,
symbol
,
_
:=
x2eTy
.
DivideDot
(
msgLock
.
IssuerDotSymbol
)
if
exec
==
"coins"
{
if
exec
==
"coins"
{
accDB
:
=
account
.
NewCoinsAccount
(
a
.
api
.
GetConfig
())
accDB
=
account
.
NewCoinsAccount
(
a
.
api
.
GetConfig
())
accDB
.
SetDB
(
a
.
db
)
accDB
.
SetDB
(
a
.
db
)
}
else
{
}
else
{
accDB
,
err
=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
exec
,
strings
.
ToLower
(
symbol
),
a
.
db
)
accDB
,
err
=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
exec
,
strings
.
ToLower
(
symbol
),
a
.
db
)
...
@@ -233,7 +231,7 @@ func (a *action) procEth2Chain33_burn(withdrawEth *x2eTy.Eth2Chain33) (*types.Re
...
@@ -233,7 +231,7 @@ func (a *action) procEth2Chain33_burn(withdrawEth *x2eTy.Eth2Chain33) (*types.Re
var
accDB
*
account
.
DB
var
accDB
*
account
.
DB
exec
,
symbol
,
_
:=
x2eTy
.
DivideDot
(
withdrawEth
.
IssuerDotSymbol
)
exec
,
symbol
,
_
:=
x2eTy
.
DivideDot
(
withdrawEth
.
IssuerDotSymbol
)
if
exec
==
"coins"
{
if
exec
==
"coins"
{
accDB
:
=
account
.
NewCoinsAccount
(
a
.
api
.
GetConfig
())
accDB
=
account
.
NewCoinsAccount
(
a
.
api
.
GetConfig
())
accDB
.
SetDB
(
a
.
db
)
accDB
.
SetDB
(
a
.
db
)
}
else
{
}
else
{
accDB
,
err
=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
exec
,
strings
.
ToLower
(
symbol
),
a
.
db
)
accDB
,
err
=
account
.
NewAccountDB
(
a
.
api
.
GetConfig
(),
exec
,
strings
.
ToLower
(
symbol
),
a
.
db
)
...
...
plugin/dapp/x2Ethereum/executor/x2ethereumdb.go
View file @
fc3dafc5
...
@@ -27,7 +27,7 @@ func NewOracle(db dbm.KV, consensusThreshold int64) *Oracle {
...
@@ -27,7 +27,7 @@ func NewOracle(db dbm.KV, consensusThreshold int64) *Oracle {
}
}
// 处理经过审核的关于Lock的claim
// 处理经过审核的关于Lock的claim
func
(
o
*
Oracle
)
ProcessSuccessfulClaimForLock
(
claim
,
execAddr
,
tokenSymbol
string
,
accDB
*
account
.
DB
)
(
*
types
.
Receipt
,
error
)
{
func
(
o
*
Oracle
)
ProcessSuccessfulClaimForLock
(
claim
,
execAddr
string
,
accDB
*
account
.
DB
)
(
*
types
.
Receipt
,
error
)
{
var
receipt
*
types
.
Receipt
var
receipt
*
types
.
Receipt
oracleClaim
,
err
:=
CreateOracleClaimFromOracleString
(
claim
)
oracleClaim
,
err
:=
CreateOracleClaimFromOracleString
(
claim
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
plugin/dapp/x2Ethereum/proto/x2ethereum.proto
View file @
fc3dafc5
...
@@ -12,17 +12,17 @@ enum EthBridgeStatus {
...
@@ -12,17 +12,17 @@ enum EthBridgeStatus {
message
X2ethereumAction
{
message
X2ethereumAction
{
oneof
value
{
oneof
value
{
Eth2Chain33
eth2Chain33
=
1
;
Eth2Chain33
eth2Chain33
Lock
=
1
;
Eth2Chain33
withdrawEth
=
2
;
Eth2Chain33
eth2Chain33Burn
=
2
;
Chain33ToEth
withdrawChain33
=
3
;
Chain33ToEth
chain33ToEthBurn
=
3
;
Chain33ToEth
chain33ToEth
=
4
;
Chain33ToEth
chain33ToEth
Lock
=
4
;
MsgValidator
addValidator
=
5
;
MsgValidator
addValidator
=
5
;
MsgValidator
removeValidator
=
6
;
MsgValidator
removeValidator
=
6
;
MsgValidator
modifyPower
=
7
;
MsgValidator
modifyPower
=
7
;
MsgConsensusThreshold
setConsensusThreshold
=
8
;
MsgConsensusThreshold
setConsensusThreshold
=
8
;
AssetsTransfer
transfer
=
9
;
AssetsTransfer
transfer
=
9
;
AssetsTransferToExec
transferToExec
=
10
;
AssetsTransferToExec
transferToExec
=
10
;
AssetsWithdraw
withdraw
=
11
;
AssetsWithdraw
withdraw
FromExec
=
11
;
}
}
int32
ty
=
12
;
int32
ty
=
12
;
}
}
...
...
plugin/dapp/x2Ethereum/testsh/allRelayerTest.sh
View file @
fc3dafc5
...
@@ -200,14 +200,14 @@ function InitChain33Vilators() {
...
@@ -200,14 +200,14 @@ function InitChain33Vilators() {
function
TestChain33ToEthAssets
()
{
function
TestChain33ToEthAssets
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
bty
)
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
coins.
bty
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# chain33 lock bty
# chain33 lock bty
hash
=
$(${
Chain33Cli
}
send x2ethereum lock
-a
5
-t
bty
-r
${
ethReceiverAddr1
}
-q
${
tokenAddr
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
hash
=
$(${
Chain33Cli
}
send x2ethereum lock
-a
5
-t
coins.
bty
-r
${
ethReceiverAddr1
}
-q
${
tokenAddr
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
...
@@ -216,14 +216,14 @@ function TestChain33ToEthAssets() {
...
@@ -216,14 +216,14 @@ function TestChain33ToEthAssets() {
eth_block_wait
$((
maturityDegree
+
2
))
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
# eth burn
# eth burn
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
cli_ret
"
${
result
}
"
"burn"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# eth 等待 10 个区块
# eth 等待 10 个区块
...
@@ -294,6 +294,176 @@ function TestETH2Chain33Erc20() {
...
@@ -294,6 +294,176 @@ function TestETH2Chain33Erc20() {
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenSymbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
tokenSymbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# lock 100
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenSymbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
tokenSymbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
# eth 等待 10 个区块
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
"
${
chain33Validator1
}
"
-t
"
${
tokenSymbol
}
"
-a
"
${
tokenAddr
}
"
| jq
".res"
| jq
".[]"
)
balance_ret
"
${
result
}
"
"100"
# chain33 burn 100
hash
=
$(${
Chain33Cli
}
send x2ethereum burn
-a
100
-t
"
${
tokenSymbol
}
"
-r
${
ethReceiverAddr2
}
-q
${
tokenAddr
}
-k
"
${
chain33Validator1
}
"
)
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
"
${
chain33Validator1
}
"
-t
"
${
tokenSymbol
}
"
-a
"
${
tokenAddr
}
"
| jq
".res"
| jq
".[]"
)
balance_ret
"
${
result
}
"
"0"
eth_block_wait 2
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenSymbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
tokenSymbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
TestChain33ToEthAssetsKill
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
if
[
"
${
tokenAddrBty
}
"
==
""
]
;
then
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
bty
)
tokenAddrBty
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
fi
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
kill_ebrelayerC
kill_ebrelayerD
# chain33 lock bty
hash
=
$(${
Chain33Cli
}
send x2ethereum lock
-a
5
-t
bty
-r
${
ethReceiverAddr2
}
-q
${
tokenAddrBty
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
start_ebrelayerC
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
# eth burn
result
=
$(${
CLIA
}
relayer ethereum burn
-m
5
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"burn"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddrBty
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# eth 等待 10 个区块
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
Chain33Cli
}
account balance
-a
"
${
chain33Validator1
}
"
-e
x2ethereum
)
balance_ret
"
${
result
}
"
"0"
start_ebrelayerD
result
=
$(${
Chain33Cli
}
account balance
-a
"
${
chain33Validator1
}
"
-e
x2ethereum
)
balance_ret
"
${
result
}
"
"5"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
# eth to chain33
# 在以太坊上锁定资产,然后在 chain33 上铸币,针对 eth 资产
function
TestETH2Chain33AssetsKill
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
${
CLIA
}
relayer unlock
-p
123456hzj
result
=
$(${
CLIA
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
kill_ebrelayerC
kill_ebrelayerD
# eth lock 0.1
result
=
$(${
CLIA
}
relayer ethereum lock
-m
0.1
-k
"
${
ethReceiverAddrKey1
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0.1"
# eth 等待 10 个区块
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
eth | jq
".res"
| jq
".[]"
)
balance_ret
"
${
result
}
"
"0"
start_ebrelayerC
start_ebrelayerD
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
eth | jq
".res"
| jq
".[]"
)
balance_ret
"
${
result
}
"
"0.1"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
)
balance
=
$(
cli_ret
"
${
result
}
"
"balance"
".balance"
)
kill_ebrelayerC
kill_ebrelayerD
hash
=
$(${
Chain33Cli
}
send x2ethereum burn
-a
0.1
-t
eth
-r
${
ethReceiverAddr2
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
eth | jq
".res"
| jq
".[]"
)
balance_ret
"
${
result
}
"
"0"
eth_block_wait 2
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0.1"
start_ebrelayerC
start_ebrelayerD
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
$(
echo
"
${
balance
}
+0.1"
| bc
)
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
TestETH2Chain33Erc20Kill
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
${
CLIA
}
relayer unlock
-p
123456hzj
# token4erc20 在 chain33 上先有 token,同时 mint
tokenSymbol
=
"testcc"
result
=
$(${
CLIA
}
relayer ethereum token4erc20
-s
"
${
tokenSymbol
}
"
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4erc20"
".addr"
)
# 先铸币 1000
result
=
$(${
CLIA
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
...
@@ -303,6 +473,9 @@ function TestETH2Chain33Erc20() {
...
@@ -303,6 +473,9 @@ function TestETH2Chain33Erc20() {
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
kill_ebrelayerC
kill_ebrelayerD
# lock 100
# lock 100
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33Validator1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
...
@@ -317,8 +490,17 @@ function TestETH2Chain33Erc20() {
...
@@ -317,8 +490,17 @@ function TestETH2Chain33Erc20() {
eth_block_wait
$((
maturityDegree
+
2
))
eth_block_wait
$((
maturityDegree
+
2
))
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
"
${
chain33Validator1
}
"
-t
"
${
tokenSymbol
}
"
-a
"
${
tokenAddr
}
"
| jq
".res"
| jq
".[]"
)
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
"
${
chain33Validator1
}
"
-t
"
${
tokenSymbol
}
"
-a
"
${
tokenAddr
}
"
| jq
".res"
| jq
".[]"
)
balance_ret
"
${
result
}
"
"0"
start_ebrelayerC
start_ebrelayerD
result
=
$(${
Chain33Cli
}
x2ethereum balance
-s
"
${
chain33Validator1
}
"
-t
"
${
tokenSymbol
}
"
-a
"
${
tokenAddr
}
"
| jq
".res"
| jq
".[]"
)
balance_ret
"
${
result
}
"
"100"
balance_ret
"
${
result
}
"
"100"
kill_ebrelayerC
kill_ebrelayerD
# chain33 burn 100
# chain33 burn 100
hash
=
$(${
Chain33Cli
}
send x2ethereum burn
-a
100
-t
"
${
tokenSymbol
}
"
-r
${
ethReceiverAddr2
}
-q
${
tokenAddr
}
-k
"
${
chain33Validator1
}
"
)
hash
=
$(${
Chain33Cli
}
send x2ethereum burn
-a
100
-t
"
${
tokenSymbol
}
"
-r
${
ethReceiverAddr2
}
-q
${
tokenAddr
}
-k
"
${
chain33Validator1
}
"
)
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
...
@@ -329,6 +511,8 @@ function TestETH2Chain33Erc20() {
...
@@ -329,6 +511,8 @@ function TestETH2Chain33Erc20() {
eth_block_wait 2
eth_block_wait 2
start_ebrelayerC
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
...
@@ -353,6 +537,12 @@ function main() {
...
@@ -353,6 +537,12 @@ function main() {
TestChain33ToEthAssets
TestChain33ToEthAssets
TestETH2Chain33Assets
TestETH2Chain33Assets
TestETH2Chain33Erc20
TestETH2Chain33Erc20
# kill relayer and start relayer
# TestChain33ToEthAssetsKill
# TestETH2Chain33AssetsKill
# TestETH2Chain33Erc20Kill
echo
-e
"
${
GRE
}
===========allTest
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========allTest
$FUNCNAME
end ===========
${
NOC
}
"
}
}
...
...
plugin/dapp/x2Ethereum/testsh/bridgeBankTest.sh
View file @
fc3dafc5
...
@@ -67,13 +67,13 @@ TestETH2Chain33Erc20() {
...
@@ -67,13 +67,13 @@ TestETH2Chain33Erc20() {
result
=
$(${
CLI
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
result
=
$(${
CLI
}
relayer ethereum bridgeBankAddr
)
result
=
$(${
CLI
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# ETH 2 chain33 lock 前先审批一下
# ETH 2 chain33 lock 前先审批一下
...
@@ -85,10 +85,10 @@ TestETH2Chain33Erc20() {
...
@@ -85,10 +85,10 @@ TestETH2Chain33Erc20() {
result
=
$(${
CLI
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum lock
-m
100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
cli_ret
"
${
result
}
"
"balance"
".balance"
"900"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
# ETH 2 chain33 withdraw 40
# ETH 2 chain33 withdraw 40
...
@@ -98,10 +98,10 @@ TestETH2Chain33Erc20() {
...
@@ -98,10 +98,10 @@ TestETH2Chain33Erc20() {
walitProphecyFinish
"
${
ethReceiverAddr2
}
"
"
${
tokenAddr
}
"
40
walitProphecyFinish
"
${
ethReceiverAddr2
}
"
"
${
tokenAddr
}
"
40
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"40"
cli_ret
"
${
result
}
"
"balance"
".balance"
"40"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"60"
cli_ret
"
${
result
}
"
"balance"
".balance"
"60"
# burn 60
# burn 60
...
@@ -110,10 +110,10 @@ TestETH2Chain33Erc20() {
...
@@ -110,10 +110,10 @@ TestETH2Chain33Erc20() {
walitProphecyFinish
"
${
ethReceiverAddr2
}
"
"
${
tokenAddr
}
"
100
walitProphecyFinish
"
${
ethReceiverAddr2
}
"
"
${
tokenAddr
}
"
100
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
"===========
$FUNCNAME
end ==========="
echo
"===========
$FUNCNAME
end ==========="
...
@@ -132,13 +132,13 @@ TestETH2Chain33Erc20_err() {
...
@@ -132,13 +132,13 @@ TestETH2Chain33Erc20_err() {
result
=
$(${
CLI
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum mint
-m
1000
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"mint"
cli_ret
"
${
result
}
"
"mint"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
cli_ret
"
${
result
}
"
"balance"
".balance"
"1000"
result
=
$(${
CLI
}
relayer ethereum bridgeBankAddr
)
result
=
$(${
CLI
}
relayer ethereum bridgeBankAddr
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
bridgeBankAddr
=
$(
cli_ret
"
${
result
}
"
"bridgeBankAddr"
".addr"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# ETH 2 chain33 lock 前先审批一下
# ETH 2 chain33 lock 前先审批一下
...
@@ -149,7 +149,7 @@ TestETH2Chain33Erc20_err() {
...
@@ -149,7 +149,7 @@ TestETH2Chain33Erc20_err() {
result
=
$(${
CLI
}
relayer ethereum lock
-m
200
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum lock
-m
200
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret_err
"
${
result
}
"
cli_ret_err
"
${
result
}
"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# lock 1100 err
# lock 1100 err
...
@@ -158,7 +158,7 @@ TestETH2Chain33Erc20_err() {
...
@@ -158,7 +158,7 @@ TestETH2Chain33Erc20_err() {
result
=
$(${
CLI
}
relayer ethereum lock
-m
1100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum lock
-m
1100
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret_err
"
${
result
}
"
cli_ret_err
"
${
result
}
"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
result
=
$(${
CLI
}
relayer ethereum approve
-m
300
-k
"
${
ethReceiverAddrKey1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum approve
-m
300
-k
"
${
ethReceiverAddrKey1
}
"
-t
"
${
tokenAddr
}
"
)
...
@@ -169,10 +169,10 @@ TestETH2Chain33Erc20_err() {
...
@@ -169,10 +169,10 @@ TestETH2Chain33Erc20_err() {
result
=
$(${
CLI
}
relayer ethereum lock
-m
300
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum lock
-m
300
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
cli_ret
"
${
result
}
"
"lock"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"700"
cli_ret
"
${
result
}
"
"balance"
".balance"
"700"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"300"
cli_ret
"
${
result
}
"
"balance"
".balance"
"300"
# -c 1 burn 500
# -c 1 burn 500
...
@@ -181,10 +181,10 @@ TestETH2Chain33Erc20_err() {
...
@@ -181,10 +181,10 @@ TestETH2Chain33Erc20_err() {
sleep
15
sleep
15
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Addr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
bridgeBankAddr
}
"
-t
"
${
token
Symbol
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"300"
cli_ret
"
${
result
}
"
"balance"
".balance"
"300"
echo
"===========
$FUNCNAME
end ==========="
echo
"===========
$FUNCNAME
end ==========="
...
@@ -283,10 +283,10 @@ TestChain33ToEthAssets() {
...
@@ -283,10 +283,10 @@ TestChain33ToEthAssets() {
echo
"===========
$FUNCNAME
begin ==========="
echo
"===========
$FUNCNAME
begin ==========="
result
=
$(${
CLI
}
relayer unlock
-p
123456hzj
)
result
=
$(${
CLI
}
relayer unlock
-p
123456hzj
)
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLI
}
relayer ethereum token4chain33
-s
bty
)
result
=
$(${
CLI
}
relayer ethereum token4chain33
-s
coins.
bty
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# -c 2 chain33 lock 100
# -c 2 chain33 lock 100
...
@@ -295,26 +295,26 @@ TestChain33ToEthAssets() {
...
@@ -295,26 +295,26 @@ TestChain33ToEthAssets() {
walitProphecyFinish
"
${
ethReceiverAddr1
}
"
"
${
tokenAddr
}
"
"100"
walitProphecyFinish
"
${
ethReceiverAddr1
}
"
"
${
tokenAddr
}
"
"100"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
# transfer 10
# transfer 10
result
=
$(${
CLI
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"transfer"
cli_ret
"
${
result
}
"
"transfer"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"90"
cli_ret
"
${
result
}
"
"balance"
".balance"
"90"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
result
=
$(${
CLI
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
ethReceiverAddr3
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
ethReceiverAddr3
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"transfer"
cli_ret
"
${
result
}
"
"transfer"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr3
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr3
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
result
=
$(${
CLI
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
ethReceiverAddr3
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey2
}
"
-r
"
${
ethReceiverAddr3
}
"
-t
"
${
tokenAddr
}
"
)
...
@@ -327,7 +327,7 @@ TestChain33ToEthAssets() {
...
@@ -327,7 +327,7 @@ TestChain33ToEthAssets() {
result
=
$(${
CLI
}
relayer ethereum burn
-m
90
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum burn
-m
90
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
chain33SenderAddr
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
cli_ret
"
${
result
}
"
"burn"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# brun 10 err
# brun 10 err
...
...
plugin/dapp/x2Ethereum/testsh/ebrelayerTest.sh
View file @
fc3dafc5
...
@@ -112,23 +112,23 @@ function ImportCBDKey() {
...
@@ -112,23 +112,23 @@ function ImportCBDKey() {
TestChain33ToEth
()
{
TestChain33ToEth
()
{
echo
"===========
$FUNCNAME
begin ==========="
echo
"===========
$FUNCNAME
begin ==========="
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
bty
)
result
=
$(${
CLIA
}
relayer ethereum token4chain33
-s
coins.
bty
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
for
name
in
A B C D
;
do
for
name
in
A B C D
;
do
CLI
=
"../build/ebcli_
$name
"
CLI
=
"../build/ebcli_
$name
"
# -c 2 chain33 lock 100
# -c 2 chain33 lock 100
result
=
$(${
CLI
}
relayer ethereum prophecy
-i
"
${
prophecyTx0
}
"
-m
100
-a
"
${
chain33SenderAddr
}
"
-c
2
-r
"
${
ethReceiverAddr1
}
"
-s
bty
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum prophecy
-i
"
${
prophecyTx0
}
"
-m
100
-a
"
${
chain33SenderAddr
}
"
-c
2
-r
"
${
ethReceiverAddr1
}
"
-s
coins.
bty
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"prophecy -m 1"
cli_ret
"
${
result
}
"
"prophecy -m 1"
if
[[
${
name
}
==
"A"
||
${
name
}
==
"B"
]]
;
then
if
[[
${
name
}
==
"A"
||
${
name
}
==
"B"
]]
;
then
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
elif
[[
${
name
}
==
"C"
||
${
name
}
==
"D"
]]
;
then
elif
[[
${
name
}
==
"C"
||
${
name
}
==
"D"
]]
;
then
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
cli_ret
"
${
result
}
"
"balance"
".balance"
"100"
fi
fi
done
done
...
@@ -137,10 +137,10 @@ TestChain33ToEth() {
...
@@ -137,10 +137,10 @@ TestChain33ToEth() {
result
=
$(${
CLIA
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum transfer
-m
10
-k
"
${
ethReceiverAddrKey1
}
"
-r
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
cli_ret
"
${
result
}
"
"transfer"
cli_ret
"
${
result
}
"
"transfer"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"90"
cli_ret
"
${
result
}
"
"balance"
".balance"
"90"
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
ethReceiverAddr2
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
# burn 90
# burn 90
...
...
plugin/dapp/x2Ethereum/testsh/x2ethereumTest.sh
View file @
fc3dafc5
...
@@ -153,15 +153,15 @@ function InitChain33Vilators() {
...
@@ -153,15 +153,15 @@ function InitChain33Vilators() {
function
TestChain33ToEthAssets
()
{
function
TestChain33ToEthAssets
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# token4chain33 在 以太坊 上先有 bty
# token4chain33 在 以太坊 上先有 bty
result
=
$(${
CLI
}
relayer ethereum token4chain33
-s
bty
)
result
=
$(${
CLI
}
relayer ethereum token4chain33
-s
coins.
bty
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
tokenAddr
=
$(
cli_ret
"
${
result
}
"
"token4chain33"
".addr"
)
# tokenAddr="0x9C3D40A44a2F61Ef8D46fa8C7A731C08FB16cCEF"
# tokenAddr="0x9C3D40A44a2F61Ef8D46fa8C7A731C08FB16cCEF"
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
tokenAddr
}
"
)
result
=
$(${
CLI
}
relayer ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
coins.bty
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# chain33 lock bty
# chain33 lock bty
hash
=
$(${
Chain33Cli
}
send x2ethereum lock
-a
5
-t
bty
-r
${
ethReceiverAddr1
}
-q
${
tokenAddr
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
hash
=
$(${
Chain33Cli
}
send x2ethereum lock
-a
5
-t
coins.
bty
-r
${
ethReceiverAddr1
}
-q
${
tokenAddr
}
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
block_wait
"
${
Chain33Cli
}
"
$((
maturityDegree
+
2
))
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
...
...
plugin/dapp/x2Ethereum/types/const.go
View file @
fc3dafc5
...
@@ -46,10 +46,10 @@ const (
...
@@ -46,10 +46,10 @@ const (
TyTransferToExecAction
TyTransferToExecAction
TyWithdrawFromExecAction
TyWithdrawFromExecAction
NameEth2Chain33Action
=
"Eth2Chain33
_l
ock"
NameEth2Chain33Action
=
"Eth2Chain33
L
ock"
NameWithdrawEthAction
=
"Eth2Chain33
_b
urn"
NameWithdrawEthAction
=
"Eth2Chain33
B
urn"
NameWithdrawChain33Action
=
"Chain33ToEth
_b
urn"
NameWithdrawChain33Action
=
"Chain33ToEth
B
urn"
NameChain33ToEthAction
=
"Chain33ToEth
_l
ock"
NameChain33ToEthAction
=
"Chain33ToEth
L
ock"
NameAddValidatorAction
=
"AddValidator"
NameAddValidatorAction
=
"AddValidator"
NameRemoveValidatorAction
=
"RemoveValidator"
NameRemoveValidatorAction
=
"RemoveValidator"
NameModifyPowerAction
=
"ModifyPower"
NameModifyPowerAction
=
"ModifyPower"
...
...
plugin/dapp/x2Ethereum/types/x2ethereum.go
View file @
fc3dafc5
...
@@ -109,14 +109,14 @@ func (x x2ethereumType) ActionName(tx *types.Transaction) string {
...
@@ -109,14 +109,14 @@ func (x x2ethereumType) ActionName(tx *types.Transaction) string {
// GetActionName get action name
// GetActionName get action name
func
(
action
*
X2EthereumAction
)
GetActionName
()
string
{
func
(
action
*
X2EthereumAction
)
GetActionName
()
string
{
if
action
.
Ty
==
TyEth2Chain33Action
&&
action
.
GetEth2Chain33
()
!=
nil
{
if
action
.
Ty
==
TyEth2Chain33Action
&&
action
.
GetEth2Chain33
Lock
()
!=
nil
{
return
"Eth2Chain33
_l
ock"
return
"Eth2Chain33
L
ock"
}
else
if
action
.
Ty
==
TyWithdrawEthAction
&&
action
.
Get
WithdrawEth
()
!=
nil
{
}
else
if
action
.
Ty
==
TyWithdrawEthAction
&&
action
.
Get
Eth2Chain33Burn
()
!=
nil
{
return
"Eth2Chain33
_b
urn"
return
"Eth2Chain33
B
urn"
}
else
if
action
.
Ty
==
TyWithdrawChain33Action
&&
action
.
Get
WithdrawChain33
()
!=
nil
{
}
else
if
action
.
Ty
==
TyWithdrawChain33Action
&&
action
.
Get
Chain33ToEthBurn
()
!=
nil
{
return
"Chain33ToEth
_b
urn"
return
"Chain33ToEth
B
urn"
}
else
if
action
.
Ty
==
TyChain33ToEthAction
&&
action
.
GetChain33ToEth
()
!=
nil
{
}
else
if
action
.
Ty
==
TyChain33ToEthAction
&&
action
.
GetChain33ToEth
Lock
()
!=
nil
{
return
"Chain33ToEth
_l
ock"
return
"Chain33ToEth
L
ock"
}
else
if
action
.
Ty
==
TyAddValidatorAction
&&
action
.
GetAddValidator
()
!=
nil
{
}
else
if
action
.
Ty
==
TyAddValidatorAction
&&
action
.
GetAddValidator
()
!=
nil
{
return
"AddValidator"
return
"AddValidator"
}
else
if
action
.
Ty
==
TyRemoveValidatorAction
&&
action
.
GetRemoveValidator
()
!=
nil
{
}
else
if
action
.
Ty
==
TyRemoveValidatorAction
&&
action
.
GetRemoveValidator
()
!=
nil
{
...
@@ -129,7 +129,7 @@ func (action *X2EthereumAction) GetActionName() string {
...
@@ -129,7 +129,7 @@ func (action *X2EthereumAction) GetActionName() string {
return
"Transfer"
return
"Transfer"
}
else
if
action
.
Ty
==
TyTransferToExecAction
&&
action
.
GetTransferToExec
()
!=
nil
{
}
else
if
action
.
Ty
==
TyTransferToExecAction
&&
action
.
GetTransferToExec
()
!=
nil
{
return
"TransferToExec"
return
"TransferToExec"
}
else
if
action
.
Ty
==
TyWithdrawFromExecAction
&&
action
.
GetWithdraw
()
!=
nil
{
}
else
if
action
.
Ty
==
TyWithdrawFromExecAction
&&
action
.
GetWithdraw
FromExec
()
!=
nil
{
return
"WithdrawFromExec"
return
"WithdrawFromExec"
}
}
return
"unknown-x2ethereum"
return
"unknown-x2ethereum"
...
...
plugin/dapp/x2Ethereum/types/x2ethereum.pb.go
View file @
fc3dafc5
...
@@ -53,17 +53,17 @@ func (EthBridgeStatus) EnumDescriptor() ([]byte, []int) {
...
@@ -53,17 +53,17 @@ func (EthBridgeStatus) EnumDescriptor() ([]byte, []int) {
type
X2EthereumAction
struct
{
type
X2EthereumAction
struct
{
// Types that are valid to be assigned to Value:
// Types that are valid to be assigned to Value:
// *X2EthereumAction_Eth2Chain33
// *X2EthereumAction_Eth2Chain33
Lock
// *X2EthereumAction_
WithdrawEth
// *X2EthereumAction_
Eth2Chain33Burn
// *X2EthereumAction_
WithdrawChain33
// *X2EthereumAction_
Chain33ToEthBurn
// *X2EthereumAction_Chain33ToEth
// *X2EthereumAction_Chain33ToEth
Lock
// *X2EthereumAction_AddValidator
// *X2EthereumAction_AddValidator
// *X2EthereumAction_RemoveValidator
// *X2EthereumAction_RemoveValidator
// *X2EthereumAction_ModifyPower
// *X2EthereumAction_ModifyPower
// *X2EthereumAction_SetConsensusThreshold
// *X2EthereumAction_SetConsensusThreshold
// *X2EthereumAction_Transfer
// *X2EthereumAction_Transfer
// *X2EthereumAction_TransferToExec
// *X2EthereumAction_TransferToExec
// *X2EthereumAction_Withdraw
// *X2EthereumAction_Withdraw
FromExec
Value
isX2EthereumAction_Value
`protobuf_oneof:"value"`
Value
isX2EthereumAction_Value
`protobuf_oneof:"value"`
Ty
int32
`protobuf:"varint,12,opt,name=ty,proto3" json:"ty,omitempty"`
Ty
int32
`protobuf:"varint,12,opt,name=ty,proto3" json:"ty,omitempty"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
XXX_NoUnkeyedLiteral
struct
{}
`json:"-"`
...
@@ -100,20 +100,20 @@ type isX2EthereumAction_Value interface {
...
@@ -100,20 +100,20 @@ type isX2EthereumAction_Value interface {
isX2EthereumAction_Value
()
isX2EthereumAction_Value
()
}
}
type
X2EthereumAction_Eth2Chain33
struct
{
type
X2EthereumAction_Eth2Chain33
Lock
struct
{
Eth2Chain33
*
Eth2Chain33
`protobuf:"bytes,1,opt,name=eth2Chain33
,proto3,oneof"`
Eth2Chain33
Lock
*
Eth2Chain33
`protobuf:"bytes,1,opt,name=eth2Chain33Lock
,proto3,oneof"`
}
}
type
X2EthereumAction_
WithdrawEth
struct
{
type
X2EthereumAction_
Eth2Chain33Burn
struct
{
WithdrawEth
*
Eth2Chain33
`protobuf:"bytes,2,opt,name=withdrawEth
,proto3,oneof"`
Eth2Chain33Burn
*
Eth2Chain33
`protobuf:"bytes,2,opt,name=eth2Chain33Burn
,proto3,oneof"`
}
}
type
X2EthereumAction_
WithdrawChain33
struct
{
type
X2EthereumAction_
Chain33ToEthBurn
struct
{
WithdrawChain33
*
Chain33ToEth
`protobuf:"bytes,3,opt,name=withdrawChain33
,proto3,oneof"`
Chain33ToEthBurn
*
Chain33ToEth
`protobuf:"bytes,3,opt,name=chain33ToEthBurn
,proto3,oneof"`
}
}
type
X2EthereumAction_Chain33ToEth
struct
{
type
X2EthereumAction_Chain33ToEth
Lock
struct
{
Chain33ToEth
*
Chain33ToEth
`protobuf:"bytes,4,opt,name=chain33ToEth
,proto3,oneof"`
Chain33ToEth
Lock
*
Chain33ToEth
`protobuf:"bytes,4,opt,name=chain33ToEthLock
,proto3,oneof"`
}
}
type
X2EthereumAction_AddValidator
struct
{
type
X2EthereumAction_AddValidator
struct
{
...
@@ -140,17 +140,17 @@ type X2EthereumAction_TransferToExec struct {
...
@@ -140,17 +140,17 @@ type X2EthereumAction_TransferToExec struct {
TransferToExec
*
types
.
AssetsTransferToExec
`protobuf:"bytes,10,opt,name=transferToExec,proto3,oneof"`
TransferToExec
*
types
.
AssetsTransferToExec
`protobuf:"bytes,10,opt,name=transferToExec,proto3,oneof"`
}
}
type
X2EthereumAction_Withdraw
struct
{
type
X2EthereumAction_Withdraw
FromExec
struct
{
Withdraw
*
types
.
AssetsWithdraw
`protobuf:"bytes,11,opt,name=withdraw
,proto3,oneof"`
Withdraw
FromExec
*
types
.
AssetsWithdraw
`protobuf:"bytes,11,opt,name=withdrawFromExec
,proto3,oneof"`
}
}
func
(
*
X2EthereumAction_Eth2Chain33
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_Eth2Chain33
Lock
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_
WithdrawEth
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_
Eth2Chain33Burn
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_
WithdrawChain33
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_
Chain33ToEthBurn
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_Chain33ToEth
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_Chain33ToEth
Lock
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_AddValidator
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_AddValidator
)
isX2EthereumAction_Value
()
{}
...
@@ -164,7 +164,7 @@ func (*X2EthereumAction_Transfer) isX2EthereumAction_Value() {}
...
@@ -164,7 +164,7 @@ func (*X2EthereumAction_Transfer) isX2EthereumAction_Value() {}
func
(
*
X2EthereumAction_TransferToExec
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_TransferToExec
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_Withdraw
)
isX2EthereumAction_Value
()
{}
func
(
*
X2EthereumAction_Withdraw
FromExec
)
isX2EthereumAction_Value
()
{}
func
(
m
*
X2EthereumAction
)
GetValue
()
isX2EthereumAction_Value
{
func
(
m
*
X2EthereumAction
)
GetValue
()
isX2EthereumAction_Value
{
if
m
!=
nil
{
if
m
!=
nil
{
...
@@ -173,30 +173,30 @@ func (m *X2EthereumAction) GetValue() isX2EthereumAction_Value {
...
@@ -173,30 +173,30 @@ func (m *X2EthereumAction) GetValue() isX2EthereumAction_Value {
return
nil
return
nil
}
}
func
(
m
*
X2EthereumAction
)
GetEth2Chain33
()
*
Eth2Chain33
{
func
(
m
*
X2EthereumAction
)
GetEth2Chain33
Lock
()
*
Eth2Chain33
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_Eth2Chain33
);
ok
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_Eth2Chain33
Lock
);
ok
{
return
x
.
Eth2Chain33
return
x
.
Eth2Chain33
Lock
}
}
return
nil
return
nil
}
}
func
(
m
*
X2EthereumAction
)
Get
WithdrawEth
()
*
Eth2Chain33
{
func
(
m
*
X2EthereumAction
)
Get
Eth2Chain33Burn
()
*
Eth2Chain33
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_
WithdrawEth
);
ok
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_
Eth2Chain33Burn
);
ok
{
return
x
.
WithdrawEth
return
x
.
Eth2Chain33Burn
}
}
return
nil
return
nil
}
}
func
(
m
*
X2EthereumAction
)
Get
WithdrawChain33
()
*
Chain33ToEth
{
func
(
m
*
X2EthereumAction
)
Get
Chain33ToEthBurn
()
*
Chain33ToEth
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_
WithdrawChain33
);
ok
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_
Chain33ToEthBurn
);
ok
{
return
x
.
WithdrawChain33
return
x
.
Chain33ToEthBurn
}
}
return
nil
return
nil
}
}
func
(
m
*
X2EthereumAction
)
GetChain33ToEth
()
*
Chain33ToEth
{
func
(
m
*
X2EthereumAction
)
GetChain33ToEth
Lock
()
*
Chain33ToEth
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_Chain33ToEth
);
ok
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_Chain33ToEth
Lock
);
ok
{
return
x
.
Chain33ToEth
return
x
.
Chain33ToEth
Lock
}
}
return
nil
return
nil
}
}
...
@@ -243,9 +243,9 @@ func (m *X2EthereumAction) GetTransferToExec() *types.AssetsTransferToExec {
...
@@ -243,9 +243,9 @@ func (m *X2EthereumAction) GetTransferToExec() *types.AssetsTransferToExec {
return
nil
return
nil
}
}
func
(
m
*
X2EthereumAction
)
GetWithdraw
()
*
types
.
AssetsWithdraw
{
func
(
m
*
X2EthereumAction
)
GetWithdraw
FromExec
()
*
types
.
AssetsWithdraw
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_Withdraw
);
ok
{
if
x
,
ok
:=
m
.
GetValue
()
.
(
*
X2EthereumAction_Withdraw
FromExec
);
ok
{
return
x
.
Withdraw
return
x
.
Withdraw
FromExec
}
}
return
nil
return
nil
}
}
...
@@ -260,17 +260,17 @@ func (m *X2EthereumAction) GetTy() int32 {
...
@@ -260,17 +260,17 @@ func (m *X2EthereumAction) GetTy() int32 {
// XXX_OneofWrappers is for the internal use of the proto package.
// XXX_OneofWrappers is for the internal use of the proto package.
func
(
*
X2EthereumAction
)
XXX_OneofWrappers
()
[]
interface
{}
{
func
(
*
X2EthereumAction
)
XXX_OneofWrappers
()
[]
interface
{}
{
return
[]
interface
{}{
return
[]
interface
{}{
(
*
X2EthereumAction_Eth2Chain33
)(
nil
),
(
*
X2EthereumAction_Eth2Chain33
Lock
)(
nil
),
(
*
X2EthereumAction_
WithdrawEth
)(
nil
),
(
*
X2EthereumAction_
Eth2Chain33Burn
)(
nil
),
(
*
X2EthereumAction_
WithdrawChain33
)(
nil
),
(
*
X2EthereumAction_
Chain33ToEthBurn
)(
nil
),
(
*
X2EthereumAction_Chain33ToEth
)(
nil
),
(
*
X2EthereumAction_Chain33ToEth
Lock
)(
nil
),
(
*
X2EthereumAction_AddValidator
)(
nil
),
(
*
X2EthereumAction_AddValidator
)(
nil
),
(
*
X2EthereumAction_RemoveValidator
)(
nil
),
(
*
X2EthereumAction_RemoveValidator
)(
nil
),
(
*
X2EthereumAction_ModifyPower
)(
nil
),
(
*
X2EthereumAction_ModifyPower
)(
nil
),
(
*
X2EthereumAction_SetConsensusThreshold
)(
nil
),
(
*
X2EthereumAction_SetConsensusThreshold
)(
nil
),
(
*
X2EthereumAction_Transfer
)(
nil
),
(
*
X2EthereumAction_Transfer
)(
nil
),
(
*
X2EthereumAction_TransferToExec
)(
nil
),
(
*
X2EthereumAction_TransferToExec
)(
nil
),
(
*
X2EthereumAction_Withdraw
)(
nil
),
(
*
X2EthereumAction_Withdraw
FromExec
)(
nil
),
}
}
}
}
...
@@ -1929,93 +1929,94 @@ func init() {
...
@@ -1929,93 +1929,94 @@ func init() {
}
}
var
fileDescriptor_1dd1834a817ceb21
=
[]
byte
{
var
fileDescriptor_1dd1834a817ceb21
=
[]
byte
{
// 1368 bytes of a gzipped FileDescriptorProto
// 1379 bytes of a gzipped FileDescriptorProto
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xdc
,
0x58
,
0xcb
,
0x6e
,
0xdb
,
0x46
,
0x1f
,
0x8b
,
0x08
,
0x00
,
0x00
,
0x00
,
0x00
,
0x00
,
0x02
,
0xff
,
0xdc
,
0x58
,
0xcd
,
0x6e
,
0xdb
,
0x46
,
0x17
,
0x36
,
0x45
,
0xc9
,
0x8e
,
0x8e
,
0x64
,
0x5b
,
0x99
,
0x44
,
0xfe
,
0x09
,
0xff
,
0x69
,
0x22
,
0x10
,
0x10
,
0x16
,
0x45
,
0xc9
,
0x8e
,
0xc6
,
0xb2
,
0xad
,
0x6c
,
0x22
,
0x97
,
0x70
,
0xd3
,
0x44
,
0x20
,
0xfa
,
0xbd
,
0x18
,
0x69
,
0x6b
,
0x14
,
0x76
,
0x7a
,
0xc9
,
0x26
,
0x8d
,
0x2f
,
0x4a
,
0x65
,
0xa0
,
0x69
,
0xdc
,
0x63
,
0xa4
,
0xad
,
0x51
,
0xd8
,
0x29
,
0xda
,
0x5c
,
0xd2
,
0xd8
,
0xb2
,
0x5c
,
0x19
,
0x48
,
0x1a
,
0x77
,
0x91
,
0xd2
,
0x0b
,
0x90
,
0xcd
,
0x98
,
0x9c
,
0x98
,
0x44
,
0x29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0x13
,
0x15
,
0xb6
,
0x4c
,
0x1b
,
0xda
,
0x5c
,
0xdf
,
0x44
,
0x93
,
0x49
,
0x5b
,
0xa0
,
0x94
,
0x86
,
0xae
,
0x1f
,
0x9e
,
0x27
,
0x80
,
0xd8
,
0x87
,
0x9d
,
0x15
,
0x01
,
0x0f
,
0xa7
,
0x8e
,
0x43
,
0xdd
,
0x7f
,
0x2e
,
0xb7
,
0x69
,
0x7d
,
0x00
,
0xa2
,
0x2e
,
0xdc
,
0x3c
,
0xa6
,
0xa1
,
0xe7
,
0x87
,
0x67
,
0xe3
,
0x58
,
0x83
,
0x0d
,
0x74
,
0x1b
,
0x3a
,
0x4f
,
0x88
,
0x1f
,
0x50
,
0x57
,
0x43
,
0x6b
,
0x7b
,
0x6d
,
0x09
,
0x41
,
0xcc
,
0xc3
,
0x4e
,
0x4d
,
0x90
,
0x4f
,
0xa6
,
0xae
,
0x4b
,
0xe3
,
0x58
,
0x23
,
0x1b
,
0xe8
,
0x80
,
0xfc
,
0x57
,
0xa8
,
0xb3
,
0x55
,
0xf9
,
0xeb
,
0xd2
,
0xfe
,
0x3f
,
0x01
,
0x00
,
0x00
,
0xff
,
0xff
,
0x36
,
0x74
,
0x0e
,
0x89
,
0x1f
,
0x50
,
0x4f
,
0xa3
,
0xd6
,
0x77
,
0xda
,
0x00
,
0xf9
,
0xff
,
0x55
,
0xa7
,
0xa6
,
0x2d
,
0xf8
,
0xf1
,
0x9a
,
0x12
,
0x00
,
0x00
,
0x4b
,
0xf2
,
0x7f
,
0xa8
,
0xdd
,
0x7f
,
0x03
,
0x00
,
0x00
,
0xff
,
0xff
,
0x3a
,
0xa6
,
0xbf
,
0xaf
,
0xc4
,
0x12
,
0x00
,
0x00
,
}
}
// Reference imports to suppress errors if they are not otherwise used.
// Reference imports to suppress errors if they are not otherwise used.
...
...
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