Commit cdb965ad authored by vipwzw's avatar vipwzw

auto ci

parent 95b55d15
...@@ -42,7 +42,6 @@ ethReceiverAddr2="0x0c05ba5c230fdaa503b53702af1962e08d0c60bf" ...@@ -42,7 +42,6 @@ ethReceiverAddr2="0x0c05ba5c230fdaa503b53702af1962e08d0c60bf"
ethReceiverAddrKey2="9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08" ethReceiverAddrKey2="9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08"
maturityDegree=10 maturityDegree=10
function InitAndDeploy() { function InitAndDeploy() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
result=$(${CLIA} relayer set_pwd -n 123456hzj -o kk) result=$(${CLIA} relayer set_pwd -n 123456hzj -o kk)
...@@ -60,8 +59,7 @@ function InitAndDeploy() { ...@@ -60,8 +59,7 @@ function InitAndDeploy() {
function EthImportKey() { function EthImportKey() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# 重启 ebrelayer 并解锁 # 重启 ebrelayer 并解锁
for name in A B C D for name in A B C D; do
do
start_ebrelayer "./"$name"/ebrelayer" "./"$name"/ebrelayer.log" start_ebrelayer "./"$name"/ebrelayer" "./"$name"/ebrelayer.log"
# 导入测试地址私钥 # 导入测试地址私钥
...@@ -107,8 +105,7 @@ function EthImportKey() { ...@@ -107,8 +105,7 @@ function EthImportKey() {
function StartRelayerAndDeploy() { function StartRelayerAndDeploy() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
for name in A B C D for name in A B C D; do
do
local ebrelayer="./$name/ebrelayer" local ebrelayer="./$name/ebrelayer"
kill_ebrelayer "${ebrelayer}" kill_ebrelayer "${ebrelayer}"
done done
...@@ -128,7 +125,7 @@ function StartRelayerAndDeploy() { ...@@ -128,7 +125,7 @@ function StartRelayerAndDeploy() {
# 获取 BridgeRegistry 地址 # 获取 BridgeRegistry 地址
result=$(${CLIA} relayer ethereum bridgeRegistry) result=$(${CLIA} relayer ethereum bridgeRegistry)
BridgeRegistry=$(cli_ret "${result}" "bridgeRegistry" ".addr") BridgeRegistry=$(cli_ret "${result}" "bridgeRegistry" ".addr")
# BridgeRegistry="0x5331F912027057fBE8139D91B225246e8159232f" # BridgeRegistry="0x5331F912027057fBE8139D91B225246e8159232f"
kill_ebrelayer "./A/ebrelayer" kill_ebrelayer "./A/ebrelayer"
# 修改 relayer.toml 配置文件 # 修改 relayer.toml 配置文件
...@@ -211,13 +208,13 @@ function TestChain33ToEthAssets() { ...@@ -211,13 +208,13 @@ function TestChain33ToEthAssets() {
# 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 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}"
result=$(${Chain33Cli} account balance -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -e x2ethereum) result=$(${Chain33Cli} account balance -a 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -e x2ethereum)
balance_ret "${result}" "195.0000" balance_ret "${result}" "195.0000"
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 "${tokenAddr}")
cli_ret "${result}" "balance" ".balance" "5" cli_ret "${result}" "balance" ".balance" "5"
...@@ -230,7 +227,7 @@ function TestChain33ToEthAssets() { ...@@ -230,7 +227,7 @@ function TestChain33ToEthAssets() {
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
# eth 等待 10 个区块 # eth 等待 10 个区块
eth_block_wait $((${maturityDegree}+2)) eth_block_wait $((maturityDegree + 2))
result=$(${Chain33Cli} account balance -a "${chain33SenderAddr}" -e x2ethereum) result=$(${Chain33Cli} account balance -a "${chain33SenderAddr}" -e x2ethereum)
balance_ret "${result}" "5.0000" balance_ret "${result}" "5.0000"
...@@ -258,7 +255,7 @@ function TestETH2Chain33Assets() { ...@@ -258,7 +255,7 @@ function TestETH2Chain33Assets() {
cli_ret "${result}" "balance" ".balance" "10" cli_ret "${result}" "balance" ".balance" "10"
# eth 等待 10 个区块 # eth 等待 10 个区块
eth_block_wait $((${maturityDegree}+2)) eth_block_wait $((maturityDegree + 2))
result=$(${Chain33Cli} x2ethereum balance -s 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -t eth | jq ".res" | jq ".[]") result=$(${Chain33Cli} x2ethereum balance -s 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -t eth | jq ".res" | jq ".[]")
balance_ret "${result}" "10" balance_ret "${result}" "10"
...@@ -267,7 +264,7 @@ function TestETH2Chain33Assets() { ...@@ -267,7 +264,7 @@ function TestETH2Chain33Assets() {
balance=$(cli_ret "${result}" "balance" ".balance") balance=$(cli_ret "${result}" "balance" ".balance")
hash=$(${Chain33Cli} send x2ethereum burn -a 10 -t eth -r ${ethReceiverAddr2} -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv) hash=$(${Chain33Cli} send x2ethereum burn -a 10 -t eth -r ${ethReceiverAddr2} -k 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv)
block_wait "${Chain33Cli}" $((${maturityDegree}+2)) block_wait "${Chain33Cli}" $((maturityDegree + 2))
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
result=$(${Chain33Cli} x2ethereum balance -s 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -t eth | jq ".res" | jq ".[]") result=$(${Chain33Cli} x2ethereum balance -s 12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv -t eth | jq ".res" | jq ".[]")
...@@ -279,7 +276,7 @@ function TestETH2Chain33Assets() { ...@@ -279,7 +276,7 @@ function TestETH2Chain33Assets() {
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
result=$(${CLIA} relayer ethereum balance -o "${ethReceiverAddr2}") result=$(${CLIA} relayer ethereum balance -o "${ethReceiverAddr2}")
cli_ret "${result}" "balance" ".balance" $(echo "${balance}+10"|bc) cli_ret "${result}" "balance" ".balance" $(echo "${balance}+10" | bc)
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -317,14 +314,14 @@ function TestETH2Chain33Erc20() { ...@@ -317,14 +314,14 @@ function TestETH2Chain33Erc20() {
cli_ret "${result}" "balance" ".balance" "100" cli_ret "${result}" "balance" ".balance" "100"
# eth 等待 10 个区块 # eth 等待 10 个区块
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}" "100" balance_ret "${result}" "100"
# 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))
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
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 ".[]")
...@@ -348,7 +345,7 @@ function MainTest() { ...@@ -348,7 +345,7 @@ function MainTest() {
echo -e "${GRE}===========allTest $FUNCNAME begin ===========${NOC}" echo -e "${GRE}===========allTest $FUNCNAME begin ===========${NOC}"
if [[ "${1}" != "" ]]; then if [[ ${1} != "" ]]; then
maturityDegree=${1} maturityDegree=${1}
echo -e "${GRE}maturityDegree is ${maturityDegree} ${NOC}" echo -e "${GRE}maturityDegree is ${maturityDegree} ${NOC}"
fi fi
......
...@@ -2,6 +2,7 @@ package executor ...@@ -2,6 +2,7 @@ package executor
import ( import (
"errors" "errors"
"github.com/33cn/chain33/common/address" "github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
x2ethereumtypes "github.com/33cn/plugin/plugin/dapp/x2Ethereum/types" x2ethereumtypes "github.com/33cn/plugin/plugin/dapp/x2Ethereum/types"
......
...@@ -5,8 +5,9 @@ package types ...@@ -5,8 +5,9 @@ package types
import ( import (
fmt "fmt" fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math" math "math"
proto "github.com/golang/protobuf/proto"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
......
...@@ -6,10 +6,11 @@ package types ...@@ -6,10 +6,11 @@ package types
import ( import (
context "context" context "context"
fmt "fmt" fmt "fmt"
math "math"
types "github.com/33cn/chain33/types" types "github.com/33cn/chain33/types"
proto "github.com/golang/protobuf/proto" proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc" grpc "google.golang.org/grpc"
math "math"
) )
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
......
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