Commit ba9595e2 authored by vipwzw's avatar vipwzw

auto ci

parent 2f116650
...@@ -66,7 +66,7 @@ function TestETH2Chain33Assets_proxy() { ...@@ -66,7 +66,7 @@ function TestETH2Chain33Assets_proxy() {
echo -e "${IYellow} ethBridgeBank lock 后金额 ${NOC}" echo -e "${IYellow} ethBridgeBank lock 后金额 ${NOC}"
result=$(${CLIP} ethereum balance -o "${ethBridgeBank}") result=$(${CLIP} ethereum balance -o "${ethBridgeBank}")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let ethBridgeBankBalanceEnd=${ethBridgeBankBalancebf}+${lockAmount1} let ethBridgeBankBalanceEnd=ethBridgeBankBalancebf+lockAmount1
cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}" cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
...@@ -77,7 +77,7 @@ function TestETH2Chain33Assets_proxy() { ...@@ -77,7 +77,7 @@ function TestETH2Chain33Assets_proxy() {
# shellcheck disable=SC2154 # shellcheck disable=SC2154
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33RBalancelock=${lockAmount1}*${le8}+${chain33RBalancebf} let chain33RBalancelock=lockAmount1*le8+chain33RBalancebf
is_equal "${result}" "${chain33RBalancelock}" is_equal "${result}" "${chain33RBalancelock}"
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}"
...@@ -110,13 +110,13 @@ function TestETH2Chain33Assets_proxy() { ...@@ -110,13 +110,13 @@ function TestETH2Chain33Assets_proxy() {
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}"
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33Validatorsp})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33Validatorsp})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33VspBalancewithdraw=${lockAmount1}*${le8}+${chain33VspBalancebf} let chain33VspBalancewithdraw=lockAmount1*le8+chain33VspBalancebf
is_equal "${result}" "${chain33VspBalancewithdraw}" is_equal "${result}" "${chain33VspBalancewithdraw}"
echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 ${NOC}"
result=$(${CLIP} ethereum balance -o "${ethTestAddr2}" | jq -r ".balance") result=$(${CLIP} ethereum balance -o "${ethTestAddr2}" | jq -r ".balance")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let ethT2BalanceEnd=${ethT2Balancebf}+${lockAmount1}-1 let ethT2BalanceEnd=ethT2Balancebf+lockAmount1-1
is_equal "${result}" "${ethT2BalanceEnd}" is_equal "${result}" "${ethT2BalanceEnd}"
echo -e "${IYellow} ethValidatorAddrp ethereum 代理地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} ethValidatorAddrp ethereum 代理地址 withdraw 后金额 ${NOC}"
...@@ -124,7 +124,7 @@ function TestETH2Chain33Assets_proxy() { ...@@ -124,7 +124,7 @@ function TestETH2Chain33Assets_proxy() {
if [[ $(echo "${ethPBalancebf}-${lockAmount1}+1 < $result" | bc) ]]; then if [[ $(echo "${ethPBalancebf}-${lockAmount1}+1 < $result" | bc) ]]; then
echo -e "${RED}error $ethPBalanceEnd 小于 $result, 应该大于 $ethPBalanceEnd 扣了一点点手续费 ${NOC}" echo -e "${RED}error $ethPBalanceEnd 小于 $result, 应该大于 $ethPBalanceEnd 扣了一点点手续费 ${NOC}"
# exit 1 # exit 1
fi fi
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
...@@ -160,7 +160,7 @@ function TestETH2Chain33Assets_proxy_excess() { ...@@ -160,7 +160,7 @@ function TestETH2Chain33Assets_proxy_excess() {
echo -e "${IYellow} ethBridgeBank lock 后金额 ${NOC}" echo -e "${IYellow} ethBridgeBank lock 后金额 ${NOC}"
result=$(${CLIP} ethereum balance -o "${ethBridgeBank}") result=$(${CLIP} ethereum balance -o "${ethBridgeBank}")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let ethBridgeBankBalanceEnd=${ethBridgeBankBalancebf}+${lockAmount1} let ethBridgeBankBalanceEnd=ethBridgeBankBalancebf+lockAmount1
cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}" cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
...@@ -171,7 +171,7 @@ function TestETH2Chain33Assets_proxy_excess() { ...@@ -171,7 +171,7 @@ function TestETH2Chain33Assets_proxy_excess() {
# shellcheck disable=SC2154 # shellcheck disable=SC2154
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33RBalancelock=${lockAmount1}*${le8}+${chain33RBalancebf} let chain33RBalancelock=lockAmount1*le8+chain33RBalancebf
is_equal "${result}" "${chain33RBalancelock}" is_equal "${result}" "${chain33RBalancelock}"
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}"
...@@ -204,7 +204,7 @@ function TestETH2Chain33Assets_proxy_excess() { ...@@ -204,7 +204,7 @@ function TestETH2Chain33Assets_proxy_excess() {
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}"
result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33Validatorsp})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33Validatorsp})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33VspBalancewithdraw=${lockAmount1}*${le8}+${chain33VspBalancebf} let chain33VspBalancewithdraw=lockAmount1*le8+chain33VspBalancebf
is_equal "${result}" "${chain33VspBalancewithdraw}" is_equal "${result}" "${chain33VspBalancewithdraw}"
echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样${NOC}" echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样${NOC}"
...@@ -246,7 +246,7 @@ function TestETH2Chain33USDT_proxy() { ...@@ -246,7 +246,7 @@ function TestETH2Chain33USDT_proxy() {
echo -e "${IYellow} 查询 ETH 这端 ethBridgeBank lock 后金额 ${NOC}" echo -e "${IYellow} 查询 ETH 这端 ethBridgeBank lock 后金额 ${NOC}"
result=$(${CLIP} ethereum balance -o "${ethBridgeBank}" -t "${ethereumUSDTERC20TokenAddr}") result=$(${CLIP} ethereum balance -o "${ethBridgeBank}" -t "${ethereumUSDTERC20TokenAddr}")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let ethBridgeBankBalanceEnd=${ethBridgeBankBalancebf}+${lockAmount1} let ethBridgeBankBalanceEnd=ethBridgeBankBalancebf+lockAmount1
cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}" cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}"
sleep "${maturityDegree}" sleep "${maturityDegree}"
...@@ -256,7 +256,7 @@ function TestETH2Chain33USDT_proxy() { ...@@ -256,7 +256,7 @@ function TestETH2Chain33USDT_proxy() {
# shellcheck disable=SC2154 # shellcheck disable=SC2154
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33RBalancelock=${lockAmount1}*${le8}+${chain33RBalancebf} let chain33RBalancelock=lockAmount1*le8+chain33RBalancebf
is_equal "${result}" "${chain33RBalancelock}" is_equal "${result}" "${chain33RBalancelock}"
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}"
...@@ -288,19 +288,19 @@ function TestETH2Chain33USDT_proxy() { ...@@ -288,19 +288,19 @@ function TestETH2Chain33USDT_proxy() {
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}"
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33Validatorsp})") result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33Validatorsp})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33VspBalancewithdraw=${lockAmount1}*${le8}+${chain33VspBalancebf} let chain33VspBalancewithdraw=lockAmount1*le8+chain33VspBalancebf
is_equal "${result}" "${chain33VspBalancewithdraw}" is_equal "${result}" "${chain33VspBalancewithdraw}"
echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 ${NOC}"
result=$(${CLIP} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumUSDTERC20TokenAddr}" | jq -r ".balance") result=$(${CLIP} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumUSDTERC20TokenAddr}" | jq -r ".balance")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let ethT2BalanceEnd=${ethT2Balancebf}+${lockAmount1}-1 let ethT2BalanceEnd=ethT2Balancebf+lockAmount1-1
is_equal "${result}" "${ethT2BalanceEnd}" is_equal "${result}" "${ethT2BalanceEnd}"
echo -e "${IYellow} ethValidatorAddrp ethereum 代理地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} ethValidatorAddrp ethereum 代理地址 withdraw 后金额 ${NOC}"
result=$(${CLIP} ethereum balance -o "${ethValidatorAddrp}" -t "${ethereumUSDTERC20TokenAddr}" | jq -r ".balance") result=$(${CLIP} ethereum balance -o "${ethValidatorAddrp}" -t "${ethereumUSDTERC20TokenAddr}" | jq -r ".balance")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let ethPBalanceEnd=${ethPBalancebf}-${lockAmount1}+1 let ethPBalanceEnd=ethPBalancebf-lockAmount1+1
is_equal "${result}" "${ethPBalanceEnd}" is_equal "${result}" "${ethPBalanceEnd}"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
...@@ -334,7 +334,7 @@ function TestETH2Chain33USDT_proxy_excess() { ...@@ -334,7 +334,7 @@ function TestETH2Chain33USDT_proxy_excess() {
echo -e "${IYellow} 查询 ETH 这端 ethBridgeBank lock 后金额 ${NOC}" echo -e "${IYellow} 查询 ETH 这端 ethBridgeBank lock 后金额 ${NOC}"
result=$(${CLIP} ethereum balance -o "${ethBridgeBank}" -t "${ethereumUSDTERC20TokenAddr}") result=$(${CLIP} ethereum balance -o "${ethBridgeBank}" -t "${ethereumUSDTERC20TokenAddr}")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let ethBridgeBankBalanceEnd=${ethBridgeBankBalancebf}+${lockAmount1} let ethBridgeBankBalanceEnd=ethBridgeBankBalancebf+lockAmount1
cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}" cli_ret "${result}" "balance" ".balance" "${ethBridgeBankBalanceEnd}"
sleep "${maturityDegree}" sleep "${maturityDegree}"
...@@ -344,7 +344,7 @@ function TestETH2Chain33USDT_proxy_excess() { ...@@ -344,7 +344,7 @@ function TestETH2Chain33USDT_proxy_excess() {
# shellcheck disable=SC2154 # shellcheck disable=SC2154
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33ReceiverAddr})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33RBalancelock=${lockAmount1}*${le8}+${chain33RBalancebf} let chain33RBalancelock=lockAmount1*le8+chain33RBalancebf
is_equal "${result}" "${chain33RBalancelock}" is_equal "${result}" "${chain33RBalancelock}"
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 lock 后金额 ${NOC}"
...@@ -376,7 +376,7 @@ function TestETH2Chain33USDT_proxy_excess() { ...@@ -376,7 +376,7 @@ function TestETH2Chain33USDT_proxy_excess() {
echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}" echo -e "${IYellow} chain33Validatorsp chain33 代理地址 withdraw 后金额 ${NOC}"
result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33Validatorsp})") result=$(${Chain33Cli} evm query -a "${chain33USDTBridgeTokenAddr}" -c "${chain33TestAddr1}" -b "balanceOf(${chain33Validatorsp})")
# shellcheck disable=SC2219 # shellcheck disable=SC2219
let chain33VspBalancewithdraw=${lockAmount1}*${le8}+${chain33VspBalancebf} let chain33VspBalancewithdraw=lockAmount1*le8+chain33VspBalancebf
is_equal "${result}" "${chain33VspBalancewithdraw}" is_equal "${result}" "${chain33VspBalancewithdraw}"
echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样 ${NOC}" echo -e "${IYellow} ethTestAddr2 ethereum withdraw 接收地址 withdraw 后金额 超额了金额跟之前一样 ${NOC}"
......
...@@ -89,23 +89,23 @@ function start_docker_ebrelayerA() { ...@@ -89,23 +89,23 @@ function start_docker_ebrelayerA() {
} }
function updata_toml() { function updata_toml() {
local name=$1 local name=$1
local file="./relayer$name.toml" local file="./relayer$name.toml"
cp './relayer.toml' "${file}" cp './relayer.toml' "${file}"
# 删除配置文件中不需要的字段 # 删除配置文件中不需要的字段
for deleteName in "deploy4chain33" "deployerPrivateKey" "operatorAddr" "validatorsAddr" "initPowers" "deploy" "deployerPrivateKey" "operatorAddr" "validatorsAddr" "initPowers"; do for deleteName in "deploy4chain33" "deployerPrivateKey" "operatorAddr" "validatorsAddr" "initPowers" "deploy" "deployerPrivateKey" "operatorAddr" "validatorsAddr" "initPowers"; do
delete_line "${file}" "${deleteName}" delete_line "${file}" "${deleteName}"
done done
pushNameChange "${file}" pushNameChange "${file}"
pushHost=$(get_docker_addr "${dockerNamePrefix}_ebrelayer${name}_1") pushHost=$(get_docker_addr "${dockerNamePrefix}_ebrelayer${name}_1")
line=$(delete_line_show "${file}" "pushHost") line=$(delete_line_show "${file}" "pushHost")
sed -i ''"${line}"' a pushHost="http://'"${pushHost}"':20000"' "${file}" sed -i ''"${line}"' a pushHost="http://'"${pushHost}"':20000"' "${file}"
line=$(delete_line_show "${file}" "pushBind") line=$(delete_line_show "${file}" "pushBind")
sed -i ''"${line}"' a pushBind="'"${pushHost}"':20000"' "${file}" sed -i ''"${line}"' a pushBind="'"${pushHost}"':20000"' "${file}"
} }
# start ebrelayer B C D # start ebrelayer B C D
......
...@@ -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