Commit 8137e316 authored by vipwzw's avatar vipwzw

auto ci

parent 84bbd035
...@@ -243,7 +243,7 @@ function TestETH2Chain33Assets() { ...@@ -243,7 +243,7 @@ function TestETH2Chain33Assets() {
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额 # chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# is_equal "${result}" "2000000000000000" # is_equal "${result}" "2000000000000000"
# 原来的数额 # 原来的数额
result=$(${CLIA} ethereum balance -o "${ethTestAddr2}") result=$(${CLIA} ethereum balance -o "${ethTestAddr2}")
...@@ -256,7 +256,7 @@ function TestETH2Chain33Assets() { ...@@ -256,7 +256,7 @@ function TestETH2Chain33Assets() {
echo "check the balance on chain33" echo "check the balance on chain33"
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# is_equal "${result}" "1700000000000000" # is_equal "${result}" "1700000000000000"
# 查询 ETH 这端 bridgeBank 地址 0 # 查询 ETH 这端 bridgeBank 地址 0
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}")
...@@ -441,11 +441,11 @@ function TestETH2Chain33BUSD() { ...@@ -441,11 +441,11 @@ function TestETH2Chain33BUSD() {
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额 # chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result=$(${Chain33Cli} evm query -a "${chain33BUSDBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33BUSDBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 12 * le8 # 结果是 12 * le8
# is_equal "${result}" "3000000000000000000" # is_equal "${result}" "3000000000000000000"
# 原来的数额 0 # 原来的数额 0
result=$(${CLIA} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumBUSDERC20TokenAddr}") result=$(${CLIA} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumBUSDERC20TokenAddr}")
# cli_ret "${result}" "balance" ".balance" "0" # cli_ret "${result}" "balance" ".balance" "0"
echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum' echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum'
result=$(${CLIA} chain33 burn -m 1 -k "${chain33ReceiverAddrKey}" -r "${ethReceiverAddr1}" -t "${chain33BUSDBridgeTokenAddr}") result=$(${CLIA} chain33 burn -m 1 -k "${chain33ReceiverAddrKey}" -r "${ethReceiverAddr1}" -t "${chain33BUSDBridgeTokenAddr}")
...@@ -456,7 +456,7 @@ function TestETH2Chain33BUSD() { ...@@ -456,7 +456,7 @@ function TestETH2Chain33BUSD() {
echo "check the balance on chain33" echo "check the balance on chain33"
result=$(${Chain33Cli} evm query -a "${chain33BUSDBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33BUSDBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 12-5 * le8 # 结果是 12-5 * le8
# is_equal "${result}" "2000000000000000000" # is_equal "${result}" "2000000000000000000"
# 查询 ETH 这端 bridgeBank 地址 7 # 查询 ETH 这端 bridgeBank 地址 7
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBUSDERC20TokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBUSDERC20TokenAddr}")
...@@ -742,13 +742,13 @@ function up_relayer_toml() { ...@@ -742,13 +742,13 @@ function up_relayer_toml() {
# 在第 line 行后面 新增合约地址 # 在第 line 行后面 新增合约地址
sed -i ''"${line}"' a ChainName="user.p.para."' "./relayer.toml" sed -i ''"${line}"' a ChainName="user.p.para."' "./relayer.toml"
# # shellcheck disable=SC2155 # # shellcheck disable=SC2155
# local line=$(delete_line_show "./relayer.toml" "maturityDegree=10") # local line=$(delete_line_show "./relayer.toml" "maturityDegree=10")
# sed -i ''"${line}"' a maturityDegree=1' "./relayer.toml" # sed -i ''"${line}"' a maturityDegree=1' "./relayer.toml"
# #
# # shellcheck disable=SC2155 # # shellcheck disable=SC2155
# local line=$(delete_line_show "./relayer.toml" "EthMaturityDegree=10") # local line=$(delete_line_show "./relayer.toml" "EthMaturityDegree=10")
# sed -i ''"${line}"' a EthMaturityDegree=1' "./relayer.toml" # sed -i ''"${line}"' a EthMaturityDegree=1' "./relayer.toml"
} }
function StartDockerRelayerDeploy() { function StartDockerRelayerDeploy() {
...@@ -792,17 +792,17 @@ function StartDockerRelayerDeploy() { ...@@ -792,17 +792,17 @@ function StartDockerRelayerDeploy() {
updata_toml_start_bcd updata_toml_start_bcd
# 设置 token 地址 # 设置 token 地址
# offline_create_bridge_token_eth_BTY # offline_create_bridge_token_eth_BTY
# offline_deploy_erc20_eth_BYC # offline_deploy_erc20_eth_BYC
# offline_deploy_erc20_eth_USDT # offline_deploy_erc20_eth_USDT
# offline_create_bridge_token_eth_YCC # offline_create_bridge_token_eth_YCC
# offline_create_bridge_token_eth_ZBC # offline_create_bridge_token_eth_ZBC
# #
# offline_create_bridge_token_chain33_ETH "BNB" # offline_create_bridge_token_chain33_ETH "BNB"
# offline_create_bridge_token_chain33_BYC # offline_create_bridge_token_chain33_BYC
# offline_deploy_erc20_chain33_YCC # offline_deploy_erc20_chain33_YCC
# offline_deploy_erc20_chain33_ZBC # offline_deploy_erc20_chain33_ZBC
# offline_create_bridge_token_chain33_USDT # offline_create_bridge_token_chain33_USDT
offline_create_bridge_token_chain33_BUSD offline_create_bridge_token_chain33_BUSD
...@@ -811,12 +811,12 @@ function StartDockerRelayerDeploy() { ...@@ -811,12 +811,12 @@ function StartDockerRelayerDeploy() {
# shellcheck disable=SC2086 # shellcheck disable=SC2086
{ {
# docker cp "${chain33EthBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33EthBridgeTokenAddr}.abi # docker cp "${chain33EthBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33EthBridgeTokenAddr}.abi
# docker cp "${chain33BycBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33BycBridgeTokenAddr}.abi # docker cp "${chain33BycBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33BycBridgeTokenAddr}.abi
# docker cp "${chain33USDTBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33USDTBridgeTokenAddr}.abi # docker cp "${chain33USDTBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33USDTBridgeTokenAddr}.abi
docker cp "${chain33BUSDBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33BUSDBridgeTokenAddr}.abi docker cp "${chain33BUSDBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33BUSDBridgeTokenAddr}.abi
# docker cp "${chain33YccERC20TokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33YccERC20TokenAddr}.abi # docker cp "${chain33YccERC20TokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33YccERC20TokenAddr}.abi
# docker cp "${ethereumYccBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${ethereumYccBridgeTokenAddr}.abi # docker cp "${ethereumYccBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${ethereumYccBridgeTokenAddr}.abi
} }
# 重启,因为relayerA的验证人地址和部署人的地址是一样的,所以需要重新启动relayer,更新nonce # 重启,因为relayerA的验证人地址和部署人的地址是一样的,所以需要重新启动relayer,更新nonce
...@@ -1059,30 +1059,30 @@ function Testethereum2EVMToChain33_usdt() { ...@@ -1059,30 +1059,30 @@ function Testethereum2EVMToChain33_usdt() {
} }
function test_all() { function test_all() {
# TestETH2Chain33Assets # TestETH2Chain33Assets
# TestChain33ToEthAssets # TestChain33ToEthAssets
# TestChain33ToEthZBCAssets # TestChain33ToEthZBCAssets
# TestETH2Chain33Byc # TestETH2Chain33Byc
# TestETH2Chain33USDT # TestETH2Chain33USDT
TestETH2Chain33BUSD TestETH2Chain33BUSD
# lockBty # lockBty
# lockChain33Ycc # lockChain33Ycc
# lockEth # lockEth
# lockEthByc # lockEthByc
# lockEthUSDT # lockEthUSDT
# #
# # 离线多签地址转入阈值设大 # # 离线多签地址转入阈值设大
# offline_set_offline_token_Bty 100000000000000 10 # offline_set_offline_token_Bty 100000000000000 10
# offline_set_offline_token_Chain33Ycc 100000000000000 10 # offline_set_offline_token_Chain33Ycc 100000000000000 10
# offline_set_offline_token_Eth 100000000000000 10 # offline_set_offline_token_Eth 100000000000000 10
# offline_set_offline_token_EthByc 100000000000000 10 # offline_set_offline_token_EthByc 100000000000000 10
# offline_set_offline_token_EthUSDT 100000000000000 10 # offline_set_offline_token_EthUSDT 100000000000000 10
# DeployEvmxgo # DeployEvmxgo
# TestETH2EVMToChain33 # TestETH2EVMToChain33
# Testethereum2EVMToChain33_byc # Testethereum2EVMToChain33_byc
# Testethereum2EVMToChain33_usdt # Testethereum2EVMToChain33_usdt
} }
function get_cli() { function get_cli() {
...@@ -1098,7 +1098,7 @@ function get_cli() { ...@@ -1098,7 +1098,7 @@ function get_cli() {
CLIC="docker exec ${dockerNamePrefix}_ebrelayerc_1 /root/ebcli_A" CLIC="docker exec ${dockerNamePrefix}_ebrelayerc_1 /root/ebcli_A"
CLID="docker exec ${dockerNamePrefix}_ebrelayerd_1 /root/ebcli_A" CLID="docker exec ${dockerNamePrefix}_ebrelayerd_1 /root/ebcli_A"
# docker_ganachetest_ip=$(get_docker_addr "${dockerNamePrefix}_ganachetest_1") # docker_ganachetest_ip=$(get_docker_addr "${dockerNamePrefix}_ganachetest_1")
Boss4xCLI="docker exec ${dockerNamePrefix}_ebrelayera_1 /root/boss4x --rpc_laddr http://${docker_chain33_ip}:8901 --rpc_laddr_ethereum ${BscProviderUrl} --paraName user.p.para. --chainEthId 56" Boss4xCLI="docker exec ${dockerNamePrefix}_ebrelayera_1 /root/boss4x --rpc_laddr http://${docker_chain33_ip}:8901 --rpc_laddr_ethereum ${BscProviderUrl} --paraName user.p.para. --chainEthId 56"
echo "${Boss4xCLI}" echo "${Boss4xCLI}"
...@@ -1142,4 +1142,3 @@ function AllRelayerMainTest() { ...@@ -1142,4 +1142,3 @@ function AllRelayerMainTest() {
echo_addrs echo_addrs
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -288,7 +288,7 @@ function TestETH2Chain33Assets() { ...@@ -288,7 +288,7 @@ function TestETH2Chain33Assets() {
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额 # chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# is_equal "${result}" "2000000000000000" # is_equal "${result}" "2000000000000000"
# 原来的数额 # 原来的数额
result=$(${CLIA} ethereum balance -o "${ethTestAddr2}") result=$(${CLIA} ethereum balance -o "${ethTestAddr2}")
...@@ -301,7 +301,7 @@ function TestETH2Chain33Assets() { ...@@ -301,7 +301,7 @@ function TestETH2Chain33Assets() {
echo "check the balance on chain33" echo "check the balance on chain33"
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# is_equal "${result}" "1700000000000000" # is_equal "${result}" "1700000000000000"
# 查询 ETH 这端 bridgeBank 地址 0 # 查询 ETH 这端 bridgeBank 地址 0
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}")
...@@ -1036,7 +1036,7 @@ function AllRelayerMainTest() { ...@@ -1036,7 +1036,7 @@ function AllRelayerMainTest() {
CLIC="docker exec ${dockerNamePrefix}_ebrelayerc_1 /root/ebcli_A" CLIC="docker exec ${dockerNamePrefix}_ebrelayerc_1 /root/ebcli_A"
CLID="docker exec ${dockerNamePrefix}_ebrelayerd_1 /root/ebcli_A" CLID="docker exec ${dockerNamePrefix}_ebrelayerd_1 /root/ebcli_A"
# docker_ganachetest_ip=$(get_docker_addr "${dockerNamePrefix}_ganachetest_1") # docker_ganachetest_ip=$(get_docker_addr "${dockerNamePrefix}_ganachetest_1")
Boss4xCLI="docker exec ${dockerNamePrefix}_ebrelayera_1 /root/boss4x --rpc_laddr http://${docker_chain33_ip}:8901 --rpc_laddr_ethereum ${BscProviderUrl} --paraName user.p.para. --chainEthId 256" Boss4xCLI="docker exec ${dockerNamePrefix}_ebrelayera_1 /root/boss4x --rpc_laddr http://${docker_chain33_ip}:8901 --rpc_laddr_ethereum ${BscProviderUrl} --paraName user.p.para. --chainEthId 256"
echo "${Boss4xCLI}" echo "${Boss4xCLI}"
......
...@@ -308,9 +308,9 @@ function offline_transfer_multisign_Eth_test() { ...@@ -308,9 +308,9 @@ function offline_transfer_multisign_Eth_test() {
sleep 10 sleep 10
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}")
# cli_ret "${result}" "balance" ".balance" "16" # cli_ret "${result}" "balance" ".balance" "16"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}")
# cli_ret "${result}" "balance" ".balance" "20" # cli_ret "${result}" "balance" ".balance" "20"
# transfer # transfer
# shellcheck disable=SC2154 # shellcheck disable=SC2154
...@@ -322,9 +322,9 @@ function offline_transfer_multisign_Eth_test() { ...@@ -322,9 +322,9 @@ function offline_transfer_multisign_Eth_test() {
sleep 10 sleep 10
result=$(${CLIA} ethereum balance -o "${ethMultisignA}") result=$(${CLIA} ethereum balance -o "${ethMultisignA}")
# cli_ret "${result}" "balance" ".balance" "1005" # cli_ret "${result}" "balance" ".balance" "1005"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}")
# cli_ret "${result}" "balance" ".balance" "15" # cli_ret "${result}" "balance" ".balance" "15"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
......
...@@ -2,9 +2,10 @@ package offline ...@@ -2,9 +2,10 @@ package offline
import ( import (
"fmt" "fmt"
"github.com/ethereum/go-ethereum/accounts/abi"
"strings" "strings"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/33cn/plugin/plugin/dapp/cross2eth/contracts/contracts4eth/generated" "github.com/33cn/plugin/plugin/dapp/cross2eth/contracts/contracts4eth/generated"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
package types package types
import ( import (
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( const (
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
package types package types
import ( import (
reflect "reflect"
sync "sync"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl" protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
) )
const ( const (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment